Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-26 08:22:11

0001 /** TRACCC library, part of the ACTS project (R&D line)
0002  *
0003  * (c) 2021-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 /// Helper macro used for checking @c cudaError_t type return values.
0014 #define TRACCC_CUDA_ERROR_CHECK(EXP)                                      \
0015   do {                                                                    \
0016     cudaError_t errorCode = EXP;                                          \
0017     if (errorCode != cudaSuccess) {                                       \
0018       traccc::cuda_utils::details::throw_error(errorCode, #EXP, __FILE__, \
0019                                                __LINE__);                 \
0020     }                                                                     \
0021   } while (false)
0022 
0023 namespace traccc::cuda_utils::details {
0024 
0025 /// Function used to print and throw a user-readable error if something breaks
0026 void throw_error(cudaError_t errorCode, const char* expression,
0027                  const char* file, int line);
0028 
0029 }  // namespace traccc::cuda_utils::details