alpaka
Abstraction Library for Parallel Kernel Acceleration
UniformCudaHip.hpp File Reference
#include "alpaka/core/BoostPredef.hpp"
#include "alpaka/core/Cuda.hpp"
#include "alpaka/core/Hip.hpp"
#include <initializer_list>
#include <stdexcept>
#include <string>
#include <tuple>
#include <type_traits>

Go to the source code of this file.

Namespaces

 alpaka
 The alpaka accelerator library.
 
 alpaka::uniform_cuda_hip
 
 alpaka::uniform_cuda_hip::detail
 

Macros

#define ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK(cmd)   ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK_IMPL(cmd, true, )
 CUDA/HIP runtime error checking with log and exception. More...
 
#define ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK_IGNORE(cmd, ...)    ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK_IMPL(cmd, true, __VA_ARGS__)
 CUDA/HIP runtime error checking with log and exception, ignoring specific error values. More...
 
#define ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK_IGNORE_NOEXCEPT(cmd, ...)    ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK_IMPL(cmd, false, __VA_ARGS__)
 CUDA/HIP runtime error checking with log and exception, ignoring specific error values. More...
 
#define ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK_IMPL(cmd, throw, ...)
 
#define ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK_NOEXCEPT(cmd)   ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK_IMPL(cmd, false, )
 CUDA/HIP runtime error checking with log. More...
 

Functions

template<typename TApi , bool TThrow>
ALPAKA_FN_HOST void alpaka::uniform_cuda_hip::detail::rtCheck (typename TApi::Error_t const &error, char const *desc, char const *file, int const &line) noexcept(!TThrow)
 CUDA/HIP runtime API error checking with log and exception, ignoring specific error values. More...
 
template<typename TApi , bool TThrow>
ALPAKA_FN_HOST void alpaka::uniform_cuda_hip::detail::rtCheckIgnore (typename TApi::Error_t const &error, char const *cmd, char const *file, int const &line, std::initializer_list< typename TApi::Error_t > ignoredErrorCodes) noexcept(!TThrow)
 CUDA/HIP runtime API error checking with log and exception, ignoring specific error values. More...
 
template<typename TApi , bool TThrow>
ALPAKA_FN_HOST void alpaka::uniform_cuda_hip::detail::rtCheckLastError (char const *desc, char const *file, int const &line) noexcept(!TThrow)
 CUDA/HIP runtime API last error checking with log and exception. More...
 

Macro Definition Documentation

◆ ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK

#define ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK (   cmd)    ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK_IMPL(cmd, true, )

CUDA/HIP runtime error checking with log and exception.

Definition at line 105 of file UniformCudaHip.hpp.

◆ ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK_IGNORE

#define ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK_IGNORE (   cmd,
  ... 
)     ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK_IMPL(cmd, true, __VA_ARGS__)

CUDA/HIP runtime error checking with log and exception, ignoring specific error values.

Definition at line 101 of file UniformCudaHip.hpp.

◆ ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK_IGNORE_NOEXCEPT

#define ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK_IGNORE_NOEXCEPT (   cmd,
  ... 
)     ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK_IMPL(cmd, false, __VA_ARGS__)

CUDA/HIP runtime error checking with log and exception, ignoring specific error values.

Definition at line 108 of file UniformCudaHip.hpp.

◆ ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK_IMPL

#define ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK_IMPL (   cmd,
  throw,
  ... 
)
Value:
do \
{ \
::alpaka::uniform_cuda_hip::detail::rtCheckLastError<TApi, throw>( \
"'" #cmd "' A previous API call (not this one) set the error ", \
__FILE__, \
__LINE__); \
::alpaka::uniform_cuda_hip::detail::rtCheckIgnore<TApi, throw>( \
cmd, \
#cmd, \
__FILE__, \
__LINE__, \
{__VA_ARGS__}); \
} while(0)

Definition at line 85 of file UniformCudaHip.hpp.

◆ ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK_NOEXCEPT

#define ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK_NOEXCEPT (   cmd)    ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK_IMPL(cmd, false, )

CUDA/HIP runtime error checking with log.

Definition at line 112 of file UniformCudaHip.hpp.