Custom Operators¶
This directory contains PTO custom operator development examples, demonstrating how to implement custom operators from scratch.
If you are new to PTO programming, start from the basics first:
- Getting Started: docs/getting-started.md
- Programming tutorials: docs/coding/tutorial.md
- Add operator example: demos/baseline/add/README.md
Examples¶
fused_add_relu_mul/: Operator fusion example, fusing Add + ReLU + Mul into one kernel, achieving 2-3× speedup.
How to run¶
Each subdirectory is a standalone example with its own build/run instructions. See:
Developing Custom Operators¶
Refer to the fused_add_relu_mul/ example and follow these steps:
- Create directory:
mkdir -p kernels/custom/my_operator - Implement kernel:
my_operator_kernel.cpp - Write tests:
main.cpp - Configure build:
CMakeLists.txt - Run and verify:
./run.sh --sim
For detailed development guides, see: