Ginkgo  Generated from pipelines/1330831941 branch based on master. Ginkgo version 1.8.0
A numerical linear algebra library targeting many-core architectures
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 
15 #include <ginkgo/config.hpp>
16 
17 
18 namespace gko {
19 
20 
21 class CudaExecutor;
22 
23 class HipExecutor;
24 
25 
31  friend class CudaExecutor;
32  friend class HipExecutor;
33 
34 private:
42  static std::mutex& get_mutex(int i);
43 
51  static int& get_num_execs(int i);
52 
53  static constexpr int max_devices = 64;
54 };
55 
56 
61 class amd_device {
62  friend class HipExecutor;
63 
64 private:
72  static std::mutex& get_mutex(int i);
73 
81  static int& get_num_execs(int i);
82 
83  static constexpr int max_devices = 64;
84 };
85 
86 
87 } // namespace gko
88 
89 #endif // GKO_PUBLIC_CORE_BASE_DEVICE_HPP_
gko::nvidia_device
nvidia_device handles the number of executor on Nvidia devices and have the corresponding recursive_m...
Definition: device.hpp:30
gko::HipExecutor
This is the Executor subclass which represents the HIP enhanced device.
Definition: executor.hpp:1701
gko::CudaExecutor
This is the Executor subclass which represents the CUDA device.
Definition: executor.hpp:1483
gko
The Ginkgo namespace.
Definition: abstract_factory.hpp:20
gko::amd_device
amd_device handles the number of executor on Amd devices and have the corresponding recursive_mutex.
Definition: device.hpp:61