ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
IndexReduction.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 void IndexAdd_(int64_t dim,
19  const Tensor& index,
20  const Tensor& src,
21  Tensor& dst);
22 
23 void IndexAddCPU_(int64_t dim,
24  const Tensor& index,
25  const Tensor& src,
26  Tensor& dst);
27 
28 #ifdef BUILD_SYCL_MODULE
29 void IndexAddSYCL_(int64_t dim,
30  const Tensor& index,
31  const Tensor& src,
32  Tensor& dst);
33 #endif
34 
35 #ifdef BUILD_CUDA_MODULE
36 void IndexAddCUDA_(int64_t dim,
37  const Tensor& index,
38  const Tensor& src,
39  Tensor& dst);
40 #endif
41 
42 } // namespace kernel
43 } // namespace core
44 } // namespace cloudViewer
cloudViewer
Generic file read and write utility for python interface.
Definition: CloudViewerConfig.cpp:12
cloudViewer::core::Tensor::GetDtype
Dtype GetDtype() const
Definition: Tensor.h:1164
AdvancedIndexing.h
cloudViewer::core::IsDevice::IsCUDA
bool IsCUDA() const
Definition: Device.h:99
cloudViewer::core::kernel::IndexAdd_
void IndexAdd_(int64_t dim, const Tensor &index, const Tensor &src, Tensor &dst)
Definition: IndexReduction.cpp:16
cloudViewer::core::Dtype::ByteSize
int64_t ByteSize() const
Definition: Dtype.h:59
cloudViewer::core::Tensor::Permute
Tensor Permute(const SizeVector &dims) const
Permute (dimension shuffle) the Tensor, returns a view.
Definition: Tensor.cpp:1028
cloudViewer::core::Tensor
Definition: Tensor.h:32
SYCLContext.h
SYCL queue manager.
cloudViewer::core::AdvancedIndexer::GetInputPtr
CLOUDVIEWER_HOST_DEVICE char * GetInputPtr(int64_t workload_idx) const
Definition: AdvancedIndexing.h:167
cloudViewer::core::Dtype
Definition: Dtype.h:21
cloudViewer::core::AdvancedIndexer::AdvancedIndexerMode::SET
@ SET
cloudViewer::core::kernel::IndexAddCPU_
void IndexAddCPU_(int64_t dim, const Tensor &index, const Tensor &src, Tensor &dst)
Definition: IndexReductionCPU.cpp:66
cloudViewer::core::Tensor::NumDims
int64_t NumDims() const
Definition: Tensor.h:1172
ParallelFor.h
cloudViewer::core::kernel::IndexSetSYCL
void IndexSetSYCL(const Tensor &src, Tensor &dst, const std::vector< Tensor > &index_tensors, const SizeVector &indexed_shape, const SizeVector &indexed_strides)
Definition: IndexGetSetSYCL.cpp:46
cloudViewer::core::kernel::IndexGetCPU
void IndexGetCPU(const Tensor &src, Tensor &dst, const std::vector< Tensor > &index_tensors, const SizeVector &indexed_shape, const SizeVector &indexed_strides)
Definition: IndexGetSetCPU.cpp:42
cloudViewer::core::kernel::CPUCopyObjectElementKernel
static void CPUCopyObjectElementKernel(const void *src, void *dst, int64_t object_byte_size)
Definition: IndexGetSetCPU.cpp:34
cloudViewer::core::kernel::LaunchAdvancedIndexerKernel
static void LaunchAdvancedIndexerKernel(const AdvancedIndexer &indexer, const func_t &func)
Definition: IndexGetSetCPU.cpp:21
Dispatch.h
cloudViewer::core::Device
Definition: Device.h:18
core
cloudViewer::core::kernel::IndexGetSYCL
void IndexGetSYCL(const Tensor &src, Tensor &dst, const std::vector< Tensor > &index_tensors, const SizeVector &indexed_shape, const SizeVector &indexed_strides)
Definition: IndexGetSetSYCL.cpp:18
cloudViewer::core::Tensor::GetDevice
Device GetDevice() const override
Definition: Tensor.cpp:1435
DISPATCH_DTYPE_TO_TEMPLATE_WITH_BOOL
#define DISPATCH_DTYPE_TO_TEMPLATE_WITH_BOOL(DTYPE,...)
Definition: Dispatch.h:68
cloudViewer::core::SizeVector
Definition: SizeVector.h:70
IndexReduction.h
indexer
Indexer indexer
Definition: BinaryEWSYCL.cpp:30
LogError
#define LogError(...)
Definition: Logging.h:60
cloudViewer::core::AdvancedIndexer::GetOutputPtr
CLOUDVIEWER_HOST_DEVICE char * GetOutputPtr(int64_t workload_idx) const
Definition: AdvancedIndexing.h:175
cloudViewer::core::sy::SYCLContext::GetInstance
static SYCLContext & GetInstance()
Get singleton instance.
Definition: SYCLContext.cpp:25
cloudViewer::core::IsDevice::IsCPU
bool IsCPU() const
Definition: Device.h:95
cloudViewer::core::kernel::IndexAddSYCL_
void IndexAddSYCL_(int64_t dim, const Tensor &index, const Tensor &src, Tensor &dst)
Definition: IndexReductionSYCL.cpp:19
IndexGetSet.h
Tensor.h
cloudViewer::core::AdvancedIndexer::NumWorkloads
int64_t NumWorkloads() const
Definition: AdvancedIndexing.h:198
cloudViewer::core::IsDevice::IsSYCL
bool IsSYCL() const
Definition: Device.h:103
cloudViewer::core::Dtype::IsObject
bool IsObject() const
Definition: Dtype.h:63
cloudViewer::core::ParallelFor
void ParallelFor(const Device &device, int64_t n, const func_t &func)
Definition: ParallelFor.h:111
cloudViewer::core::kernel::CPUCopyElementKernel
static void CPUCopyElementKernel(const void *src, void *dst)
Definition: IndexGetSetCPU.cpp:30
cloudViewer::core::sy::SYCLContext::GetDefaultQueue
sycl::queue GetDefaultQueue(const Device &device)
Get the default SYCL queue given an CloudViewer device.
Definition: SYCLContext.cpp:43
cloudViewer::core::AdvancedIndexer
Definition: AdvancedIndexing.h:117
cloudViewer::core::AdvancedIndexer::AdvancedIndexerMode::GET
@ GET
cloudViewer::core::kernel::IndexSetCPU
void IndexSetCPU(const Tensor &src, Tensor &dst, const std::vector< Tensor > &index_tensors, const SizeVector &indexed_shape, const SizeVector &indexed_strides)
Definition: IndexGetSetCPU.cpp:62