mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-25 00:09:02 +00:00
Fix uninitialised memory use. (#1909)
CL_DEVICE_MAX_WORK_GROUP_SIZE is specified to fill in a size_t. By asking it to fill in an uninitialised cl_long, on platforms where size_t is smaller than cl_long, the high bits of the cl_long remain uninitialised.
This commit is contained in:
@@ -141,7 +141,7 @@ int test_copy2D(const cl_device_id deviceID, const cl_context context,
|
|||||||
test_error(error,
|
test_error(error,
|
||||||
"clGetDeviceInfo for CL_DEVICE_MAX_MEM_ALLOC_SIZE failed.");
|
"clGetDeviceInfo for CL_DEVICE_MAX_MEM_ALLOC_SIZE failed.");
|
||||||
|
|
||||||
cl_long max_work_group_size;
|
size_t max_work_group_size;
|
||||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_MAX_WORK_GROUP_SIZE,
|
error = clGetDeviceInfo(deviceID, CL_DEVICE_MAX_WORK_GROUP_SIZE,
|
||||||
sizeof(max_work_group_size), &max_work_group_size,
|
sizeof(max_work_group_size), &max_work_group_size,
|
||||||
NULL);
|
NULL);
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ int test_copy3D(const cl_device_id deviceID, const cl_context context,
|
|||||||
test_error(error,
|
test_error(error,
|
||||||
"clGetDeviceInfo failed for CL_DEVICE_MAX_WORK_ITEM_SIZES");
|
"clGetDeviceInfo failed for CL_DEVICE_MAX_WORK_ITEM_SIZES");
|
||||||
|
|
||||||
cl_long max_work_group_size;
|
size_t max_work_group_size;
|
||||||
error = clGetDeviceInfo(deviceID, CL_DEVICE_MAX_WORK_GROUP_SIZE,
|
error = clGetDeviceInfo(deviceID, CL_DEVICE_MAX_WORK_GROUP_SIZE,
|
||||||
sizeof(max_work_group_size), &max_work_group_size,
|
sizeof(max_work_group_size), &max_work_group_size,
|
||||||
NULL);
|
NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user