Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /** TRACCC library, part of the ACTS project (R&D line)
0002  *
0003  * (c) 2024-2025 CERN for the benefit of the ACTS project
0004  *
0005  * Mozilla Public License Version 2.0
0006  */
0007 
0008 // Local include(s).
0009 #include "hip_error_handling.hpp"
0010 
0011 // System include(s).
0012 #include <iostream>
0013 #include <sstream>
0014 #include <stdexcept>
0015 
0016 namespace traccc::hip::details {
0017 
0018 void throw_error(hipError_t errorCode, const char* expression, const char* file,
0019                  int line) {
0020   // Create a nice error message.
0021   std::ostringstream errorMsg;
0022   errorMsg << file << ":" << line << " Failed to execute: " << expression
0023            << " (" << hipGetErrorString(errorCode) << ")";
0024 
0025   // Now throw a runtime error with this message.
0026   throw std::runtime_error(errorMsg.str());
0027 }
0028 
0029 }  // namespace traccc::hip::details