gko::ReferenceExecutor#

Single-threaded host executor. Every kernel runs sequentially on the calling thread; allocations come from the system allocator. The reference backend is Ginkgo’s correctness baseline — every numerical algorithm in the library has a reference implementation that the parallel backends are validated against.

Use ReferenceExecutor when correctness or determinism matters more than performance: debugging, small problems, regression tests, reproducing parallel results. For production workloads on multi-core CPUs use OmpExecutor instead.

class ReferenceExecutor #

Inherits from

This is a specialization of the OmpExecutor, which runs the reference implementations of the kernels used for debugging purposes.

Public Functions

inline virtual std::string get_description() const override#
Returns:

a textual representation of the executor and its device.

inline virtual void run(const Operation &op) const override#

Runs the specified Operation using this Executor.

Parameters:

op – the operation to run

template<typename ClosureOmp, typename ClosureCuda, typename ClosureHip, typename ClosureDpcpp>
inline void run(
const ClosureOmp &op_omp,
const ClosureCuda &op_cuda,
const ClosureHip &op_hip,
const ClosureDpcpp &op_dpcpp,
) const#

Runs one of the passed in functors, depending on the Executor type.

Template Parameters:
  • ClosureOmp – type of op_omp

  • ClosureCuda – type of op_cuda

  • ClosureHip – type of op_hip

  • ClosureDpcpp – type of op_dpcpp

Parameters:
template<typename ClosureReference, typename ClosureOmp, typename ClosureCuda, typename ClosureHip, typename ClosureDpcpp>
inline void run(
std::string name,
const ClosureReference &op_ref,
const ClosureOmp &op_omp,
const ClosureCuda &op_cuda,
const ClosureHip &op_hip,
const ClosureDpcpp &op_dpcpp,
) const#

Runs one of the passed in functors, depending on the Executor type.

Template Parameters:
  • ClosureReference – type of op_ref

  • ClosureOmp – type of op_omp

  • ClosureCuda – type of op_cuda

  • ClosureHip – type of op_hip

  • ClosureDpcpp – type of op_dpcpp

Parameters: