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

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

Closed
MrSidims opened this issue Jul 5, 2020 · 0 comments
Closed
Assignees

Comments

@MrSidims
Copy link
Contributor

MrSidims commented Jul 5, 2020

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__
@MrSidims MrSidims self-assigned this Jul 5, 2020
MrSidims added a commit to MrSidims/llvm that referenced this issue Jul 17, 2020
This patch serves two purposes:
1. It reverts shift of accessors to global buffers from __global to
   __global_device address space, which was considered as not a good
   idea until proven otherwise. Still this shift is enabled under
   -fsycl_enable_usm_address_spaces option for testing;
2. It fixes a mangling issue of functions that accepts arguments
   of multi_ptr<> type for non-SPIR targets (see:
   intel#2039)

Signed-off-by: Dmitry Sidorov <dmitry.sidorov@intel.com>
bader pushed a commit that referenced this issue Jul 18, 2020
This patch serves two purposes:
1. It reverts shift of accessors to global buffers from __global to
   __global_device address space, which was considered as not a good
   idea until proven otherwise. Still this shift is enabled under
   -fsycl_enable_usm_address_spaces option for testing;
2. It fixes a mangling issue of functions that accepts arguments
   of multi_ptr<> type for non-SPIR targets (see:
   #2039)

Signed-off-by: Dmitry Sidorov <dmitry.sidorov@intel.com>
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

1 participant