[compute] 36/49: fix a few instances where the device type is not used as a bit mask

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Fri Dec 18 17:58:20 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch master
in repository compute.

commit 9211260bccb6ef08f9414e7caaf5c96b95bf957a
Author: Lorenzo Pistone <blaffablaffa at gmail.com>
Date:   Tue Sep 8 18:29:45 2015 +0200

    fix a few instances where the device type is not used as a bit mask
---
 include/boost/compute/system.hpp | 8 ++++----
 test/test_command_queue.cpp      | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/boost/compute/system.hpp b/include/boost/compute/system.hpp
index ba8d77b..f205fec 100644
--- a/include/boost/compute/system.hpp
+++ b/include/boost/compute/system.hpp
@@ -226,11 +226,11 @@ private:
                     continue;
 
                 if (type && matches(std::string("GPU"), type))
-                    if (device.type() != device::gpu)
+                    if (!(device.type() & device::gpu))
                         continue;
 
                 if (type && matches(std::string("CPU"), type))
-                    if (device.type() != device::cpu)
+                    if (!(device.type() & device::cpu))
                         continue;
 
                 if (platform && !matches(device.platform().name(), platform))
@@ -247,7 +247,7 @@ private:
         for(size_t i = 0; i < devices_.size(); i++){
             const device& device = devices_[i];
 
-            if(device.type() == device::gpu){
+            if(device.type() & device::gpu){
                 return device;
             }
         }
@@ -256,7 +256,7 @@ private:
         for(size_t i = 0; i < devices_.size(); i++){
             const device& device = devices_[i];
 
-            if(device.type() == device::cpu){
+            if(device.type() & device::cpu){
                 return device;
             }
         }
diff --git a/test/test_command_queue.cpp b/test/test_command_queue.cpp
index 9609b68..6a61fdd 100644
--- a/test/test_command_queue.cpp
+++ b/test/test_command_queue.cpp
@@ -163,7 +163,7 @@ BOOST_AUTO_TEST_CASE(write_buffer_rect)
     // skip this test on AMD GPUs due to a buggy implementation
     // of the clEnqueueWriteBufferRect() function
     if(device.vendor() == "Advanced Micro Devices, Inc." &&
-       device.type() == boost::compute::device::gpu){
+       device.type() & boost::compute::device::gpu){
         std::cerr << "skipping write_buffer_rect test on AMD GPU" << std::endl;
         return;
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/compute.git



More information about the debian-science-commits mailing list