Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Add CPU kernel builders #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions nvtx_plugins/cc/nvtx_kernels.cc
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,24 @@ class NvtxEndOp : public OpKernel {

TF_CALL_NUMBER_TYPES(REGISTER_GPU_KERNEL);
#undef REGISTER_GPU_KERNEL

#define REGISTER_CPU_KERNEL(type) \
REGISTER_KERNEL_BUILDER(Name("NvtxStart") \
.Device(DEVICE_CPU) \
.HostMemory("message") \
.HostMemory("domain_name") \
.HostMemory("marker_id") \
.HostMemory("domain_handle") \
.TypeConstraint<type>("T"), \
NvtxStartOp<type>); \
REGISTER_KERNEL_BUILDER(Name("NvtxEnd") \
.Device(DEVICE_CPU) \
.HostMemory("marker_id") \
.HostMemory("domain_handle") \
.HostMemory("grad_message") \
.HostMemory("grad_domain_name") \
.TypeConstraint<type>("T"), \
NvtxEndOp<type>);

TF_CALL_NUMBER_TYPES(REGISTER_CPU_KERNEL);
#undef REGISTER_CPU_KERNEL