Go to the documentation of this file.
21 std::cerr <<
"YAKL FATAL ERROR:\n";
22 std::cerr << msg << std::endl;
23 throw std::runtime_error(msg);
29 const CL_CONSTANT
char format[] =
"KERNEL CHECK FAILED:\n %s\n";
30 sycl::ext::oneapi::experimental::printf(format,msg);
31 #elif defined(YAKL_ARCH_CUDA) || defined(YAKL_ARCH_HIP)
35 int *segfault =
nullptr;
49 auto ierr = cudaGetLastError();
50 if (ierr != cudaSuccess) {
yakl_throw( cudaGetErrorString( ierr ) ); }
51 #elif defined(YAKL_ARCH_HIP)
52 auto ierr = hipGetLastError();
53 if (ierr != hipSuccess) {
yakl_throw( hipGetErrorString( ierr ) ); }
54 #elif defined(YAKL_ARCH_SYCL)
68 MPI_Initialized(&is_initialized);
69 if (!is_initialized) {
73 MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
#define YAKL_EXECUTE_ON_DEVICE_ONLY(...)
[NOT COMMONLY USED] Macro function used to determine if the current code is compiling for the device.
Definition: YAKL_defines.h:158
#define __YAKL_NAMESPACE_WRAPPER_END__
Definition: YAKL.h:20
#define __YAKL_NAMESPACE_WRAPPER_BEGIN__
Definition: YAKL.h:19
#define YAKL_INLINE
Used to decorate functions called from kernels (parallel_for and parallel_outer) or from CPU function...
Definition: YAKL_defines.h:140
void fence()
Block the host code until all device code has completed.
Definition: YAKL_fence.h:16
#define YAKL_EXECUTE_ON_HOST_ONLY(...)
[NOT COMMONLY USED] Macro function used to determine if the current code is compiling for the host.
Definition: YAKL_defines.h:153
YAKL_INLINE void yakl_throw(const char *msg)
Throw an error message. Works from the host or device.
Definition: YAKL_error.h:17
bool yakl_mainproc()
If true, this is the main MPI process (task number == 0)
Definition: YAKL_error.h:64
void check_last_error()
Checks to see if an error has occurred on the device.
Definition: YAKL_error.h:45