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::core::__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 65 #ifdef BUILD_CUDA_MODULE 66 inline void __OPEN3D_CUDA_CHECK(cudaError_t err,
69 if (err != cudaSuccess) {
71 cudaGetErrorString(err));
75 inline void __OPEN3D_GET_LAST_CUDA_ERROR(
const char* message,
78 cudaError_t err = cudaGetLastError();
79 if (err != cudaSuccess) {
81 line, message, cudaGetErrorString(err));
86 inline int GetCUDACurrentDeviceTextureAlignment() {
88 cudaError_t err = cudaGetDevice(&device);
89 if (err != cudaSuccess) {
91 "GetCUDACurrentDeviceTextureAlignment(): cudaGetDevice failed " 93 cudaGetErrorString(err));
97 err = cudaDeviceGetAttribute(&value, cudaDevAttrTextureAlignment, device);
98 if (err != cudaSuccess) {
100 "GetCUDACurrentDeviceTextureAlignment(): " 101 "cudaDeviceGetAttribute failed with {}",
102 cudaGetErrorString(err));
void ReleaseCache()
Definition: CUDAUtils.cpp:55
void LogError(const char *format, const Args &... args)
Definition: Console.h:176
int DeviceCount()
Definition: CUDAUtils.cpp:40
bool IsAvailable()
Definition: CUDAUtils.cpp:53
Definition: PinholeCameraIntrinsic.cpp:35