Open3D (C++ API)  0.18.0
UnaryEW.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2023 www.open3d.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include "open3d/core/Tensor.h"
11 #include "open3d/utility/Logging.h"
12 
13 namespace open3d {
14 namespace core {
15 namespace kernel {
16 
17 enum class UnaryEWOpCode {
18  Sqrt,
19  Sin,
20  Cos,
21  Neg,
22  Exp,
23  Abs,
24  IsNan,
25  IsInf,
26  IsFinite,
27  Floor,
28  Ceil,
29  Round,
30  Trunc,
32 };
33 
34 void UnaryEW(const Tensor& src, Tensor& dst, UnaryEWOpCode op_code);
35 
36 void UnaryEWCPU(const Tensor& src, Tensor& dst, UnaryEWOpCode op_code);
37 
38 #ifdef BUILD_CUDA_MODULE
39 void UnaryEWCUDA(const Tensor& src, Tensor& dst, UnaryEWOpCode op_code);
40 #endif
41 
42 // Copy is separated from other unary ops since it support cross-device copy and
43 // dtype casting.
44 void Copy(const Tensor& src, Tensor& dst);
45 
46 void CopyCPU(const Tensor& src, Tensor& dst);
47 
48 #ifdef BUILD_CUDA_MODULE
49 void CopyCUDA(const Tensor& src, Tensor& dst);
50 #endif
51 
52 } // namespace kernel
53 } // namespace core
54 } // namespace open3d
Definition: Tensor.h:32
UnaryEWOpCode
Definition: UnaryEW.h:17
void Copy(const Tensor &src, Tensor &dst)
Definition: UnaryEW.cpp:46
void CopyCPU(const Tensor &src, Tensor &dst)
Definition: UnaryEWCPU.cpp:173
void UnaryEWCPU(const Tensor &src, Tensor &dst, UnaryEWOpCode op_code)
Definition: UnaryEWCPU.cpp:216
void UnaryEW(const Tensor &src, Tensor &dst, UnaryEWOpCode op_code)
Definition: UnaryEW.cpp:18
Definition: PinholeCameraIntrinsic.cpp:16