Add a C++ wrapper#
To add a c++ wrapper, you need to build FlagGems with C extensions first. Please refer to Install FlagGems.
Write the Wrapper#
Add function declaration of the operator in include/flag_gems/operators.h
Add implementation of the function in lib/op_name.cpp
Change the cmakefile lib/CMakeLists.txt
Add python bindings in src/flag_gems/csrc/cstub.cpp
Add the triton_jit function in triton_src, currently we use a new directory to store the triton_jit functions and later will reuse the triton_jit functions in flag_gems python code.
Write the Test#
FlagGems uses ctest and googletest for c++ unit test.
After finishing the c++ wrapper, a corresponding c++ test should be added as well.
Add your test in ctests/test_triton_xxx.cpp and ctests/CMakeLists.txt
Just build your test and run it with C++ tests
Push your code#
Itβs better to include end-to-end performance data in the PR description.