Ginkgo: ginkgo/core/base/device.hpp Source File

| 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
device.hpp
1// SPDX-FileCopyrightText: 2017 - 2024 The Ginkgo authors
2//
3// SPDX-License-Identifier: BSD-3-Clause
4
5#ifndef GKO_PUBLIC_CORE_BASE_DEVICE_HPP_
6#define GKO_PUBLIC_CORE_BASE_DEVICE_HPP_
7
8
9#include <array>
10#include <cstdint>
11#include <mutex>
12#include <type_traits>
13
14#include <ginkgo/config.hpp>
15
16
17namespace gko {
18
19
20class CudaExecutor;
21
22class HipExecutor;
23
24
29 class nvidia_device {
30 friend class CudaExecutor;
31 friend class HipExecutor;
32
33private:
41 static std::mutex& get_mutex(int i);
42
50 static int& get_num_execs(int i);
51
52 static constexpr int max_devices = 64;
53};
54
55
60 class amd_device {
61 friend class HipExecutor;
62
63private:
71 static std::mutex& get_mutex(int i);
72
80 static int& get_num_execs(int i);
81
82 static constexpr int max_devices = 64;
83};
84
85
86} // namespace gko
87
88#endif // GKO_PUBLIC_CORE_BASE_DEVICE_HPP_
gko::CudaExecutor
This is the Executor subclass which represents the CUDA device.
Definition executor.hpp:1542
gko::HipExecutor
This is the Executor subclass which represents the HIP enhanced device.
Definition executor.hpp:1787
gko::amd_device
amd_device handles the number of executor on Amd devices and have the corresponding recursive_mutex.
Definition device.hpp:60
gko::nvidia_device
nvidia_device handles the number of executor on Nvidia devices and have the corresponding recursive_m...
Definition device.hpp:29
gko
The Ginkgo namespace.
Definition abstract_factory.hpp:20