Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-27 07:23:57

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 #pragma once
0010 
0011 #if defined(__HIP__) || defined(__NVCC__)
0012 
0013 #include <assert.h>
0014 #include <hip/hip_runtime.h>
0015 #include <hip/hip_runtime_api.h>  // for hipDeviceSynchronize, hipGetLastError
0016 #include <stdio.h>
0017 #include <stdlib.h>
0018 
0019 /// Number of threads per Warp
0020 #define WARP_SIZE warpSize
0021 
0022 /// Helper macro used for checking  , type return values.
0023 #define DETRAY_HIP_ERROR_CHECK(ans)       \
0024   {                                       \
0025     hipAssert((ans), __FILE__, __LINE__); \
0026   }
0027 inline void hipAssert(hipError_t code, const char *file, int line,
0028                       bool abort = true) {
0029   if (code != hipSuccess) {
0030     fprintf(stderr, "HIPassert: %s %s %d\n", hipGetErrorString(code), file,
0031             line);
0032     if (abort)
0033       exit(code);
0034   }
0035 }
0036 
0037 #endif