22 #define DISPATCH_LINALG_DTYPE_TO_TEMPLATE(DTYPE, ...) \
24 if (DTYPE == open3d::core::Float32) { \
25 using scalar_t = float; \
26 return __VA_ARGS__(); \
27 } else if (DTYPE == open3d::core::Float64) { \
28 using scalar_t = double; \
29 return __VA_ARGS__(); \
31 utility::LogError("Unsupported data type."); \
36 const std::string& msg) {
39 }
else if (info > 0) {
44 #ifdef BUILD_CUDA_MODULE
45 inline void OPEN3D_CUBLAS_CHECK(cublasStatus_t status,
const std::string& msg) {
46 if (CUBLAS_STATUS_SUCCESS != status) {
51 inline void OPEN3D_CUSOLVER_CHECK(cusolverStatus_t status,
52 const std::string& msg) {
53 if (CUSOLVER_STATUS_SUCCESS != status) {
58 inline void OPEN3D_CUSOLVER_CHECK_WITH_DINFO(cusolverStatus_t status,
59 const std::string& msg,
61 const Device& device) {
64 if (status != CUSOLVER_STATUS_SUCCESS || hinfo != 0) {
67 }
else if (hinfo > 0) {
75 class CuSolverContext {
77 static CuSolverContext& GetInstance();
79 CuSolverContext(
const CuSolverContext&) =
delete;
80 CuSolverContext& operator=(
const CuSolverContext&) =
delete;
83 cusolverDnHandle_t& GetHandle(
const Device& device);
87 std::unordered_map<Device, cusolverDnHandle_t> map_device_to_handle_;
92 static CuBLASContext& GetInstance();
94 CuBLASContext(
const CuBLASContext&) =
delete;
95 CuBLASContext& operator=(
const CuBLASContext&) =
delete;
98 cublasHandle_t& GetHandle(
const Device& device);
102 std::unordered_map<Device, cublasHandle_t> map_device_to_handle_;
#define LogError(...)
Definition: Logging.h:48
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:85
void OPEN3D_LAPACK_CHECK(OPEN3D_CPU_LINALG_INT info, const std::string &msg)
Definition: LinalgUtils.h:35
Definition: PinholeCameraIntrinsic.cpp:16