From 4ca6ba985b54065146321fa7a540d056b3ff54ca Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sat, 12 Nov 2016 21:58:54 +0100 Subject: [PATCH] opencl: Fix type of parameter for clGetProgramInfo CL_PROGRAM_NUM_DEVICES expects a cl_uint. Passing size_t results in a wrong value for numDevices on hosts where sizeof(cl_uint) != sizeof(size_t). Signed-off-by: Stefan Weil --- opencl/openclwrapper.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opencl/openclwrapper.cpp b/opencl/openclwrapper.cpp index 4bd91cd286..68020702e2 100644 --- a/opencl/openclwrapper.cpp +++ b/opencl/openclwrapper.cpp @@ -462,7 +462,8 @@ int OpenclDevice::GeneratBinFromKernelSource( cl_program program, const char * c { unsigned int i = 0; cl_int clStatus; - size_t *binarySizes, numDevices=0; + size_t *binarySizes; + cl_uint numDevices; cl_device_id *mpArryDevsID; char **binaries, *str = NULL;