KhronosGroup / KhronosGroup/OpenCL-Docs

Expose OpenCL address space qualifiers as type attributes.

Open
#176 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
420
Forks
131
Avg merge
5d 13h
Merged PRs (30d)
11

Description

OpenCL C standard adds new language keywords to C language to qualify types with address space information (see section 6.1.9 of OpenCL C v2.0 specification).

While working on SYCL implementation (C++-based) we tried to leverage compiler infrastructure developed for OpenCL C, including new keywords. Unfortunately new keywords break compilation of valid SYCL code and can't be used "as-is", so we expose them as "clang specific" type attributes (see https://reviews.llvm.org/D71005). Aaron Ballman proposed to have OpenCL specific type attributes, so we can re-use them for both: OpenCL and SYCL compilers.

WG14 has accepted C++ attribute syntax to C2x and address space qualifiers can be added to the language as OpenCL specific attributes: `[[opencl::private]]`, `[[opencl::local]]`, `[[opencl::constant]]` and `[[opencl::global]]`.

I'd like to know OpenCL WG opinion on whether this makes sense and if so, can we add this spelling to the specification?

Contributor guide

Open the contributing guide

Research direction

Start with section 6.1.9 of the OpenCL C v2.0 specification and the linked LLVM review D71005. Compare the proposed [[opencl::...]] spellings with the existing qualifiers, then determine whether the OpenCL WG accepts adding this syntax to the specification; the issue does not name files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cpp
Domain
documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.