KhronosGroup / KhronosGroup/OpenCL-Docs

Reduce verbosity of address spaces for builtin functions in OpenCL

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

Description

While writing https://github.com/KhronosGroup/OpenCL-Docs/pull/358 I added a lot of overloads of atomic builtin functions for different address spaces.

The OpenCL C spec currently uses `gentype` language to reduce duplication of definitions of builtin functions that only vary by type. The same approach could be added for address spaces, something like `genaddrspace`. This was previously suggest on an OpenCL tooling call.

This could be done initially for the atomic functions that inspired this. In principal it may help with other builtins as well.

It would need to be clear the `gentype` and `genaddrspace` combine to create a cross-product of instantiations.

Also atomics operate on `{global, local}` (`private` is still in discussion on https://github.com/KhronosGroup/OpenCL-Docs/issues/331),but non-atomic operations that can read from memory are generally defined for `{global, local, private, constant}` but ones that can write to memory generally only for `{global, local, constant}`.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the OpenCL C specification's atomic builtin definitions and the related discussion in pull request 358 and issue 331. Define how gentype and the proposed genaddrspace combine, including the permitted address-space sets for atomic and non-atomic builtins. Done means the atomic definitions are less repetitive without changing their intended address-space coverage.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
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.