Skip to content

Unintended different behavior between SYCL and OpenCL attributes #1596

Open
@rolandschulz

Description

@rolandschulz
#define __private __attribute__((opencl_private))
#define __local   __attribute__((opencl_local))

//struct S { void f() __private; }; //should be OK, but is error

void t() {
    //__private int i1; //should be OK, but is error
    int i2;
    __private int* p;
    __local int* l;
    p-l; //should be error "non-overlapping address spaces"
}

OCL C++ version: https://godbolt.org/z/wCDKhZ

For users to use the decorated pointer (from multi_ptr::pointer_t) for performance tuning it is important this doesn't have any unintentional differences.

  • Attribute on methods is important to have a this pointer with attribute
  • Allowing attribute on variable avoids having to strip address space in templated code
  • Error for non-overlapping address space is important to have correct code

#1581 contains some previous discussion of this issue.

Metadata

Metadata

Assignees

Labels

upstreamThis change is related to upstreaming SYCL support to llorg.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions