Skip to content

[SYCL] Mangling issues for device_ptr/global_ptr for non-SPIR targets #2039

Closed
@MrSidims

Description

@MrSidims

The issue is described here: #1864 (comment)

#1864 adds two new aliases for multi_ptr class: device_ptr and host_ptr that are appropriately mapped on opencl_global_device and opencl_global_host address spaces added in #1704 .
So now it's possible for users to define two functions like this:
void foo(global_ptr<int>::pointer_t p) { [...] } void foo(device_ptr<int>::pointer_t p) { [...] }

For SPIR target it's okay, since the function can be overloaded due to different mangling for both of these versions. But for non-SPIR targets (for example for nvptx) the mangling will be the same, because there opencl_global_device and opencl_global_host are mapped on addressspace(1) in LLVM IR.

There are two possible solutions for this problem:

  1. Change mangling rules;
  2. Driver one - we can defined a macro _ENABLE_USM_ADDR_SPACES_ only for FPGA H/W and use this macro in the headers, defining __OPENCL_GLOBAL_DEVICE_AS__ as __OPENCL_GLOBAL_AS__

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions