REGISTER_CPU_KERNEL
Description
Registers a kernel implementation.
Prototype
REGISTER_CPU_KERNEL(type, clazz)
Note: The following API is called by the preceding macro definition, rather than directly called by developers.
AICPU_VISIBILITY bool RegistCpuKernel(const std::string &type, const KERNEL_CREATOR_FUN &fun);
template <typename T, typename... Args> static inline std::shared_ptr<T> MakeShared(Args &&... args);
Parameters
- type: OpType of the operator
- clazz: kernel implementation name of the operator, that is, the name of the defined custom operator class. The custom operator class is a derived class of the base class CpuKernel.
Example
namespace {
const char *RESHAPE = "Reshape";
}
namespace aicpu {
uint32_t ReshapeCpuKernel::Compute(CpuKernelContext &ctx)
{
// Compute Implementation
}
REGISTER_CPU_KERNEL(RESHAPE, ReshapeCpuKernel);
} // namespace aicpu
Parent topic: CpuKernel Registration