Open3D (C++ API)  0.12.0
ContinuousConvCUDAKernels.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // The MIT License (MIT)
5 //
6 // Copyright (c) 2020 www.open3d.org
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to deal
10 // in the Software without restriction, including without limitation the rights
11 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 // copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
14 //
15 // The above copyright notice and this permission notice shall be included in
16 // all copies or substantial portions of the Software.
17 //
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24 // IN THE SOFTWARE.
25 // ----------------------------------------------------------------------------
26 
27 #pragma once
28 
29 #include <vector>
30 
32 
33 namespace open3d {
34 namespace ml {
35 namespace impl {
36 
44 // [num_out, spatial filter dims, in_channels].
113 template <class TReal, class TIndex>
114 void FillColumn(const cudaStream_t& stream,
115  TReal* columns,
116  int in_channels,
117  TIndex begin_idx,
118  TIndex end_idx,
119  TIndex num_out,
120  const TReal* const __restrict__ out_positions,
121  TIndex num_inp,
122  const TReal* const __restrict__ inp_positions,
123  const TReal* const __restrict__ inp_features,
124  const TReal* const __restrict__ inp_importance,
125  size_t neighbors_index_size,
126  const TIndex* const __restrict__ neighbors_index,
127  const TReal* const __restrict__ neighbors_importance,
128  const int64_t* const __restrict__ neighbors_row_splits,
129  const TReal* const __restrict__ extents,
130  const TReal* const __restrict__ offsets,
131  const std::vector<int>& filter_dims,
132  InterpolationMode interpolation,
133  CoordinateMapping coordinate_mapping,
134  bool align_corners,
135  bool individual_extent,
136  bool isotropic_extent,
137  bool normalize);
138 
139 template <class TReal, class TIndex>
141  const cudaStream_t& stream,
142  TReal* columns,
143  int in_channels,
144  TIndex begin_idx,
145  TIndex end_idx,
146  TIndex num_out,
147  const TReal* const __restrict__ out_positions,
148  TIndex num_inp,
149  const TReal* const __restrict__ inp_positions,
150  const TReal* const __restrict__ inp_features,
151  const TReal* const __restrict__ inp_neighbors_importance_sum,
152  const int64_t* const __restrict__ inp_neighbors_prefix_sum,
153  size_t neighbors_index_size,
154  const TIndex* const __restrict__ neighbors_index,
155  const TReal* const __restrict__ neighbors_importance,
156  const int64_t* const __restrict__ neighbors_row_splits,
157  const TReal* const __restrict__ extents,
158  const TReal* const __restrict__ offsets,
159  const std::vector<int>& filter_dims,
160  InterpolationMode interpolation,
161  CoordinateMapping coordinate_mapping,
162  bool align_corners,
163  bool individual_extent,
164  bool isotropic_extent,
165  bool normalize);
166 
174 template <class T>
175 void MultiplyColumns(const cudaStream_t& stream,
176  size_t rows,
177  size_t cols,
178  T* __restrict__ col_major_matrix,
179  const T* const __restrict__ vector);
180 
190 template <class T>
191 void MultiplyAndCopyColumns(const cudaStream_t& stream,
192  size_t rows,
193  size_t cols,
194  T* __restrict__ out_ptr,
195  const T* const __restrict__ col_major_matrix,
196  const T* const __restrict__ vector);
197 
198 } // namespace impl
199 } // namespace ml
200 } // namespace open3d
InterpolationMode
Definition: ContinuousConvTypes.h:37
void FillColumn(const cudaStream_t &stream, TReal *columns, int in_channels, TIndex begin_idx, TIndex end_idx, TIndex num_out, const TReal *const __restrict__ out_positions, TIndex num_inp, const TReal *const __restrict__ inp_positions, const TReal *const __restrict__ inp_features, const TReal *const __restrict__ inp_importance, size_t neighbors_index_size, const TIndex *const __restrict__ neighbors_index, const TReal *const __restrict__ neighbors_importance, const int64_t *const __restrict__ neighbors_row_splits, const TReal *const __restrict__ extents, const TReal *const __restrict__ offsets, const std::vector< int > &filter_dims, InterpolationMode interpolation, CoordinateMapping coordinate_mapping, bool align_corners, bool individual_extent, bool isotropic_extent, bool normalize)
void FillColumnTranspose(const cudaStream_t &stream, TReal *columns, int in_channels, TIndex begin_idx, TIndex end_idx, TIndex num_out, const TReal *const __restrict__ out_positions, TIndex num_inp, const TReal *const __restrict__ inp_positions, const TReal *const __restrict__ inp_features, const TReal *const __restrict__ inp_neighbors_importance_sum, const int64_t *const __restrict__ inp_neighbors_prefix_sum, size_t neighbors_index_size, const TIndex *const __restrict__ neighbors_index, const TReal *const __restrict__ neighbors_importance, const int64_t *const __restrict__ neighbors_row_splits, const TReal *const __restrict__ extents, const TReal *const __restrict__ offsets, const std::vector< int > &filter_dims, InterpolationMode interpolation, CoordinateMapping coordinate_mapping, bool align_corners, bool individual_extent, bool isotropic_extent, bool normalize)
void MultiplyAndCopyColumns(const cudaStream_t &stream, size_t rows, size_t cols, T *__restrict__ out_ptr, const T *const __restrict__ col_major_matrix, const T *const __restrict__ vector)
CoordinateMapping
Definition: ContinuousConvTypes.h:45
Definition: PinholeCameraIntrinsic.cpp:35
void MultiplyColumns(const cudaStream_t &stream, size_t rows, size_t cols, T *__restrict__ col_major_matrix, const T *const __restrict__ vector)