Ginkgo: gko::DpcppExecutor 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::DpcppExecutor Class Reference
Executors » DPC++ Executor | Executors

This is the Executor subclass which represents a DPC++ enhanced device. More...

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

Inheritance diagram for gko::DpcppExecutor:
[legend]
Collaboration diagram for gko::DpcppExecutor:
[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.
scoped_device_id_guard | get_scoped_device_id_guard () const override
std::string | get_description () const override
int | get_device_id () const noexcept
| Get the DPCPP device id of the device associated to this executor.
sycl::queue * | get_queue () const
const std::vector< int > & | get_subgroup_sizes () const noexcept
| Get the available subgroup sizes for this device.
int | get_num_computing_units () const noexcept
| Get the number of Computing Units of this executor.
int | get_num_subgroups () const noexcept
| Get the number of subgroups of this executor.
const std::vector< int > & | get_max_workitem_sizes () const noexcept
| Get the maximum work item sizes.
int | get_max_workgroup_size () const noexcept
| Get the maximum workgroup size.
int | get_max_subgroup_size () const noexcept
| Get the maximum subgroup size.
std::string | get_device_type () const noexcept
| Get a string representing the device type.
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< DpcppExecutor > | create (int device_id, std::shared_ptr< Executor > master, std::string device_type="all", dpcpp_queue_property property=dpcpp_queue_property::in_order)
| Creates a new DpcppExecutor.
static int | get_num_devices (std::string device_type)
| Get the number of devices present on the system.

## Detailed Description

This is the Executor subclass which represents a DPC++ enhanced device.

## Member Function Documentation

## ◆ create()

std::shared_ptr< DpcppExecutor > gko::DpcppExecutor::create | ( | int | device_id,
|  | std::shared_ptr< Executor > | master,
|  | std::string | device_type = "all",
|  | dpcpp_queue_property | property = dpcpp_queue_property::in_order )
| static

Creates a new DpcppExecutor.

Parameters

  device_id | the DPCPP device id of this device
  master | an executor on the host that is used to invoke the device kernels
  device_type | a string representing the type of device to consider (accelerator, cpu, gpu or all).

## ◆ get_description()

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

Returns
  a textual representation of the executor and its device.

Implements gko::Executor.

References get_description().

Referenced by get_description().

## ◆ get_device_id()

int gko::DpcppExecutor::get_device_id | ( |  | ) | const
| inlinenoexcept

Get the DPCPP device id of the device associated to this executor.

Returns
  the DPCPP device id of the device associated to this executor

References get_device_id().

Referenced by get_device_id().

## ◆ get_device_type()

std::string gko::DpcppExecutor::get_device_type | ( |  | ) | const
| inlinenoexcept

Get a string representing the device type.

Returns
  a string representing the device type

## ◆ get_master() [1/2]

std::shared_ptr< const Executor > gko::DpcppExecutor::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::DpcppExecutor::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_max_subgroup_size()

int gko::DpcppExecutor::get_max_subgroup_size | ( |  | ) | const
| inlinenoexcept

Get the maximum subgroup size.

Returns
  the maximum subgroup size

## ◆ get_max_workgroup_size()

int gko::DpcppExecutor::get_max_workgroup_size | ( |  | ) | const
| inlinenoexcept

Get the maximum workgroup size.

Returns
  the maximum workgroup size

## ◆ get_max_workitem_sizes()

const std::vector< int > & gko::DpcppExecutor::get_max_workitem_sizes | ( |  | ) | const
| inlinenoexcept

Get the maximum work item sizes.

Returns
  the maximum work item sizes

## ◆ get_num_computing_units()

int gko::DpcppExecutor::get_num_computing_units | ( |  | ) | const
| inlinenoexcept

Get the number of Computing Units of this executor.

Returns
  the number of Computing Units of this executor

## ◆ get_num_devices()

int gko::DpcppExecutor::get_num_devices | ( | std::string | device_type | ) |
| static

Get the number of devices present on the system.

Parameters

  device_type | a string representing the device type

Returns
  the number of devices present on the system

## ◆ get_scoped_device_id_guard()

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

Implements gko::Executor.

## ◆ get_subgroup_sizes()

const std::vector< int > & gko::DpcppExecutor::get_subgroup_sizes | ( |  | ) | const
| inlinenoexcept

Get the available subgroup sizes for this device.

Returns
  the available subgroup sizes for this device

## ◆ 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.

## ◆ 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::DpcppExecutor::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