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

Commit ec8b8b4

Browse files
authored
Merge pull request #1722 from NVIDIA/bug/temp_alloc_error
Reference CUDA back end functions only when CUDA back end is enabled
2 parents be34b50 + 4712b8c commit ec8b8b4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

thrust/detail/allocator/temporary_allocator.inl

+4
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,15 @@ __host__ __device__
5050
// note that we pass cnt to deallocate, not a value derived from result.second
5151
deallocate(result.first, cnt);
5252

53+
#if THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_CUDA
5354
NV_IF_TARGET(NV_IS_HOST, (
5455
throw thrust::system::detail::bad_alloc("temporary_buffer::allocate: get_temporary_buffer failed");
5556
), ( // NV_IS_DEVICE
5657
thrust::system::cuda::detail::terminate_with_message("temporary_buffer::allocate: get_temporary_buffer failed");
5758
));
59+
#else
60+
throw thrust::system::detail::bad_alloc("temporary_buffer::allocate: get_temporary_buffer failed");
61+
#endif
5862
} // end if
5963

6064
return result.first;

0 commit comments

Comments
 (0)