From 73dd7cedb59ca6452cb016ccd7396c4af01abef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20L=C3=BCtke=20Dreimann?= Date: Mon, 23 Jun 2025 13:33:57 +0200 Subject: [PATCH] fixed ocl layer + warning for missing SLM support --- repos/hello_gpgpu/src/hello_gpgpu/CL/cl.cc | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/repos/hello_gpgpu/src/hello_gpgpu/CL/cl.cc b/repos/hello_gpgpu/src/hello_gpgpu/CL/cl.cc index 7c613d828b..ff17bce5e6 100644 --- a/repos/hello_gpgpu/src/hello_gpgpu/CL/cl.cc +++ b/repos/hello_gpgpu/src/hello_gpgpu/CL/cl.cc @@ -41,8 +41,10 @@ clGetPlatformIDs(cl_uint num_entries, cl_platform_id * platforms, cl_uint * num_platforms) { - *platforms = 0; - *num_platforms = 1; + if(platforms != nullptr) + *platforms = 0; + if(num_platforms != nullptr) + *num_platforms = 1; return CL_SUCCESS; } @@ -104,8 +106,10 @@ clGetDeviceIDs(cl_platform_id platform, if(device_type != CL_DEVICE_TYPE_GPU) return CL_INVALID_VALUE; - *devices = 0; - *num_devices = 1; + if(devices != nullptr) + *devices = 0; + if(num_devices != nullptr) + *num_devices = 1; return CL_SUCCESS; } @@ -836,7 +840,12 @@ clSetKernelArg(cl_kernel kernel, struct kernel_config* kc = (struct kernel_config*)kernel; - if(arg_size == sizeof(cl_mem)) + if(arg_value == nullptr) // SLM + { + Genode::error("[OCL] SLM is not supported!"); + return CL_INVALID_VALUE; + } + else if(arg_size == sizeof(cl_mem)) { cl_mem* clmem = (cl_mem*)arg_value; kc->buffConfigs[arg_index] = (*clmem)->bc;