From ca3c8526efc57eb90dcb238dd740cfe41df13b31 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 21 Sep 2016 13:13:50 +0200 Subject: Valgrind reports read of uninitialized bCLBool ...during e.g. CppunitTest_sc_subsequent_filters_test, where CL_DEVICE_LINKER_AVAILABLE is apparently a later addition ( mentions it while doesn't). Change-Id: Icdaeffa4adb0765a6317f443130fa295761eb93f --- opencl/inc/opencl_device_selection.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'opencl') diff --git a/opencl/inc/opencl_device_selection.h b/opencl/inc/opencl_device_selection.h index 3ed1bd8f3b33..543c6297a108 100644 --- a/opencl/inc/opencl_device_selection.h +++ b/opencl/inc/opencl_device_selection.h @@ -127,7 +127,9 @@ inline OString getDeviceType(cl_device_id aDeviceId) inline bool getDeviceInfoBool(cl_device_id aDeviceId, cl_device_info aDeviceInfo) { - cl_bool bCLBool; + cl_bool bCLBool = 0; + // init to false in case clGetDeviceInfo returns CL_INVALID_VALUE when + // requesting unsupported (in version 1.0) CL_DEVICE_LINKER_AVAILABLE clGetDeviceInfo(aDeviceId, aDeviceInfo, sizeof(bCLBool), &bCLBool, nullptr); return bCLBool == CL_TRUE; } -- cgit