summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Luis Cercos-Pita <jlcercos@gmail.com>2019-10-08 16:57:26 +0200
committerEric Engestrom <eric@engestrom.ch>2019-10-27 00:20:54 +0000
commit34313795c4ad292f0f7355c0ffe302fb387968e0 (patch)
tree8fa1c9d071af647d5eba9d00f236f0ced67cf52d
parent7ee26a2932455d7c2c9aca3f1b86f06a33267b68 (diff)
cl/get-device-info: fix variable type for CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE
Per the spec [1], `CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE` returns a `cl_ulong`, but we were storing it in an `int`, truncating it. [1] https://www.khronos.org/registry/OpenCL/sdk/2.0/docs/man/xhtml/clGetDeviceInfo.html Closes: https://gitlab.freedesktop.org/mesa/piglit/issues/25 Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
-rw-r--r--tests/cl/api/get-device-info.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/cl/api/get-device-info.c b/tests/cl/api/get-device-info.c
index cdfbb265a..c7b6e27c6 100644
--- a/tests/cl/api/get-device-info.c
+++ b/tests/cl/api/get-device-info.c
@@ -59,7 +59,7 @@ piglit_cl_test(const int argc,
size_t param_value_size;
void* param_value;
- int* int_value;
+ cl_ulong* ulong_value;
int num_device_infos = PIGLIT_CL_ENUM_NUM(cl_device_info, env->version);
const cl_device_info *device_infos = PIGLIT_CL_ENUM_ARRAY(cl_device_info);
@@ -154,15 +154,15 @@ piglit_cl_test(const int argc,
* Checks for minimum required values.
*/
- int_value = piglit_cl_get_device_info(env->device_id,
+ ulong_value = piglit_cl_get_device_info(env->device_id,
CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE);
- if (*int_value < 64 * 1024) {
+ if (*ulong_value < 64 * 1024) {
fprintf(stderr, "CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE must be "
"at least 64 KB\n");
piglit_merge_result(&result, PIGLIT_FAIL);
}
- free(int_value);
+ free(ulong_value);
return result;
}