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

[BUG]: host-only get_global_resource() may be called from GPU-side code. #3023

Open
1 task done
Artem-B opened this issue Dec 3, 2024 · 0 comments · May be fixed by #3040
Open
1 task done

[BUG]: host-only get_global_resource() may be called from GPU-side code. #3023

Artem-B opened this issue Dec 3, 2024 · 0 comments · May be fixed by #3040
Labels
bug Something isn't working right.

Comments

@Artem-B
Copy link
Contributor

Artem-B commented Dec 3, 2024

Is this a duplicate?

Type of Bug

Compile-time Error

Component

Thrust

Describe the bug

During investigation of UB issues in thrust we've ran into a peculiear case of ptxas failing due to an unresolved reference:
#2813 (comment)
#2813 (comment)

The bottom line is that a host-only function get_global_resounce here:

_CCCL_HOST MR* get_global_resource()

Gets called from a host/device constructor here:

_CCCL_EXEC_CHECK_DISABLE
_CCCL_HOST_DEVICE stateless_resource_allocator()
: base(get_global_resource<Upstream>())
{}

In some scenarios, we end up trying to call it from the GPU-side code. To add insult to injury neither NVCC nor clang currently diagnose such an invalid call. Clang bug: llvm/llvm-project#118415

How to Reproduce

The issue was originally seen during compilation of cub/test/catch2_test_device_three_way_partition.cu
#2813 (comment)

Expected behavior

If the function may be called from a GPU code, it should have appropriate attributes.

Reproduction link

No response

Operating System

No response

nvidia-smi output

No response

NVCC version

No response

@Artem-B Artem-B added the bug Something isn't working right. label Dec 3, 2024
@github-project-automation github-project-automation bot moved this to Todo in CCCL Dec 3, 2024
@Artem-B Artem-B linked a pull request Dec 3, 2024 that will close this issue
@cccl-authenticator-app cccl-authenticator-app bot moved this from Todo to In Review in CCCL Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working right.
Projects
Status: In Review
Development

Successfully merging a pull request may close this issue.

1 participant