Dynamically select -cl-std Build Option for get_(global|local)_linear_id (#876)

* Dynamically select the build option `-cl-std` for the
`get_(global|local)_linear_id()` builtin based on the device version
of the driver.
This commit is contained in:
Jack Frankland
2020-09-01 00:14:10 +02:00
committed by GitHub
parent 3cc9c2c579
commit 581d9ea990
3 changed files with 14 additions and 5 deletions

View File

@@ -81,9 +81,13 @@ test_local_linear_id(cl_device_id device, cl_context context, cl_command_queue q
streams = clCreateBuffer(context, (cl_mem_flags)(CL_MEM_READ_WRITE), length*sizeof(int), NULL, &err);
test_error( err, "clCreateBuffer failed.");
err = create_single_kernel_helper_with_build_options(context, &program[0], &kernel[0], 1, &local_linear_id_1d_code, "test_local_linear_id_1d", "-cl-std=CL2.0");
err = create_single_kernel_helper(context, &program[0], &kernel[0], 1,
&local_linear_id_1d_code,
"test_local_linear_id_1d");
test_error( err, "create_single_kernel_helper failed");
err = create_single_kernel_helper_with_build_options(context, &program[1], &kernel[1], 1, &local_linear_id_2d_code, "test_local_linear_id_2d", "-cl-std=CL2.0");
err = create_single_kernel_helper(context, &program[1], &kernel[1], 1,
&local_linear_id_2d_code,
"test_local_linear_id_2d");
test_error( err, "create_single_kernel_helper failed");
err = clSetKernelArg(kernel[0], 0, sizeof streams, &streams);