Open3D (C++ API)  0.13.0
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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 
115 template <class TFeat, class TReal, class TIndex>
116 void FillColumn(const cudaStream_t& stream,
117  TFeat* columns,
118  int in_channels,
119  TIndex begin_idx,
120  TIndex end_idx,
121  TIndex num_out,
122  const TReal* const __restrict__ out_positions,
123  TIndex num_inp,
124  const TReal* const __restrict__ inp_positions,
125  const TFeat* const __restrict__ inp_features,
126  const TFeat* const __restrict__ inp_importance,
127  size_t neighbors_index_size,
128  const TIndex* const __restrict__ neighbors_index,
129  const TFeat* const __restrict__ neighbors_importance,
130  const int64_t* const __restrict__ neighbors_row_splits,
131  const TReal* const __restrict__ extents,
132  const TReal* const __restrict__ offsets,
133  const std::vector<int>& filter_dims,
134  InterpolationMode interpolation,
135  CoordinateMapping coordinate_mapping,
136  bool align_corners,
137  bool individual_extent,
138  bool isotropic_extent,
139  bool normalize);
140 
141 template <class TFeat, class TReal, class TIndex>
143  const cudaStream_t& stream,
144  TFeat* columns,
145  int in_channels,
146  TIndex begin_idx,
147  TIndex end_idx,
148  TIndex num_out,
149  const TReal* const __restrict__ out_positions,
150  TIndex num_inp,
151  const TReal* const __restrict__ inp_positions,
152  const TFeat* const __restrict__ inp_features,
153  const TFeat* const __restrict__ inp_neighbors_importance_sum,
154  const int64_t* const __restrict__ inp_neighbors_prefix_sum,
155  size_t neighbors_index_size,
156  const TIndex* const __restrict__ neighbors_index,
157  const TFeat* const __restrict__ neighbors_importance,
158  const int64_t* const __restrict__ neighbors_row_splits,
159  const TReal* const __restrict__ extents,
160  const TReal* const __restrict__ offsets,
161  const std::vector<int>& filter_dims,
162  InterpolationMode interpolation,
163  CoordinateMapping coordinate_mapping,
164  bool align_corners,
165  bool individual_extent,
166  bool isotropic_extent,
167  bool normalize);
168 
176 template <class T>
177 void MultiplyColumns(const cudaStream_t& stream,
178  size_t rows,
179  size_t cols,
180  T* __restrict__ col_major_matrix,
181  const T* const __restrict__ vector);
182 
192 template <class T>
193 void MultiplyAndCopyColumns(const cudaStream_t& stream,
194  size_t rows,
195  size_t cols,
196  T* __restrict__ out_ptr,
197  const T* const __restrict__ col_major_matrix,
198  const T* const __restrict__ vector);
199 
200 } // namespace impl
201 } // namespace ml
202 } // namespace open3d
void FillColumn(const cudaStream_t &stream, TFeat *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 TFeat *const __restrict__ inp_features, const TFeat *const __restrict__ inp_importance, size_t neighbors_index_size, const TIndex *const __restrict__ neighbors_index, const TFeat *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)
InterpolationMode
Definition: ContinuousConvTypes.h:37
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)
void FillColumnTranspose(const cudaStream_t &stream, TFeat *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 TFeat *const __restrict__ inp_features, const TFeat *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 TFeat *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)
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)