clover: Query the device to see if images are supported
authorTom Stellard <thomas.stellard@amd.com>
Thu, 24 Jul 2014 00:37:08 +0000 (20:37 -0400)
committerTom Stellard <thomas.stellard@amd.com>
Fri, 25 Jul 2014 16:49:45 +0000 (12:49 -0400)
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/gallium/state_trackers/clover/api/device.cpp
src/gallium/state_trackers/clover/core/device.cpp
src/gallium/state_trackers/clover/core/device.hpp

index 97b2cf9c9968ef2293e825d40af4e54905d4673d..e82546842580e22b9b25675c781481fc46921fd4 100644 (file)
@@ -184,7 +184,7 @@ clGetDeviceInfo(cl_device_id d_dev, cl_device_info param,
       break;
 
    case CL_DEVICE_IMAGE_SUPPORT:
-      buf.as_scalar<cl_bool>() = CL_TRUE;
+      buf.as_scalar<cl_bool>() = dev.image_support();
       break;
 
    case CL_DEVICE_MAX_PARAMETER_SIZE:
index b6078db18a45ae244aacf50e4133973af138955f..63aa1935c7f56182e8246868060ddbaacb2e498b 100644 (file)
@@ -169,6 +169,12 @@ device::max_compute_units() const {
                                       PIPE_COMPUTE_CAP_MAX_COMPUTE_UNITS)[0];
 }
 
+bool
+device::image_support() const {
+   return get_compute_param<uint32_t>(pipe,
+                                      PIPE_COMPUTE_CAP_IMAGES_SUPPORTED)[0];
+}
+
 std::vector<size_t>
 device::max_block_size() const {
    auto v = get_compute_param<uint64_t>(pipe, PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE);
index 731c31e5a2fbeb6879b328a1aaa4de13d57a8c8e..22017005a002655f0b5dba1a0008481038636ad2 100644 (file)
@@ -63,6 +63,7 @@ namespace clover {
       cl_ulong max_mem_alloc_size() const;
       cl_uint max_clock_frequency() const;
       cl_uint max_compute_units() const;
+      bool image_support() const;
 
       std::vector<size_t> max_block_size() const;
       std::string device_name() const;