#include <cuda_runtime.h>
#include <optix.h>
#include <optix_stubs.h>
#include <sstream>
#include <stdexcept>
Go to the source code of this file.
◆ CUDA_CHECK
#define CUDA_CHECK |
( |
|
call | ) |
|
Value: { \
cudaError_t rc = cuda##call; \
if (rc != cudaSuccess) { \
std::stringstream txt; \
cudaError_t err = rc; \
txt << "CUDA Error " << cudaGetErrorName(err) << " (" \
<< cudaGetErrorString(err) << ")"; \
throw std::runtime_error(txt.str()); \
} \
}
Definition at line 26 of file optix8.h.
◆ CUDA_CHECK_NOEXCEPT
#define CUDA_CHECK_NOEXCEPT |
( |
|
call | ) |
{ cuda##call; } |
◆ CUDA_SYNC_CHECK
#define CUDA_SYNC_CHECK |
( |
| ) |
|
Value: { \
cudaDeviceSynchronize(); \
cudaError_t error = cudaGetLastError(); \
if (error != cudaSuccess) { \
fprintf(stderr, "error (%s: line %d): %s\n", __FILE__, __LINE__, \
cudaGetErrorString(error)); \
exit(2); \
} \
}
Definition at line 51 of file optix8.h.
◆ OPTIX_CHECK
#define OPTIX_CHECK |
( |
|
call | ) |
|
Value: { \
OptixResult res = call; \
if (res != OPTIX_SUCCESS) { \
fprintf(stderr, "Optix call (%s) failed with code %d (line %d)\n", \
#call, res, __LINE__); \
exit(2); \
} \
}
Definition at line 41 of file optix8.h.