From 0ec858764204bf502535b799210db674de7c9e8a Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Wed, 23 Jul 2014 20:37:08 -0400 Subject: [PATCH] clover: Query the device to see if images are supported Reviewed-by: Francisco Jerez --- src/gallium/state_trackers/clover/api/device.cpp | 2 +- src/gallium/state_trackers/clover/core/device.cpp | 6 ++++++ src/gallium/state_trackers/clover/core/device.hpp | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/clover/api/device.cpp b/src/gallium/state_trackers/clover/api/device.cpp index 97b2cf9c996..e8254684258 100644 --- a/src/gallium/state_trackers/clover/api/device.cpp +++ b/src/gallium/state_trackers/clover/api/device.cpp @@ -184,7 +184,7 @@ clGetDeviceInfo(cl_device_id d_dev, cl_device_info param, break; case CL_DEVICE_IMAGE_SUPPORT: - buf.as_scalar() = CL_TRUE; + buf.as_scalar() = dev.image_support(); break; case CL_DEVICE_MAX_PARAMETER_SIZE: diff --git a/src/gallium/state_trackers/clover/core/device.cpp b/src/gallium/state_trackers/clover/core/device.cpp index b6078db18a4..63aa1935c7f 100644 --- a/src/gallium/state_trackers/clover/core/device.cpp +++ b/src/gallium/state_trackers/clover/core/device.cpp @@ -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(pipe, + PIPE_COMPUTE_CAP_IMAGES_SUPPORTED)[0]; +} + std::vector device::max_block_size() const { auto v = get_compute_param(pipe, PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE); diff --git a/src/gallium/state_trackers/clover/core/device.hpp b/src/gallium/state_trackers/clover/core/device.hpp index 731c31e5a2f..22017005a00 100644 --- a/src/gallium/state_trackers/clover/core/device.hpp +++ b/src/gallium/state_trackers/clover/core/device.hpp @@ -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 max_block_size() const; std::string device_name() const; -- 2.30.2