Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:12:16

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 // CUDA include(s).
0010 #include <cuda_runtime.h>
0011 
0012 // System include(s).
0013 #include <iostream>
0014 #include <sstream>
0015 #include <stdexcept>
0016 
0017 namespace Acts {
0018 namespace Cuda {
0019 namespace Details {
0020 
0021 void throwError(cudaError_t errorCode, const char* expression, const char* file,
0022                 int line) {
0023   // Create a nice error message.
0024   std::ostringstream errorMsg;
0025   errorMsg << file << ":" << line << " Failed to execute: " << expression
0026            << " (" << cudaGetErrorString(errorCode) << ")";
0027   // Now print and then throw it.
0028   std::cerr << errorMsg.str() << std::endl;
0029   throw std::runtime_error(errorMsg.str());
0030 }
0031 
0032 }  // namespace Details
0033 }  // namespace Cuda
0034 }  // namespace Acts