From d6754eb92072332fc6e7d22dd98628d22ce76531 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Mon, 12 Mar 2018 11:04:53 +0100 Subject: clover: implement clSetKernelArgSVMPointer it is pretty much identical to a clSetKernelArg for a scalar field, except it is only valid for global and constant memory pointers. Also the type equals void* on the Host, so we can just check the size of it. v2: prefer using target_size to extend the pointer value v3: handle more corner cases in combiation to clSetKernelArg Signed-off-by: Karol Herbst Reviewed-by: Pierre Moreau Reviewed-by: Francisco Jerez Part-of: --- src/gallium/state_trackers/clover/api/kernel.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/gallium/state_trackers/clover/api') diff --git a/src/gallium/state_trackers/clover/api/kernel.cpp b/src/gallium/state_trackers/clover/api/kernel.cpp index 35b2f5450f7..38a5cc10454 100644 --- a/src/gallium/state_trackers/clover/api/kernel.cpp +++ b/src/gallium/state_trackers/clover/api/kernel.cpp @@ -337,9 +337,15 @@ clEnqueueNativeKernel(cl_command_queue d_q, void (*func)(void *), CLOVER_API cl_int clSetKernelArgSVMPointer(cl_kernel d_kern, cl_uint arg_index, - const void *arg_value) { - CLOVER_NOT_SUPPORTED_UNTIL("2.0"); - return CL_INVALID_VALUE; + const void *arg_value) try { + obj(d_kern).args().at(arg_index).set_svm(arg_value); + return CL_SUCCESS; + +} catch (std::out_of_range &e) { + return CL_INVALID_ARG_INDEX; + +} catch (error &e) { + return e.get(); } CLOVER_API cl_int -- cgit v1.2.3