-
Notifications
You must be signed in to change notification settings - Fork 169
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
Make get_global_resource host/device #3040
base: main
Are you sure you want to change the base?
Conversation
@miscco FYI |
Thanks @Artem-B I was stretched a bit thin the last weeks. |
/ok to test |
Head branch was pushed to by a user without write access
The function is called from a host/device constructors and may be invoked from the device code. As it happens neither NVCC nor clang diagnose such an invalid call. llvm/llvm-project#118415 As the result, in unoptimized builds we end up with ptxas failing with an unresolved reference to this function because it is never generated during GPU-side compilation. NVIDIA#2813 (comment)
@miscco looks like my rebase to update the branch has disabled auto-merge. Can you get it going again, please? |
/ok to test |
Oh its broken because NVCC cannot handle dynamic initialization in a function local So I am wondering whether we need to restrict this to only clang-cuda for now |
@@ -204,7 +204,7 @@ _CCCL_HOST_DEVICE bool operator!=(const memory_resource<Pointer>& lhs, const mem | |||
* \return a pointer to a global instance of \p MR. | |||
*/ | |||
template <typename MR> | |||
_CCCL_HOST MR* get_global_resource() |
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.
Where is this getting used in a host/device function?
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.
cccl/thrust/thrust/mr/allocator.h
Lines 204 to 206 in f4d358a
_CCCL_HOST_DEVICE stateless_resource_allocator() | |
: base(get_global_resource<Upstream>()) | |
{} |
Interesting. It looks like the issue I've ran into before #2813 (comment) The error went away with clang after disabling initializer guards, which suggests that the initializer is indeed empty, as far as clang was concerned, but it's possible that there are some differences about what exactly is considered to be empty. |
Description
The function is called from a host/device constructors and may be invoked from the device code.
As it happens neither NVCC nor clang diagnose such an invalid call. llvm/llvm-project#118415
As the result, in unoptimized builds we end up with ptxas failing with an unresolved reference to this function because it is never generated during GPU-side compilation.
#2813 (comment)
closes #3023
Checklist