KhronosGroup / KhronosGroup/OpenCL-Docs

Address spaces and function parameters

Open
#644 4 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

The OpenCL C specification currently states (emphasis mine):

>Most of the restrictions from section 5.1.2 and section 5.3 of the Embedded C Specification apply in
OpenCL C, e.g. address spaces can not be used with a return type, **a function parameter**, or a
function type, and multiple address space qualifiers are not allowed.

Address space qualifiers on function parameters are accepted by compilers and a very necessary feature in the absence of generic address space support. Here's a quick code example:

```
int example(global int* ptr, int val) {
return *ptr + val;
}
```
Am I misunderstanding what the specification means by "function parameter". Is this a mistake?

Contributor guide

Open the contributing guide

Research direction

Start with the OpenCL C specification passages cited in sections 5.1.2 and 5.3, and compare their restriction on address spaces with the example using a global-qualified function parameter. Check how the wording is interpreted by current OpenCL C compilers. Done means resolving whether the statement is erroneous or clarifying it so parameter address spaces are unambiguous.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.