ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
BinaryEW.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 <Helper.h>
11 #include <Logging.h>
12 
13 #include <unordered_set>
14 
16 
17 namespace cloudViewer {
18 namespace core {
19 namespace kernel {
20 
21 enum class BinaryEWOpCode {
22  Add,
23  Sub,
24  Mul,
25  Div,
26  Maximum,
27  Minimum,
28  LogicalAnd,
29  LogicalOr,
30  LogicalXor,
31  Gt,
32  Lt,
33  Ge,
34  Le,
35  Eq,
36  Ne,
37 };
38 
39 extern const std::unordered_set<BinaryEWOpCode, utility::hash_enum_class>
41 
42 void BinaryEW(const Tensor& lhs,
43  const Tensor& rhs,
44  Tensor& dst,
45  BinaryEWOpCode op_code);
46 
47 void BinaryEWCPU(const Tensor& lhs,
48  const Tensor& rhs,
49  Tensor& dst,
50  BinaryEWOpCode op_code);
51 
52 #ifdef BUILD_SYCL_MODULE
53 void BinaryEWSYCL(const Tensor& lhs,
54  const Tensor& rhs,
55  Tensor& dst,
56  BinaryEWOpCode op_code);
57 #endif
58 
59 #ifdef BUILD_CUDA_MODULE
60 void BinaryEWCUDA(const Tensor& lhs,
61  const Tensor& rhs,
62  Tensor& dst,
63  BinaryEWOpCode op_code);
64 #endif
65 
66 } // namespace kernel
67 } // namespace core
68 } // namespace cloudViewer
Helper functions for the ml ops.
void BinaryEWCPU(const Tensor &lhs, const Tensor &rhs, Tensor &dst, BinaryEWOpCode op_code)
const std::unordered_set< BinaryEWOpCode, utility::hash_enum_class > s_boolean_binary_ew_op_codes
Definition: BinaryEW.cpp:22
void BinaryEW(const Tensor &lhs, const Tensor &rhs, Tensor &dst, BinaryEWOpCode op_code)
Definition: BinaryEW.cpp:30
void BinaryEWSYCL(const Tensor &lhs, const Tensor &rhs, Tensor &dst, BinaryEWOpCode op_code)
Generic file read and write utility for python interface.