-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL][HIP][libclc] Fix wrong address spaces for HIP #4966
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include <spirv/spirv.h> | ||
|
||
_CLC_DEF void _Z23__spirv_GroupWaitEventsjiP9ocl_event(unsigned int scope, | ||
int num_events, | ||
event_t __attribute__((address_space(0)))* event_list) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
there is a need for selective enabling of 2.0. The lib is tailored for 1.2 so that will probably not turned as expected (you suddenly make pointers to private pointers to generic). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh... wait. Are we calling OpenCL 1.2 built-in here? Shouldn't we apply private address space attribute on SYCL side in this case and explicitly cast to correct AS? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well there is an overload for generic. Never mattered for PTX because the target address space for private and generic overlap. The runtime header could be patch to call the privare overload (it will always be a pointer to private AFAIK). But TBH, there is an issue in the device event design as the stored pointer is a dangling one #4959 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
So, which way do you think is better to handle this issue: update the runtime to call correct overload overload or apply this patch? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Naghasan I think the question above was meant for you. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oups sorry
There is a need for a broader course of action regarding generic address space handling here, so as the patch is ready, I would say ship it. Once the generic is better handled, this will go away. |
||
__spirv_ControlBarrier(scope, Workgroup, SequentiallyConsistent); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is also missing the overload for private
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried adding that, but I can't get it to work (linker is not finding this).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/intel/llvm/blob/sycl/clang/lib/AST/ItaniumMangle.cpp#L2560 is causing different mangling.
In SYCL mode, Default will be 0, so no
UAS0
will be added, by in CL mode, Default is5
(private) causing the addition ofUAS0
.This could either be recovered by the remangler (a bit dirty but more scalable) or handled by manual mangling (not great).