Ginkgo: gko::OmpExecutor Class Reference

| Ginkgo Generated from branch based on main. Ginkgo version 1.11.0 A numerical linear algebra library targeting many-core architectures

Loading...
Searching...
No Matches
gko::OmpExecutor Class Reference
Executors » OpenMP Executor | Executors

This is the Executor subclass which represents the OpenMP device (typically CPU). More...

`#include <ginkgo/core/base/executor.hpp>`

Inheritance diagram for gko::OmpExecutor:
[legend]
Collaboration diagram for gko::OmpExecutor:
[legend]

## Public Member Functions
std::shared_ptr< Executor > | get_master () noexcept override
| Returns the master OmpExecutor of this Executor.
std::shared_ptr< const Executor > | get_master () const noexcept override
| Returns the master OmpExecutor of this Executor.
void | synchronize () const override
| Synchronize the operations launched on the executor with its master.
int | get_num_cores () const
int | get_num_threads_per_core () const
scoped_device_id_guard | get_scoped_device_id_guard () const override
std::string | get_description () const override
virtual void | run (const Operation &op) const=0
| Runs the specified Operation using this Executor.
template<typename ClosureOmp, typename ClosureCuda, typename ClosureHip, typename ClosureDpcpp>
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<typename ClosureReference, typename ClosureOmp, typename ClosureCuda, typename ClosureHip, typename ClosureDpcpp>
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.

## Static Public Member Functions
static std::shared_ptr< OmpExecutor > | create (std::shared_ptr< CpuAllocatorBase > alloc=std::make_shared< CpuAllocator >())
| Creates a new OmpExecutor.
static int | get_num_omp_threads ()

## Detailed Description

This is the Executor subclass which represents the OpenMP device (typically CPU).

## Member Function Documentation

## ◆ get_description()

std::string gko::OmpExecutor::get_description | ( |  | ) | const
| overridevirtual

Returns
  a textual representation of the executor and its device.

Implements gko::Executor.

Reimplemented in gko::ReferenceExecutor.

References gko::Executor::alloc(), and gko::machine_topology::get_instance().

## ◆ get_master() [1/2]

std::shared_ptr< const Executor > gko::OmpExecutor::get_master | ( |  | ) | const
| overridevirtualnoexcept

Returns the master OmpExecutor of this Executor.

Returns
  the master OmpExecutor of this Executor.

Implements gko::Executor.

References get_master().

## ◆ get_master() [2/2]

std::shared_ptr< Executor > gko::OmpExecutor::get_master | ( |  | ) |
| overridevirtualnoexcept

Returns the master OmpExecutor of this Executor.

Returns
  the master OmpExecutor of this Executor.

Implements gko::Executor.

Referenced by get_master().

## ◆ get_scoped_device_id_guard()

scoped_device_id_guard gko::OmpExecutor::get_scoped_device_id_guard | ( |  | ) | const
| overridevirtual

Implements gko::Executor.

## ◆ run() [1/3]

template<typename ClosureOmp, typename ClosureCuda, typename ClosureHip, typename ClosureDpcpp>

void gko::Executor::run | ( | const ClosureOmp & | op_omp,
|  | const ClosureCuda & | op_cuda,
|  | const ClosureHip & | op_hip,
|  | const ClosureDpcpp & | op_dpcpp ) const
| inline

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

  op_omp | functor to run in case of a OmpExecutor or ReferenceExecutor
  op_cuda | functor to run in case of a CudaExecutor
  op_hip | functor to run in case of a HipExecutor
  op_dpcpp | functor to run in case of a DpcppExecutor

## ◆ run() [2/3]

virtual void gko::Executor::run | ( | const Operation & | op | ) | const
| virtual

Runs the specified Operation using this Executor.

Parameters

  op | the operation to run

Implements gko::Executor.

Reimplemented in gko::ReferenceExecutor.

## ◆ run() [3/3]

template<typename ClosureReference, typename ClosureOmp, typename ClosureCuda, typename ClosureHip, typename ClosureDpcpp>

void gko::Executor::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
| inline

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

  name | the name of the operation
  op_ref | functor to run in case of a ReferenceExecutor
  op_omp | functor to run in case of a OmpExecutor
  op_cuda | functor to run in case of a CudaExecutor
  op_hip | functor to run in case of a HipExecutor
  op_dpcpp | functor to run in case of a DpcppExecutor

## ◆ synchronize()

void gko::OmpExecutor::synchronize | ( |  | ) | const
| overridevirtual

Synchronize the operations launched on the executor with its master.

Implements gko::Executor.

References synchronize().

Referenced by synchronize().

The documentation for this class was generated from the following file:

- ginkgo/core/base/executor.hpp