Contents

class

SushiBLAS::TaskRecorder

Records tasks on one TaskGraph under one execution mode.

Declared in
include/SushiBLAS/engine/task_recorder.hpp

See also

include/SushiBLAS/engine/README.md

Public member functions

TaskRecorder(SushiRuntime::Graph::TaskGraph &graph, ScratchPool &scratch_pool, ExecutionMode mode=ExecutionMode::AUTO) noexcept

Binds the recorder to the graph it records on and the pool its tasks lease from.

Parameters

graph

Receives every task; it must outlive the recorder.

scratch_pool

Lends operation scratch; it must outlive the recorder.

TaskRecorder(const TaskRecorder &)=delete
TaskRecorder & operator=(const TaskRecorder &)=delete
TaskRecorder(TaskRecorder &&)=delete
TaskRecorder & operator=(TaskRecorder &&)=delete
~TaskRecorder()=default
ExecutionMode get_mode() const noexcept

Returns the mode every later record call is recorded under.

void set_mode(ExecutionMode mode) noexcept

Sets the mode every later record call is recorded under.

ScratchPool & get_scratch_pool() const noexcept

Returns the pool recorded tasks lease their device scratch from.

void require_sycl_path(const char *family, const char *name) const

Throws as record() would, for a caller that must refuse before a side effect.

Exceptions

std::invalid_argument

under FORCE_REFERENCE, naming family and name.

template <typename Body>
TaskHandle record(const SushiRuntime::Graph::TaskMetadata &meta, const OperandSet &operands, const char *family, Body &&body)

Records a task that has a SYCL kernel only.

Parameters

family

What kind of operation this is, for the diagnostic.

body

Callable (sycl::queue&, const std::vector<sycl::event>&) -> sycl::event, copyable and callable more than once; it orders its work behind the events it is given.

Exceptions

std::invalid_argument

under FORCE_REFERENCE; no task is recorded.

template <typename Body>
TaskHandle record_pair(const SushiRuntime::Graph::TaskMetadata &meta, const OperandSet &operands, const char *family, Body &&body)

Records a task whose body runs a reference and SYCL kernel pair.

Parameters

body

Callable (const Internal::KernelPairDispatcher&, sycl::queue&, const std::vector<sycl::event>&) -> sycl::event, copyable, callable more than once, and ordering its work behind the events it is given.

Exceptions

std::invalid_argument

under FORCE_REFERENCE when a declared tensor is device-only USM; no task is recorded.