ttg 1.0.0
Template Task Graph (TTG): flowgraph-based programming model for high-performance distributed-memory algorithms
Loading...
Searching...
No Matches
device.h
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-3-Clause
2#ifndef TTG_PARSEC_DEVICE_H
3#define TTG_PARSEC_DEVICE_H
4
5#include "ttg/device/device.h"
6#include <parsec/mca/device/device.h>
7
8namespace ttg_parsec {
9
10 namespace detail {
11
12 // the first ID of an accelerator in the parsec ID-space
13 inline int first_device_id = -1;
14
18 inline
20 if (device.is_host()) {
21 return 0;
22 } else {
23 return device.id() + first_device_id;
24 }
25 }
26
30 inline
38 } // namespace detail
39
40
41 inline
43 return parsec_nb_devices - detail::first_device_id;
44 }
45
46} // namespace ttg_parsec
47
48#endif // TTG_PARSEC_DEVICE_H
Represents a device in a specific execution space.
Definition device.h:19
bool is_host() const
Definition device.h:56
int id() const
Definition device.h:34
constexpr ttg::ExecutionSpace available_execution_space
Definition device.h:133
ttg::device::Device parsec_device_to_ttg_device(int parsec_id)
Definition device.h:31
int ttg_device_to_parsec_device(const ttg::device::Device &device)
Definition device.h:19
this contains PaRSEC-based TTG functionality
Definition fwd.h:19
int num_devices()
Definition device.h:42