KhronosGroup / KhronosGroup/OpenCL-CTS

spirv_new fails if SPIR-V is supported but compiler is not available.

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

Description

Currently an OpenCL 3.0 device with `CL_DEVICE_COMPILER_AVAILABLE` set to `CL_FALSE` that reports `"SPIR-V_1.0"` for `CL_DEVICE_IL_VERSION` can not pass `test_spirv_new` as:

1. When running `test_spirv_new` directly it attempts to use `clBuildProgram` (I think all the tests should just SKIP in this case).
2. When passing `--compilation-mode binary` to `test_spirv_new` it does not use the same offline compiler script as the rest of the CTS.
3. Said offline compiler script specification [states that the input is OpenCL C](https://github.com/KhronosGroup/OpenCL-CTS/blob/16bb1d83c5e4c4ee1d73f254e7527345751193c7/test_common/harness/cl_offline_compiler-interface.txt#L12). Changing this specification may be disruptive to implementations that support SPIR-V (or they may all already support this, I don't know).

A workaround is for such a device to just report `""` for `CL_DEVICE_IL_VERSION` as the utility of supporting SPIR-V without a compiler is low (but doing so is consistent with OpenCL C, where `clCreateProgramWithSource` works even if `CL_DEVICE_COMPILER_AVAILABLE` is `CL_FALSE`).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with test_spirv_new and its handling of CL_DEVICE_COMPILER_AVAILABLE, CL_DEVICE_IL_VERSION, and --compilation-mode binary. Compare its offline compiler path with cl_offline_compiler-interface.txt, then determine the intended behavior for SPIR-V-only devices and whether the interface specification must change. Done means the affected tests no longer try clBuildProgram without a compiler and use a consistent supported compilation path.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.