Skip to content

Commit 5b2c1ac

Browse files
authored
Add clFinish to compiler multiple_build_program test before building again (#2574)
[clBuildProgram](https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#clBuildProgram) has the next error condition: > [CL_INVALID_OPERATION](https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#CL_INVALID_OPERATION) if there are kernel objects attached to program. The test needs to wait for the NDRangeKernel to finish in order to build the program again. If not, kernel0 might still have references and therefore still be attached to program.
1 parent 65fd490 commit 5b2c1ac

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test_conformance/compiler/test_compile.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3983,6 +3983,9 @@ REGISTER_TEST(multiple_build_program)
39833983
error = clEnqueueNDRangeKernel(queue, kernel0, 1, NULL, &num_threads,
39843984
NULL, 0, NULL, NULL);
39853985
test_error(error, "clEnqueueNDRangeKernel failed");
3986+
3987+
error = clFinish(queue);
3988+
test_error(error, "clFinish failed");
39863989
}
39873990

39883991
{
@@ -4001,10 +4004,10 @@ REGISTER_TEST(multiple_build_program)
40014004
error = clEnqueueNDRangeKernel(queue, kernel1, 1, NULL, &num_threads,
40024005
NULL, 0, NULL, NULL);
40034006
test_error(error, "clEnqueueNDRangeKernel failed");
4004-
}
40054007

4006-
error = clFinish(queue);
4007-
test_error(error, "clFinish failed");
4008+
error = clFinish(queue);
4009+
test_error(error, "clFinish failed");
4010+
}
40084011

40094012
std::vector<cl_int> test_values(num_threads, 0);
40104013
error = clEnqueueReadBuffer(queue, out_stream_0, true, 0,

0 commit comments

Comments
 (0)