Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-26 08:05:41

0001 /** TRACCC library, part of the ACTS project (R&D line)
0002  *
0003  * (c) 2026 CERN for the benefit of the ACTS project
0004  *
0005  * Mozilla Public License Version 2.0
0006  */
0007 
0008 #pragma once
0009 
0010 // CUDA include(s).
0011 #include <cuda_runtime_api.h>
0012 
0013 // System include(s).
0014 #include <exception>
0015 
0016 // Helper macro for checking the return value of CUDA function calls
0017 #define CUDA_ERROR_CHECK(EXP)                                            \
0018   do {                                                                   \
0019     const cudaError_t errorCode = EXP;                                   \
0020     if (errorCode != cudaSuccess) {                                      \
0021       throw std::runtime_error(std::string("Failed to run " #EXP " (") + \
0022                                cudaGetErrorString(errorCode) + ")");     \
0023     }                                                                    \
0024   } while (false)