19using Executor = std::variant<SerialExecutor, CPUExecutor, GPUExecutor>;
24 if (std::holds_alternative<NeoN::GPUExecutor>(exec))
33 return std::visit([](
auto e) {
return e.getLogger(); }, exec);
39 std::visit([logger](
auto& e) { e.setLogger(logger); }, exec);
53 typename ExecRhs>([[maybe_unused]]
const ExecLhs&, [[maybe_unused]]
const ExecRhs&)
55 if constexpr (std::is_same_v<ExecLhs, ExecRhs>)
57 return typename ExecLhs::exec() ==
typename ExecRhs::exec();
void setLogger(Executor &exec, std::shared_ptr< Logging::BaseLogger > logger)
void fence(const Executor &exec)
std::shared_ptr< const Logging::BaseLogger > getLogger(const Executor &exec)
std::variant< SerialExecutor, CPUExecutor, GPUExecutor > Executor
bool operator==(const Executor &lhs, const Executor &rhs)
Checks if two executors are equal, i.e. they are of the same type.
bool operator!=(const Executor &lhs, const Executor &rhs)
Checks if two executors are not equal, i.e. they are not of the same type.