Open3D (C++ API)  0.18.0+252c867
Reduction.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 <unordered_set>
11 
12 #include "open3d/core/SizeVector.h"
13 #include "open3d/core/Tensor.h"
14 #include "open3d/utility/Helper.h"
15 #include "open3d/utility/Logging.h"
16 
17 namespace open3d {
18 namespace core {
19 namespace kernel {
20 
21 enum class ReductionOpCode {
22  Sum,
23  Prod,
24  Min,
25  Max,
26  ArgMin,
27  ArgMax,
28  All,
29  Any,
30 };
31 
32 static const std::unordered_set<ReductionOpCode, utility::hash_enum_class>
33  s_regular_reduce_ops = {
38 };
39 static const std::unordered_set<ReductionOpCode, utility::hash_enum_class>
40  s_arg_reduce_ops = {
43 };
44 static const std::unordered_set<ReductionOpCode, utility::hash_enum_class>
45  s_boolean_reduce_ops = {
48 };
49 
50 void Reduction(const Tensor& src,
51  Tensor& dst,
52  const SizeVector& dims,
53  bool keepdim,
54  ReductionOpCode op_code);
55 
56 void ReductionCPU(const Tensor& src,
57  Tensor& dst,
58  const SizeVector& dims,
59  bool keepdim,
60  ReductionOpCode op_code);
61 
62 #ifdef BUILD_CUDA_MODULE
63 void ReductionCUDA(const Tensor& src,
64  Tensor& dst,
65  const SizeVector& dims,
66  bool keepdim,
67  ReductionOpCode op_code);
68 #endif
69 
70 } // namespace kernel
71 } // namespace core
72 } // namespace open3d
ReductionOpCode
Definition: Reduction.h:21
void ReductionCPU(const Tensor &src, Tensor &dst, const SizeVector &dims, bool keepdim, ReductionOpCode op_code)
Definition: ReductionCPU.cpp:219
void Reduction(const Tensor &src, Tensor &dst, const SizeVector &dims, bool keepdim, ReductionOpCode op_code)
Definition: Reduction.cpp:16
Definition: PinholeCameraIntrinsic.cpp:16