namespace
SushiBLAS::Internal
- Declared in
include/SushiBLAS/engine/blas/task_metadata.hpp
Contains
Functions
void get_vec_params(const Tensor &t, int64_t &n, int64_t &inc, const char *op, const char *operand)Reads the element count and the positive increment of a vector operand.
Parameters
nReceives the number of elements.
incReceives the distance between consecutive elements.
Exceptions
std::runtime_erroron a non-contiguous tensor of rank > 1.
std::invalid_argumenton missing storage or a rank-1 stride of zero or less.
void require_level2_matrix_rank(const Tensor &A, const char *op)Throws unless a Level 2 matrix operand has rank 2 or less.
Exceptions
std::invalid_argumenton a rank above 2.
constexpr Core::DataType real_result_dtype(Core::DataType dtype)Returns the dtype a norm or absolute-sum result holds for an operand of dtype.
Returns
The real component type of a complex dtype, dtype itself otherwise.
void require_scalar_result(const Tensor &result, Core::DataType expected, const char *op)Throws unless a scalar result tensor has storage, the expected dtype and exactly one element.
Exceptions
std::invalid_argumentnaming the first rule that fails.
ScratchBuffer allocate_level1_scratch(TaskRecorder &recorder, const Tensor &x, std::size_t elements, std::size_t partial_bytes, OperandSet &operands)Leases the partials scratch a Level 1 reduction over x plans on x's device, and declares it in operands.
Parameters
elementsValues the reduction folds: n, or 2n for a complex nrm2.
partial_bytesBytes one partial takes.
Returns
The scratch, empty when x has no storage or nothing is planned.
template <Dispatch::Domain Dom = Dispatch::Domain::REAL_AND_COMPLEX, typename Func>
TaskHandle execute_blas_task(TaskRecorder &recorder, const SushiRuntime::Graph::TaskMetadata &meta, const OperandSet &operands, Core::DataType dtype, Func &&op_func)Records one dtype-dispatched BLAS task whose body runs a reference and SYCL kernel pair.
Parameters
op_funcCallable taking a scalar of the element type, a const KernelPairDispatcher&, the queue and the dependencies.
Exceptions
Atrecord time as Dispatch::require_domain states, if dtype falls outside Dom.
std::invalid_argumentat record time, as TaskRecorder::record_pair states.
See also
include/SushiBLAS/engine/blas/README.md
template <Dispatch::Domain Dom = Dispatch::Domain::REAL_AND_COMPLEX, typename Func>
TaskHandle execute_typed_task(TaskRecorder &recorder, const SushiRuntime::Graph::TaskMetadata &meta, const OperandSet &operands, Core::DataType dtype, const char *family, Func &&op_func)Records one dtype-dispatched task whose body runs a reference and SYCL kernel pair.
Parameters
familyWhat kind of operation this is, for diagnostics; a string literal.
op_funcCallable taking a scalar of the element type, a const KernelPairDispatcher&, the queue and the dependencies.
Exceptions
Atrecord time as Dispatch::require_domain states, if dtype falls outside Dom.
std::invalid_argumentat record time, as TaskRecorder::record_pair states.
See also
include/SushiBLAS/engine/README.md

