-
Notifications
You must be signed in to change notification settings - Fork 790
[SYCL] Support *global_[device|host]_space
in static_address_cast
#15498
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
Conversation
When these address spaces are used with regular `sycl::detail::spirv::GenericCastToPtr` they are turned into `unreachable`. We don't have a SPIR-V intrinsic yet (or maybe we shouldn't even have it, and will continue to rely on standard LLVM IR's `addrspacecast`), so use C-style cast and rely on the translator/backend to generate proper operation, similarly to `sycl::detail::cast_AS`.
@gmlueck , @Pennycook , I'm not sure which extension should I modify for this, any suggestions? |
CI failures are caused by a recently merged PR, notified author/gatekeeper in #15407 (comment). |
I'm not sure if @gmlueck will agree, but part of me wonders if we can get away with not modifying anything. The If we have to change one of the specifications, I'd prefer to change the USM address one... But because that extension is "supported" it's probably easier to change the address cast one. We could just add a quick note that says something along the lines of:
I don't think we want to define new shorthand aliases for the USM address spaces, or encourage their use. |
I was confused by these aliases before and thought that the address cast extension was only supposed to work with these spaces. That does not seem to be the case, so I agree that we don't need any changes in the extension specification. (we might have a similar bug with |
ping @dm-vodopyanov , @intel/llvm-reviewers-runtime |
@dm-vodopyanov , @intel/llvm-reviewers-runtime, ping x2. |
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.
Looks reasonable!
@@ -16,6 +16,9 @@ inline namespace _V1 { | |||
namespace ext { | |||
namespace oneapi { | |||
namespace experimental { | |||
namespace detail { | |||
using namespace sycl::detail; | |||
} |
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 think it's a bad habit of ours to have any other detail
namespace than sycl::detail
. Any details can be in sycl::detail
, even if it's extension related. That said, not this PR's fault and I have added to those namespaces in the past. Just a bit of venting. 😉
When these address spaces are used with regular
sycl::detail::spirv::GenericCastToPtr
they are turned intounreachable
. We don't have a SPIR-V intrinsic yet (or maybe weshouldn't even have it, and will continue to rely on standard LLVM IR's
addrspacecast
), so use C-style cast and rely on the translator/backendto generate proper operation, similarly to
sycl::detail::cast_AS
.