Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.

Reference CUDA back end functions only when CUDA back end is enabled #1722

Merged
merged 1 commit into from
Jun 17, 2022

Conversation

dkolsen-pgi
Copy link
Collaborator

Add a #if block to temporary_allocator<T,S>::allocate in
thrust/detail/allocator/temporary_allocator.inl so that the CUDA back end
function thrust::system::cuda::detail::terminate_with_message is referenced
only when the CUDA back end is enabled. Putting the reference within the
device-specific branch of an NV_IF_TARGET isn't good enough; there are some
situations, e.g. nvc++ -cuda -stdpar=multicore, where that doesn't work
and an explicit check for the CUDA back end is necessary.

Add a #if block to temporary_allocator<T,S>::allocate in
thrust/detail/allocator/temporary_allocator.inl so that the CUDA back end
function thrust::system::cuda::detail::terminate_with_message is referenced
only when the CUDA back end is enabled.  Putting the reference within the
device-specific branch of an NV_IF_TARGET isn't good enough; there are some
situations, e.g. 'nvc++ -cuda -stdpar=multicore', where that doesn't work
and an explicit check for the CUDA back end is necessary.
@dkolsen-pgi dkolsen-pgi added compiler: nvc++ Specific to the NVC++ compiler. helps: nvc++ Helps or needed by NVC++. labels Jun 16, 2022
@dkolsen-pgi dkolsen-pgi requested review from alliepiper and wmaxey June 16, 2022 17:55
@alliepiper alliepiper added type: bug: functional Does not work as intended. P0: must have Absolutely necessary. Critical issue, major blocker, etc. testing: gpuCI in progress Started gpuCI testing. backend: CUDA Related to the CUDA backend backend: OMP Related to the OpenMP backend labels Jun 16, 2022
@alliepiper
Copy link
Collaborator

LGTM -- this can go in once testing finishes.

run tests

@alliepiper alliepiper added this to the 2.0.0 milestone Jun 16, 2022
@alliepiper alliepiper merged commit ec8b8b4 into main Jun 17, 2022
@alliepiper alliepiper deleted the bug/temp_alloc_error branch June 17, 2022 14:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backend: CUDA Related to the CUDA backend backend: OMP Related to the OpenMP backend compiler: nvc++ Specific to the NVC++ compiler. helps: nvc++ Helps or needed by NVC++. P0: must have Absolutely necessary. Critical issue, major blocker, etc. testing: gpuCI in progress Started gpuCI testing. type: bug: functional Does not work as intended.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants