KhronosGroup / KhronosGroup/OpenCL-CTS

feature_macro test to stringent for spirv and binary modes

Open
#1,026 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
232
Forks
235
Avg merge
8d 7h
Merged PRs (30d)
18

Description

The feature macro test: https://github.com/KhronosGroup/OpenCL-CTS/blob/master/test_conformance/compiler/test_feature_macro.cpp calls `create_single_kernel_helper_create_program` which in binary and spirv mode will call into offline compiler executables.

In the case of a compilation error `create_single_kernel_helper_create_program` returns an error to the caller in binary/spirv mode since the compiler will not have produced and output file it can read back into the runtime (this doesn't happen in online mode since the CL C isn't compiled during the call to `create_single_kernel_helper_create_program` in this case, this happens later on in a call to `clBuildProgram`).

Since this feature macro test expects the compiler to fail (it uses this information later on to detect whether a feature macro is supported by the compiler) the return error code of these calls to `create_single_kernel_helper_create_program` should not cause the test itself to fail in spirv/binary modes like it does here: https://github.com/KhronosGroup/OpenCL-CTS/blob/master/test_conformance/compiler/test_feature_macro.cpp#L143.

As it stands the test is skipped in binary mode, but is not in spirv mode since there needs to be a compiler in the runtime to consume the spirv. By replacing calls to `create_single_kernel_helper_create_program` with calls to `create_single_kernel_helper` and removing subsequent calls to `clBuildProgram` (like here: https://github.com/KhronosGroup/OpenCL-CTS/blob/master/test_conformance/compiler/test_feature_macro.cpp#L143) in the test, then using the results of the calls to `create_single_kernel_helper` to determine whether compilation succeeded or failed (this will work for all three compilation modes), the above issue could be resolved and this test could be run in binary mode as well as online and spirv.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with test_conformance/compiler/test_feature_macro.cpp, especially the call near line 143, and trace how create_single_kernel_helper_create_program handles online, binary, and SPIR-V modes. Compare it with create_single_kernel_helper and the related clBuildProgram calls. Done means compilation success or failure is evaluated consistently across all three modes and the test can run in binary mode as well as online and SPIR-V modes.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.