KhronosGroup / KhronosGroup/OpenCL-Docs

Does cl_khr_integer_dot_product require OpenCL C 3.0?

Open
#1,328 7 comments 1 reaction 0 assignees View on GitHub

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.

Logically speaking, this is the behavior described in the OpenCL C spec:

  1. The Features section says that "Feature test macros require support for OpenCL C 3.0 or newer."
  2. The new built-in functions added by cl_khr_integer_dot_product functions (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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.