Classes | Functions
rapidsmpf::detail Namespace Reference

Classes

class  PausableThreadLoop
 A thread loop that can be paused, resumed, and stopped. More...
 

Functions

std::string build_error_message (std::string_view reason, std::source_location const &loc=std::source_location::current())
 Build an error message with source location information. More...
 
template<typename ThrowFn >
constexpr void expects_impl (bool condition, std::string_view reason, ThrowFn &&throw_fn, std::source_location const &loc=std::source_location::current())
 Core implementation for RAPIDSMPF_EXPECTS. More...
 
std::string build_cuda_error_message (cudaError_t error, std::source_location const &loc=std::source_location::current())
 Build a CUDA error message with source location information. More...
 
std::string build_cuda_alloc_error_message (cudaError_t error, std::size_t num_bytes, std::source_location const &loc=std::source_location::current())
 Build a CUDA allocation error message with source location information. More...
 
void fatal_error (std::string_view reason, std::source_location const &loc=std::source_location::current()) noexcept
 Print a fatal error message and terminate. More...
 
constexpr void expects_fatal_impl (bool condition, std::string_view reason, std::source_location const &loc=std::source_location::current()) noexcept
 Implementation for RAPIDSMPF_EXPECTS_FATAL. More...
 
void fatal_impl (std::string_view reason, std::source_location const &loc=std::source_location::current()) noexcept
 Implementation for RAPIDSMPF_FATAL. More...
 
template<typename T >
requires std::is_integral_v< T > std::int64_t convert_to_64bit (T value)
 Convert an integral value to a 64-bit signed integer. More...
 
template<typename T >
requires std::is_floating_point_v< T > double convert_to_64bit (T value)
 Convert a floating-point value to double. More...
 
template<typename T >
constexpr T * to_pointer (T *ptr) noexcept
 Returns the raw pointer from a pointer, reference, or smart pointer. More...
 
template<typename T >
constexpr T * to_pointer (T &ptr) noexcept
 Returns the raw pointer from a pointer, reference, or smart pointer. More...
 
template<typename T >
constexpr T * to_pointer (std::unique_ptr< T > &ptr) noexcept
 Returns the raw pointer from a pointer, reference, or smart pointer. More...
 
template<typename T >
constexpr T * to_pointer (std::shared_ptr< T > &ptr) noexcept
 Returns the raw pointer from a pointer, reference, or smart pointer. More...
 

Detailed Description

SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. SPDX-License-Identifier: Apache-2.0

SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. SPDX-License-Identifier: Apache-2.0

Function Documentation

◆ build_cuda_alloc_error_message()

std::string rapidsmpf::detail::build_cuda_alloc_error_message ( cudaError_t  error,
std::size_t  num_bytes,
std::source_location const &  loc = std::source_location::current() 
)
inline

Build a CUDA allocation error message with source location information.

Parameters
errorThe CUDA error code.
num_bytesNumber of bytes that failed to allocate.
locThe source location (automatically captured).
Returns
The formatted CUDA allocation error message string.

Definition at line 181 of file error.hpp.

◆ build_cuda_error_message()

std::string rapidsmpf::detail::build_cuda_error_message ( cudaError_t  error,
std::source_location const &  loc = std::source_location::current() 
)
inline

Build a CUDA error message with source location information.

Parameters
errorThe CUDA error code.
locThe source location (automatically captured).
Returns
The formatted CUDA error message string.

Definition at line 164 of file error.hpp.

◆ build_error_message()

std::string rapidsmpf::detail::build_error_message ( std::string_view  reason,
std::source_location const &  loc = std::source_location::current() 
)
inline

Build an error message with source location information.

Parameters
reasonThe error reason message.
locThe source location (automatically captured).
Returns
The formatted error message string.

Definition at line 127 of file error.hpp.

◆ convert_to_64bit() [1/2]

template<typename T >
requires std::is_integral_v<T> std::int64_t rapidsmpf::detail::convert_to_64bit ( value)

Convert an integral value to a 64-bit signed integer.

Template Parameters
TAn integral type.
Parameters
valueThe value to convert.
Returns
The value as std::int64_t.

