ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
UnaryEWSYCL.cpp File Reference
Include dependency graph for UnaryEWSYCL.cpp:

Go to the source code of this file.

Namespaces

 cloudViewer
 Generic file read and write utility for python interface.
 
 cloudViewer::core
 
 cloudViewer::core::kernel
 

Macros

#define UNARY_ELEMENT_KERNEL(name, elem_op)
 
#define UNARY_ELEMENT_KERNEL(name, elem_op)
 

Functions

void cloudViewer::core::kernel::CopySYCL (const Tensor &src, Tensor &dst)
 
void cloudViewer::core::kernel::UnaryEWSYCL (const Tensor &src, Tensor &dst, UnaryEWOpCode op_code)
 

Macro Definition Documentation

◆ UNARY_ELEMENT_KERNEL [1/2]

#define UNARY_ELEMENT_KERNEL (   name,
  elem_op 
)
Value:
template <typename src_t> \
struct name##ElementKernel : public UnaryElementKernel { \
using UnaryElementKernel::UnaryElementKernel; \
void operator()(int64_t i) { \
const src_t* src = indexer.GetInputPtr<src_t>(0, i); \
src_t* dst = indexer.GetOutputPtr<src_t>(i); \
*dst = static_cast<src_t>(elem_op(static_cast<double>(*src))); \
} \
}; \
template <> \
struct name##ElementKernel<float> : public UnaryElementKernel { \
using UnaryElementKernel::UnaryElementKernel; \
void operator()(int64_t i) { \
const float* src = indexer.GetInputPtr<float>(0, i); \
float* dst = indexer.GetOutputPtr<float>(i); \
*dst = elem_op(*src); \
} \
}
std::string name
Indexer indexer
Definition: UnaryEWSYCL.cpp:34

Definition at line 95 of file UnaryEWSYCL.cpp.

◆ UNARY_ELEMENT_KERNEL [2/2]

#define UNARY_ELEMENT_KERNEL (   name,
  elem_op 
)
Value:
template <typename src_t> \
struct name##ElementKernel : public UnaryElementKernel { \
using UnaryElementKernel::UnaryElementKernel; \
void operator()(int64_t i) { \
const src_t* src = indexer.GetInputPtr<src_t>(0, i); \
bool* dst = indexer.GetOutputPtr<bool>(i); \
*dst = elem_op(static_cast<double>(*src)); \
} \
}; \
template <> \
struct name##ElementKernel<float> : public UnaryElementKernel { \
using UnaryElementKernel::UnaryElementKernel; \
void operator()(int64_t i) { \
const float* src = indexer.GetInputPtr<float>(0, i); \
bool* dst = indexer.GetOutputPtr<bool>(i); \
*dst = elem_op(*src); \
} \
}

Definition at line 95 of file UnaryEWSYCL.cpp.

Variable Documentation

◆ indexer

Indexer indexer
protected