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

Replace and deprecate thrust::cuda_cub::terminate #3421

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions thrust/thrust/system/cuda/detail/terminate.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
# pragma system_header
#endif // no system header
#include <thrust/system/cuda/detail/util.h>

#include <cuda/std/__exception/terminate.h>

#include <cstdio>

Expand All @@ -47,18 +48,11 @@ namespace cuda
{
namespace detail
{

inline _CCCL_DEVICE void terminate()
{
thrust::cuda_cub::terminate();
}

inline _CCCL_HOST_DEVICE void terminate_with_message(const char* message)
{
printf("%s\n", message);
thrust::cuda_cub::terminate();
::cuda::std::terminate();
}

} // namespace detail
} // namespace cuda
} // namespace system
Expand Down
6 changes: 3 additions & 3 deletions thrust/thrust/system/cuda/detail/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ trivial_copy_device_to_device(Policy& policy, Type* dst, Type const* src, size_t
return status;
}

inline void _CCCL_HOST_DEVICE terminate()
CCCL_DEPRECATED_BECAUSE("Use cuda::std::terminate() instead") inline void _CCCL_HOST_DEVICE terminate()
{
NV_IF_TARGET(NV_IS_HOST, (std::terminate();), (asm("trap;");));
}
Expand Down Expand Up @@ -210,7 +210,7 @@ _CCCL_HOST_DEVICE inline void throw_on_error(cudaError_t status)

NV_IF_TARGET(NV_IS_HOST,
(throw thrust::system_error(status, thrust::cuda_category());),
(THRUST_TEMP_DEVICE_CODE; cuda_cub::terminate();));
(THRUST_TEMP_DEVICE_CODE; ::cuda::std::terminate();));

#undef THRUST_TEMP_DEVICE_CODE
}
Expand Down Expand Up @@ -243,7 +243,7 @@ _CCCL_HOST_DEVICE inline void throw_on_error(cudaError_t status, char const* msg

NV_IF_TARGET(NV_IS_HOST,
(throw thrust::system_error(status, thrust::cuda_category(), msg);),
(THRUST_TEMP_DEVICE_CODE; cuda_cub::terminate();));
(THRUST_TEMP_DEVICE_CODE; ::cuda::std::terminate();));

#undef THRUST_TEMP_DEVICE_CODE
}
Expand Down
Loading