diff --git a/include/CL/opencl.hpp b/include/CL/opencl.hpp index dc44c220..b1f492d8 100644 --- a/include/CL/opencl.hpp +++ b/include/CL/opencl.hpp @@ -1505,6 +1505,9 @@ CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_COMPUTE_UNITS_BITFIELD_AR #ifdef CL_DEVICE_JOB_SLOTS_ARM CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_JOB_SLOTS_ARM, cl_uint) #endif +#ifdef CL_DEVICE_SCHEDULING_CONTROLS_CAPABILITIES_ARM +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_SCHEDULING_CONTROLS_CAPABILITIES_ARM, cl_bitfield) +#endif #ifdef CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV, cl_uint) @@ -6145,6 +6148,17 @@ class Kernel : public detail::Wrapper sizeof(void*)*(1 + sizeof...(Ts)), pointerList.data())); } + + template + cl_int setExecInfo(cl_kernel_exec_info param_name, const T& val) + { + return detail::errHandler( + ::clSetKernelExecInfo( + object_, + param_name, + sizeof(T), + &val)); + } #endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 200 #if CL_HPP_TARGET_OPENCL_VERSION >= 210 diff --git a/tests/test_openclhpp.cpp b/tests/test_openclhpp.cpp index 26ee5541..f27f6217 100644 --- a/tests/test_openclhpp.cpp +++ b/tests/test_openclhpp.cpp @@ -1535,6 +1535,20 @@ void testKernelSetArgLocal() kernelPool[0].setArg(2, cl::Local(123)); } +void testKernelSetExecInfo() +{ +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 + cl_bool val = CL_TRUE; + // Using CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM in the tests since it's + // defined by the core spec but this function is particularly useful for + // vendor extensions. + clSetKernelExecInfo_ExpectAndReturn(make_kernel(0), + CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM, + sizeof(cl_bool), &val, CL_SUCCESS); + kernelPool[0].setExecInfo(CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM, val); +#endif +} + /**************************************************************************** * Tests for cl::copy ****************************************************************************/