Go to the source code of this file.
◆ 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); \
} \
}
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.
◆ indexer