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) 2024 CERN for the benefit of the ACTS project
0004  *
0005  * Mozilla Public License Version 2.0
0006  */
0007 
0008 // Local include(s).
0009 #include "cuda_error_handling.hpp"
0010 
0011 // System include(s).
0012 #include <iostream>
0013 #include <sstream>
0014 #include <stdexcept>
0015 
0016 namespace traccc::cuda::details {
0017 
0018 void throw_error(cudaError_t errorCode, const char* expression,
0019                  const char* file, int line) {
0020   // Create a nice error message.
0021   std::ostringstream errorMsg;
0022   errorMsg << file << ":" << line << " Failed to execute: " << expression
0023            << " (" << cudaGetErrorString(errorCode) << ")";
0024 
0025   // Now throw a runtime error with this message.
0026   throw std::runtime_error(errorMsg.str());
0027 }
0028 
0029 }  // namespace traccc::cuda::details