Create a new primitive. For details on how to do this, see the article on Adding a Primitive. Like every jitted function it runs on the active backend when called.
Arguments
- name
(
character(1))
Primitive name.- fn
(
function)
Body of the primitive. Its formals become the formals of the returned JIT-compiled callable. Insidefn, the primitive is accessible via the lexically-bound symbolself(anAnvlPrimitive); pass it as the first argument tograph_desc_add().- subgraphs
(
character())
Names of parameters that are subgraphs (for higher-order primitives).- static
(
character()|integer())
Passed tojit().- register
(
logical(1))
IfTRUE(default), register the result undernamein the primitive registry.