ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
UnaryEW.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <Logging.h>
11 
13 
14 namespace cloudViewer {
15 namespace core {
16 namespace kernel {
17 
18 enum class UnaryEWOpCode {
19  Sqrt,
20  Sin,
21  Cos,
22  Neg,
23  Exp,
24  Abs,
25  IsNan,
26  IsInf,
27  IsFinite,
28  Floor,
29  Ceil,
30  Round,
31  Trunc,
33 };
34 
35 void UnaryEW(const Tensor& src, Tensor& dst, UnaryEWOpCode op_code);
36 void UnaryEWCPU(const Tensor& src, Tensor& dst, UnaryEWOpCode op_code);
37 
38 #ifdef BUILD_SYCL_MODULE
39 void UnaryEWSYCL(const Tensor& src, Tensor& dst, UnaryEWOpCode op_code);
40 #endif
41 
42 #ifdef BUILD_CUDA_MODULE
43 void UnaryEWCUDA(const Tensor& src, Tensor& dst, UnaryEWOpCode op_code);
44 #endif
45 
46 // Copy is separated from other unary ops since it supports cross-device copy
47 // and dtype casting.
48 void Copy(const Tensor& src, Tensor& dst);
49 
50 void CopyCPU(const Tensor& src, Tensor& dst);
51 
52 #ifdef BUILD_CUDA_MODULE
53 void CopyCUDA(const Tensor& src, Tensor& dst);
54 #endif
55 
56 #ifdef BUILD_SYCL_MODULE
57 void CopySYCL(const Tensor& src, Tensor& dst);
58 #endif
59 
60 } // namespace kernel
61 } // namespace core
62 } // namespace cloudViewer
void UnaryEWCPU(const Tensor &src, Tensor &dst, UnaryEWOpCode op_code)
Definition: UnaryEWCPU.cpp:217
void Copy(const Tensor &src, Tensor &dst)
Definition: UnaryEW.cpp:66
void UnaryEWSYCL(const Tensor &src, Tensor &dst, UnaryEWOpCode op_code)
void UnaryEW(const Tensor &src, Tensor &dst, UnaryEWOpCode op_code)
Definition: UnaryEW.cpp:19
void CopySYCL(const Tensor &src, Tensor &dst)
void CopyCPU(const Tensor &src, Tensor &dst)
Definition: UnaryEWCPU.cpp:174
Generic file read and write utility for python interface.