Scanner C++ API
|
Public Member Functions | |
PythonKernel (const KernelConfig &config, const std::string &op_name, const std::string &kernel_code, const bool can_batch, const bool con_stencil) | |
void | new_stream (const std::vector< u8 > &args) override |
Called when the Kernel is about to process a new stream. More... | |
void | execute (const StenciledBatchedElements &input_columns, BatchedElements &output_columns) override |
Runs the op on input elements and produces equal number of output elements. More... | |
void | reset () override |
Requests that kernel resets its logical state. More... | |
void | fetch_resources (proto::Result *result) override |
Downloads any resources necessary for the kernel to run. More... | |
void | setup_with_resources (proto::Result *result) override |
Runs any setup code that relies on fetched resources. More... | |
Public Member Functions inherited from scanner::StenciledBatchedKernel | |
StenciledBatchedKernel (const KernelConfig &config) | |
virtual void | execute_kernel (const StenciledBatchedElements &input_columns, BatchedElements &output_columns) override |
For internal use. | |
Public Member Functions inherited from scanner::BaseKernel | |
BaseKernel (const KernelConfig &config) | |
virtual void | validate (proto::Result *result) |
Checks if kernel arguments are valid. More... | |
virtual void | set_profiler (Profiler *profiler) |
For internal use. | |
Additional Inherited Members | |
Public Attributes inherited from scanner::BaseKernel | |
Profiler * | profiler_ = nullptr |
Static Public Attributes inherited from scanner::StenciledBatchedKernel | |
static const i32 | UnlimitedDevices = 0 |
Static Public Attributes inherited from scanner::BaseKernel | |
static const i32 | UnlimitedDevices = 0 |
Protected Attributes inherited from scanner::StenciledBatchedKernel | |
Profiler * | profiler_ = nullptr |
|
overridevirtual |
Runs the op on input elements and produces equal number of output elements.
input_columns | vector of columns, where each column is a vector of inputs and each input is a byte array |
output_columns | op output, each column must have same length as the number of input elements |
Evaluate gets run on batches of inputs. At the beginning of a pipeline this is raw RGB images from the input images/videos, and after that the input becomes whatever was returned by the previous op.
Number of output columns must be non-zero.
Implements scanner::StenciledBatchedKernel.
|
overridevirtual |
Downloads any resources necessary for the kernel to run.
For a given kernel, only run once per worker.
Reimplemented from scanner::BaseKernel.
|
overridevirtual |
Called when the Kernel is about to process a new stream.
args | the arguments that were bound to this Op for this stream |
Reimplemented from scanner::BaseKernel.
|
overridevirtual |
Requests that kernel resets its logical state.
Scanner calls reset on a kernel when it provides non-consecutive inputs or when about to provide inputs from a difference slice. This allows unbounded or bounded state kernels to clear their logical state so that state from logically unrelated parts of the input do not affect the output.
Reimplemented from scanner::BaseKernel.
|
overridevirtual |
Runs any setup code that relies on fetched resources.
Guaranteed to be called on all kernels after fetch_resources is called on one kernel.
Reimplemented from scanner::BaseKernel.