23 #define DISPATCH_LINALG_DTYPE_TO_TEMPLATE(DTYPE, ...) \
25 if (DTYPE == cloudViewer::core::Float32) { \
26 using scalar_t = float; \
27 return __VA_ARGS__(); \
28 } else if (DTYPE == cloudViewer::core::Float64) { \
29 using scalar_t = double; \
30 return __VA_ARGS__(); \
32 utility::LogError("Unsupported data type."); \
37 const std::string& msg) {
40 }
else if (info > 0) {
45 #ifdef BUILD_CUDA_MODULE
46 inline void OPEN3D_CUBLAS_CHECK(cublasStatus_t status,
const std::string& msg) {
47 if (CUBLAS_STATUS_SUCCESS != status) {
52 inline void OPEN3D_CUSOLVER_CHECK(cusolverStatus_t status,
53 const std::string& msg) {
54 if (CUSOLVER_STATUS_SUCCESS != status) {
59 inline void OPEN3D_CUSOLVER_CHECK_WITH_DINFO(cusolverStatus_t status,
60 const std::string& msg,
62 const Device& device) {
65 if (status != CUSOLVER_STATUS_SUCCESS || hinfo != 0) {
68 }
else if (hinfo > 0) {
76 class CuSolverContext {
80 CuSolverContext(
const CuSolverContext&) =
delete;
81 CuSolverContext& operator=(
const CuSolverContext&) =
delete;
84 cusolverDnHandle_t& GetHandle(
const Device& device);
88 std::unordered_map<Device, cusolverDnHandle_t> map_device_to_handle_;
95 CuBLASContext(
const CuBLASContext&) =
delete;
96 CuBLASContext& operator=(
const CuBLASContext&) =
delete;
99 cublasHandle_t& GetHandle(
const Device& device);
103 std::unordered_map<Device, cublasHandle_t> map_device_to_handle_;
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.
ccGuiPythonInstance * GetInstance() noexcept
void OPEN3D_LAPACK_CHECK(CLOUDVIEWER_CPU_LINALG_INT info, const std::string &msg)
Generic file read and write utility for python interface.