Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local memory not only at the outermost level. #149

Open
IgorErin opened this issue Feb 25, 2023 · 2 comments
Open

Local memory not only at the outermost level. #149

IgorErin opened this issue Feb 25, 2023 · 2 comments

Comments

@IgorErin
Copy link
Member

The ability to declare local memory in not only at the outermost level in the kernel.

In OpenCL 3.0: variables declared in the outermost compound statement inside the body of the kernel function can be qualified by the local or constant address spaces.

To Reproduce
Steps to reproduce the behavior:

<@ fun someLength ->
    let gid = ndRange.GlobalID0
    let lid = ndRange.LocalID0

   if gid <= someLength then
        // Example of variable in __local address space but not
        // declared at __kernel function scope.
        let localPtr = localArray<int> localPointersArraySize // error @>

Expected behavior
Successful compilation and execution.

Desktop:

  • OpenCL 2.0, OpenCL 3.0
@gsvgit
Copy link
Member

gsvgit commented Feb 26, 2023

We can

  1. Automatically lift local varialbles up
  2. Pass --cl-std=CL1.2 to compiler
  3. Manualy lift local variable up

@IgorErin
Copy link
Member Author

I don't quite understand why the problem with allocating local memory should be solved at the translator level. Is it fair to implicitly move a potential user's code this way? Doesn't this change the semantics of the program too much?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants