Skip to content

Validate the scope of group-local variables definintion #3436

@mlychkov

Description

@mlychkov

Checking validity should somehow be addressed for group-local variables definintions.
It should be checked that __sycl_allocateLocalMemory (or its source form - group_local_memory) does not occur:

  • in a function (other than user lambda/functor)
  • in a loop
  • in a non-convergent control flow

I think it is OK to occur in convergent if. Some execution paths will just not use the global created for the allocation.

But LLVM pass is not the best place to diagnose these cases. Error checking should be done in the front-end compiler.

Originally posted by @kbobrovs in #3329 (comment)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions