From 9dc0369cee0649047ccf16cc0e9a3ab941b5ed07 Mon Sep 17 00:00:00 2001 From: Trung Nguyen Date: Sun, 15 Jan 2023 23:28:48 -0600 Subject: [PATCH] Attempted to resolve the address space change issue when casting for OpenCL 2.0 (ref: https://www.intel.com/content/www/us/en/developer/articles/technical/the-generic-address-space-in-opencl-20.html#06_address_space_casting) --- lib/gpu/lal_device.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/gpu/lal_device.cpp b/lib/gpu/lal_device.cpp index cdac6dfc97..1dbe1a0c40 100644 --- a/lib/gpu/lal_device.cpp +++ b/lib/gpu/lal_device.cpp @@ -386,6 +386,9 @@ int DeviceT::set_ocl_params(std::string s_config, const std::string &extra_args) } _ocl_compile_string="-cl-mad-enable "; + #ifdef CL_VERSION_2_0 + _ocl_compile_string+="-cl-std=CL2.0 "; + #endif if (params[4]!="0") _ocl_compile_string+="-cl-fast-relaxed-math "; _ocl_compile_string+=std::string(OCL_INT_TYPE)+" "+ std::string(OCL_PRECISION_COMPILE);