File indexing completed on 2026-05-27 07:23:57
0001
0002
0003
0004
0005
0006
0007
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
0020 #define WARP_SIZE warpSize
0021
0022
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