KhronosGroup / KhronosGroup/OpenCL-Docs
Does cl_khr_integer_dot_product require OpenCL C 3.0?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 421
- Forks
- 132
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 11
Description
I'm not sure if this is a Clang issue or an OpenCL spec issue, but I figure I'll start here.
It looks like Clang compiles OpenCL kernels that use the cl_khr_integer_dot_product extension when passed -cl-std=CL3.0, but it does not when compiling for previous OpenCL C versions.
- Here is an example that fails when compiling for OpenCL C 1.2: https://godbolt.org/z/9xPxWhPYq
- Here is the same example that succeeds when compiling for OpenCL C 3.0: https://godbolt.org/z/MWMMrWhnq
Logically speaking, this is the behavior described in the OpenCL C spec:
- The Features section says that "Feature test macros require support for OpenCL C 3.0 or newer."
- The new built-in functions added by
cl_khr_integer_dot_productfunctions (e.g. dot) say "Requires that the __opencl_c_integer_dot_product_input_4x8bit feature macro is defined."
This behavior is surprising to some users, though, especially because the metadata page for cl_khr_integer_dot_product doesn't say anything about an OpenCL C 3.0 requirement. In fact, instead it says (emphasis mine): "OpenCL C compilers supporting this extension will define the extension macro cl_khr_integer_dot_product, and may define corresponding feature macros __opencl_c_integer_dot_product_input_4x8bit and __opencl_c_integer_dot_product_input_4x8bit_packed depending on the reported capabilities."
What is the intended behavior? Does cl_khr_integer_dot_product require OpenCL C 3.0?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the OpenCL C 3.0 Features section and the integer dot-product built-in function requirements, then compare them with the cl_khr_integer_dot_product metadata quoted in the issue. Review the linked OpenCL C 1.2 and 3.0 compiler examples and the comment discussion. Done means the intended version and extension requirements are resolved and the relevant specification wording is clarified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100