Files | Namespaces | Classes | Macros
Exception

Files

file  error.hpp
 

Namespaces

 cudf
 cuDF interfaces
 

Classes

struct  cudf::logic_error
 Exception thrown when logical precondition is violated. More...
 
struct  cudf::cuda_error
 Exception thrown when a CUDA error is encountered. More...
 
struct  cudf::fatal_cuda_error
 

Macros

#define CUDF_EXPECTS(cond, reason)
 Macro for checking (pre-)conditions that throws an exception when a condition is violated. More...
 
#define CUDF_FAIL(reason)    throw cudf::logic_error("cuDF failure at: " __FILE__ ":" CUDF_STRINGIFY(__LINE__) ": " reason)
 Indicates that an erroneous code path has been taken. More...
 
#define CUDF_CUDA_TRY(call)
 Error checking macro for CUDA runtime API functions. More...
 
#define CUDF_CHECK_CUDA(stream)
 Debug macro to check for CUDA errors. More...
 

Detailed Description

Macro Definition Documentation

◆ CUDF_CHECK_CUDA

#define CUDF_CHECK_CUDA (   stream)
Value:
do { \
CUDF_CUDA_TRY(cudaStreamSynchronize(stream)); \
CUDF_CUDA_TRY(cudaPeekAtLastError()); \
} while (0);

Debug macro to check for CUDA errors.

In a non-release build, this macro will synchronize the specified stream before error checking. In both release and non-release builds, this macro checks for any pending CUDA errors from previous calls. If an error is reported, an exception is thrown detailing the CUDA error that occurred.

The intent of this macro is to provide a mechanism for synchronous and deterministic execution for debugging asynchronous CUDA execution. It should be used after any asynchronous CUDA call, e.g., cudaMemcpyAsync, or an asynchronous kernel launch.

Definition at line 185 of file error.hpp.

◆ CUDF_CUDA_TRY

#define CUDF_CUDA_TRY (   call)
Value:
do { \
cudaError_t const status = (call); \
if (cudaSuccess != status) { cudf::detail::throw_cuda_error(status, __FILE__, __LINE__); } \
} while (0);

Error checking macro for CUDA runtime API functions.

Invokes a CUDA runtime API function call, if the call does not return cudaSuccess, invokes cudaGetLastError() to clear the error and throws an exception detailing the CUDA error that occurred

Definition at line 165 of file error.hpp.

◆ CUDF_EXPECTS

#define CUDF_EXPECTS (   cond,
  reason 
)
Value:
(!!(cond)) ? static_cast<void>(0) \
: throw cudf::logic_error("cuDF failure at: " __FILE__ \
":" CUDF_STRINGIFY(__LINE__) ": " reason)

Macro for checking (pre-)conditions that throws an exception when a condition is violated.

Example usage:

CUDF_EXPECTS(lhs->dtype == rhs->dtype, "Column type mismatch");
Parameters
[in]condExpression that evaluates to true or false
[in]reasonString literal description of the reason that cond is expected to be true
Exceptions
cudf::logic_errorif the condition evaluates to false.

Definition at line 113 of file error.hpp.

◆ CUDF_FAIL

#define CUDF_FAIL (   reason)     throw cudf::logic_error("cuDF failure at: " __FILE__ ":" CUDF_STRINGIFY(__LINE__) ": " reason)

Indicates that an erroneous code path has been taken.

In host code, throws a cudf::logic_error.

Example usage:

CUDF_FAIL("Non-arithmetic operation is not supported");
Parameters
[in]reasonString literal description of the reason

Definition at line 131 of file error.hpp.

CUDF_FAIL
#define CUDF_FAIL(reason)
Indicates that an erroneous code path has been taken.
Definition: error.hpp:131
CUDF_STRINGIFY
#define CUDF_STRINGIFY(x)
Stringify a macro argument.
Definition: error.hpp:91
cudf::logic_error
Exception thrown when logical precondition is violated.
Definition: error.hpp:37
CUDF_EXPECTS
#define CUDF_EXPECTS(cond, reason)
Macro for checking (pre-)conditions that throws an exception when a condition is violated.
Definition: error.hpp:113