Register an XLA FFI handler for use with stablehlo.custom_call.
Handlers are C/C++ functions defined using the XLA FFI API
(see xla/ffi/api/ffi.h shipped in pjrt's inst/include/).
They are passed to this function as external pointers.
Registration is deferred: if the PJRT plugin for a given platform
is not yet loaded, the handler is queued and registered automatically
when pjrt_plugin() loads it.
Arguments
- target_name
(
character(1))
The target name used instablehlo.custom_call @target_name(...).- handler
A named list of external pointers (
externalptr) toXLA_FFI_Handlers, keyed by PJRT platform name (e.g.,list(host = ptr)orlist(host = cpu_ptr, cuda = cuda_ptr)).- .package
(
character(1)orNULL)
The package registering this handler. When provided, handlers are automatically removed from the registry when the package unloads.