37 #ifdef BUILD_CUDA_MODULE 40 #include <cuda_runtime.h> 42 #define OPEN3D_HOST_DEVICE __host__ __device__ 43 #define OPEN3D_DEVICE __device__ 44 #define OPEN3D_ASSERT_HOST_DEVICE_LAMBDA(type) \ 45 static_assert(__nv_is_extended_host_device_lambda_closure_type(type), \ 46 #type " must be a __host__ __device__ lambda") 47 #define OPEN3D_CUDA_CHECK(err) \ 48 open3d::__OPEN3D_CUDA_CHECK(err, __FILE__, __LINE__) 49 #define OPEN3D_GET_LAST_CUDA_ERROR(message) \ 50 __OPEN3D_GET_LAST_CUDA_ERROR(message, __FILE__, __LINE__) 52 #else // #ifdef BUILD_CUDA_MODULE 54 #define OPEN3D_HOST_DEVICE 56 #define OPEN3D_ASSERT_HOST_DEVICE_LAMBDA(type) 57 #define OPEN3D_CUDA_CHECK(err) 58 #define OPEN3D_GET_LAST_CUDA_ERROR(message) 60 #endif // #ifdef BUILD_CUDA_MODULE 64 #ifdef BUILD_CUDA_MODULE 65 inline void __OPEN3D_CUDA_CHECK(cudaError_t err,
68 if (err != cudaSuccess) {
70 cudaGetErrorString(err));
74 inline void __OPEN3D_GET_LAST_CUDA_ERROR(
const char* message,
77 cudaError_t err = cudaGetLastError();
78 if (err != cudaSuccess) {
80 line, message, cudaGetErrorString(err));
int DeviceCount()
Definition: CUDAUtils.cpp:36
void LogError(const char *format, const Args &... args)
Definition: Console.h:174
Definition: Open3DViewer.h:29
bool IsAvailable()
Definition: CUDAUtils.cpp:45