41 #define DISPATCH_LINALG_DTYPE_TO_TEMPLATE(DTYPE, ...) \
43 if (DTYPE == open3d::core::Float32) { \
44 using scalar_t = float; \
45 return __VA_ARGS__(); \
46 } else if (DTYPE == open3d::core::Float64) { \
47 using scalar_t = double; \
48 return __VA_ARGS__(); \
50 utility::LogError("Unsupported data type."); \
55 const std::string& msg) {
58 }
else if (info > 0) {
63 #ifdef BUILD_CUDA_MODULE
64 inline void OPEN3D_CUBLAS_CHECK(cublasStatus_t status,
const std::string& msg) {
65 if (CUBLAS_STATUS_SUCCESS != status) {
70 inline void OPEN3D_CUSOLVER_CHECK(cusolverStatus_t status,
71 const std::string& msg) {
72 if (CUSOLVER_STATUS_SUCCESS != status) {
77 inline void OPEN3D_CUSOLVER_CHECK_WITH_DINFO(cusolverStatus_t status,
78 const std::string& msg,
80 const Device& device) {
83 if (status != CUSOLVER_STATUS_SUCCESS || hinfo != 0) {
86 }
else if (hinfo > 0) {
94 class CuSolverContext {
96 static std::shared_ptr<CuSolverContext> GetInstance();
100 cusolverDnHandle_t& GetHandle() {
return handle_; }
103 cusolverDnHandle_t handle_;
105 static std::shared_ptr<CuSolverContext> instance_;
108 class CuBLASContext {
110 static std::shared_ptr<CuBLASContext> GetInstance();
115 cublasHandle_t& GetHandle() {
return handle_; }
118 cublasHandle_t handle_;
120 static std::shared_ptr<CuBLASContext> instance_;
#define LogError(...)
Definition: Logging.h:67
static void MemcpyToHost(void *host_ptr, const void *src_ptr, const Device &src_device, size_t num_bytes)
Same as Memcpy, but with host (CPU:0) as default dst_device.
Definition: MemoryManager.cpp:94
void OPEN3D_LAPACK_CHECK(OPEN3D_CPU_LINALG_INT info, const std::string &msg)
Definition: LinalgUtils.h:54
Definition: PinholeCameraIntrinsic.cpp:35