Repository navigation
Conversation
The test verifies that a compiled binary from a program with an embedded header and an unresolved external kernel can be loaded using `clCreateProgramWithBinary` and retains the `CL_PROGRAM_BINARY_TYPE_COMPILED_OBJECT` type (per OpenCL spec). [run-test: test_api binary_create_with_header]
|
|
||
| REGISTER_TEST(binary_create_with_header) | ||
| { | ||
| cl_int error; |
There was a problem hiding this comment.
| cl_int error; | |
| check_compiler_available(device); | |
| cl_int error; |
I think that test should also be added to subtests_to_skip_with_offline_compiler in test_common/harness/errorHelpers.cpp
| const char *sample_header_source = | ||
| "extern __kernel void CopyBuffer(__global float *src,\n" | ||
| " __global float *dst);\n"; | ||
|
|
||
| const char *sample_header_name = "simple_header.h"; | ||
|
|
||
| const char *sample_source_with_header = |
There was a problem hiding this comment.
| const char *sample_header_source = | |
| "extern __kernel void CopyBuffer(__global float *src,\n" | |
| " __global float *dst);\n"; | |
| const char *sample_header_name = "simple_header.h"; | |
| const char *sample_source_with_header = | |
| static const char *sample_header_source = | |
| "extern __kernel void CopyBuffer(__global float *src,\n" | |
| " __global float *dst);\n"; | |
| static const char *sample_header_name = "simple_header.h"; | |
| static const char *sample_source_with_header = |
Use check_compiler_available and skip the test in offline compilation modes.
| // | ||
| // Not all compiler tests need to use this macro, only those that don't use the | ||
| // test harness compiler helpers. | ||
| #define check_compiler_available(DEVICE) \ |
There was a problem hiding this comment.
Rather than duplicating check_compiler_available from test_conformance/compiler/testBase.h into test_conformance/api/testBase.h, could you move its definition from test_conformance/compiler/testBase.h to test_common/harness/testHarness.h (e.g. next to REQUIRE_EXTENSION) so both test suites share it?
|
So I've looked into why this used to crash in rusticl (it doesn't anymore since 26.1) and the reason is simply that a binary was created from a program that has unresolved symbols left, meaning it can't be turned into an executable yet. I think it would be better to reflect that in the test name explicitly. |
Move the macro to testHarness.h next to REQUIRE_EXTENSION and remove the duplicate definitions from both testBase.h headers.
The test verifies that a compiled binary obtained from a source program with an embedded header can be loaded with
clCreateProgramWithBinary.The test crashes on Rusticl radeonsi during
clCreateProgramWithBinary. The process aborts with the assertionnir_shader_gather_info only works with linked shaders.Tested on:
[run-test: test_api binary_create_with_header]