33#ifndef GKO_PUBLIC_CORE_BASE_SCOPED_DEVICE_ID_GUARD_HPP_
34#define GKO_PUBLIC_CORE_BASE_SCOPED_DEVICE_ID_GUARD_HPP_
44class ReferenceExecutor;
57class generic_scoped_device_id_guard {
59 generic_scoped_device_id_guard() =
default;
63 virtual ~generic_scoped_device_id_guard() =
default;
66 generic_scoped_device_id_guard(
67 const generic_scoped_device_id_guard&
other) =
delete;
70 generic_scoped_device_id_guard& operator=(
71 const generic_scoped_device_id_guard&
other) =
delete;
175 std::unique_ptr<detail::generic_scoped_device_id_guard> scope_;
This is the Executor subclass which represents the CUDA device.
Definition executor.hpp:1513
This is the Executor subclass which represents a DPC++ enhanced device.
Definition executor.hpp:1925
This is the Executor subclass which represents the HIP enhanced device.
Definition executor.hpp:1727
This is the Executor subclass which represents the OpenMP device (typically CPU).
Definition executor.hpp:1366
This is a specialization of the OmpExecutor, which runs the reference implementations of the kernels ...
Definition executor.hpp:1443
This move-only class uses RAII to set the device id within a scoped block, if necessary.
Definition scoped_device_id_guard.hpp:104
scoped_device_id_guard(const DpcppExecutor *exec, int device_id)
Create a scoped device id from an DpcppExecutor.
scoped_device_id_guard(const OmpExecutor *exec, int device_id)
Create a scoped device id from an OmpExecutor.
scoped_device_id_guard(const HipExecutor *exec, int device_id)
Create a scoped device id from an HipExecutor.
scoped_device_id_guard(const CudaExecutor *exec, int device_id)
Create a scoped device id from an CudaExecutor.
scoped_device_id_guard(const ReferenceExecutor *exec, int device_id)
Create a scoped device id from an Reference.
The Ginkgo namespace.
Definition abstract_factory.hpp:48
constexpr T one()
Returns the multiplicative identity for T.
Definition math.hpp:803