Definition at line 25 of file nvtx.hpp.

◆ convert_to_64bit() [2/2]

template<typename T >
requires std::is_floating_point_v<T> double rapidsmpf::detail::convert_to_64bit ( value)

Convert a floating-point value to double.

Template Parameters
TA floating-point type.
Parameters
valueThe value to convert.
Returns
The value as double.

Definition at line 47 of file nvtx.hpp.

◆ expects_fatal_impl()

constexpr void rapidsmpf::detail::expects_fatal_impl ( bool  condition,
std::string_view  reason,
std::source_location const &  loc = std::source_location::current() 
)
constexprnoexcept

Implementation for RAPIDSMPF_EXPECTS_FATAL.

Parameters
conditionThe condition to check.
reasonThe error message if the condition is false.
locThe source location (automatically captured at call site).

Definition at line 219 of file error.hpp.

◆ expects_impl()

template<typename ThrowFn >
constexpr void rapidsmpf::detail::expects_impl ( bool  condition,
std::string_view  reason,
ThrowFn &&  throw_fn,
std::source_location const &  loc = std::source_location::current() 
)
constexpr

Core implementation for RAPIDSMPF_EXPECTS.

Parameters
conditionThe condition to check.
reasonThe error reason if condition is false.
throw_fnCallable that throws the appropriate exception type.
locThe source location (automatically captured).

Definition at line 146 of file error.hpp.

◆ fatal_error()

void rapidsmpf::detail::fatal_error ( std::string_view  reason,
std::source_location const &  loc = std::source_location::current() 
)
inlinenoexcept

Print a fatal error message and terminate.

Prints an error message to stderr and calls std::terminate(). Use this for fatal errors in contexts where exceptions cannot be thrown, for example in destructors.

Parameters
reasonThe error reason message.
locThe source location (automatically captured).

Definition at line 203 of file error.hpp.

◆ fatal_impl()

void rapidsmpf::detail::fatal_impl ( std::string_view  reason,
std::source_location const &  loc = std::source_location::current() 
)
inlinenoexcept

Implementation for RAPIDSMPF_FATAL.

Parameters
reasonThe error message describing the fatal error.
locThe source location (automatically captured at call site).

Definition at line 235 of file error.hpp.

◆ to_pointer() [1/4]

template<typename T >
constexpr T* rapidsmpf::detail::to_pointer ( std::shared_ptr< T > &  ptr)
constexprnoexcept

Returns the raw pointer from a pointer, reference, or smart pointer.

This utility is useful in macros that accepts any kind of reference.

Template Parameters
TType of the object.
Parameters
ptrA raw pointer.
Returns
T* The same raw pointer.

Definition at line 252 of file misc.hpp.

◆ to_pointer() [2/4]

template<typename T >
constexpr T* rapidsmpf::detail::to_pointer ( std::unique_ptr< T > &  ptr)
constexprnoexcept

Returns the raw pointer from a pointer, reference, or smart pointer.

This utility is useful in macros that accepts any kind of reference.

Template Parameters
TType of the object.
Parameters
ptrA raw pointer.
Returns
T* The same raw pointer.

Definition at line 246 of file misc.hpp.

◆ to_pointer() [3/4]

template<typename T >
constexpr T* rapidsmpf::detail::to_pointer ( T &  ptr)
constexprnoexcept

Returns the raw pointer from a pointer, reference, or smart pointer.

This utility is useful in macros that accepts any kind of reference.

Template Parameters
TType of the object.
Parameters
ptrA raw pointer.
Returns
T* The same raw pointer.

Definition at line 240 of file misc.hpp.

◆ to_pointer() [4/4]

template<typename T >
constexpr T* rapidsmpf::detail::to_pointer ( T *  ptr)
constexprnoexcept

Returns the raw pointer from a pointer, reference, or smart pointer.

This utility is useful in macros that accepts any kind of reference.

Template Parameters
TType of the object.
Parameters
ptrA raw pointer.
Returns
T* The same raw pointer.

Definition at line 234 of file misc.hpp.