Class CoprocessorSession

Inheritance Relationships

Base Type

Class Documentation

class CoprocessorSession : public catalyst::transport::TransportSession

Coprocessor role: receives messages, process, and returns replies.

A coprocessor function comes in two conventions:

  • a host/cpu per-message function vs.

  • a device kernel launched once. Each backend overrides only the setter it supports; the other keeps the throwing default, so a mis-bind fails loudly at bind time.

Public Functions

inline virtual void set_coprocessor_fn(CoprocessorFn, void*)

Bind a per-message coprocessor function (CPU-style).

Call before start(). fn is invoked once per received message, receiving the message’s decoder_id so it can dispatch internally; ctx is passed back on every invocation and may be null.

inline virtual void set_coprocessor_launcher(CoprocessorLauncherFn, void*)

Bind a launch-once coprocessor function (GPU-style).

Call before start(). fn is invoked once (in start()) to launch a persistent engine on the session’s datapath; ctx may be null.

inline virtual CoprocConvention coprocessor_fn_convention() const

Which of the two coprocessor function convention this backend takes.

Defaults to per-message.