ttg
1.0.0
Template Task Graph (TTG): flowgraph-based programming model for high-performance distributed-memory algorithms
Loading...
Searching...
No Matches
ttg
ttg
parsec
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
8
namespace
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
19
int
ttg_device_to_parsec_device
(
const
ttg::device::Device
& device) {
20
if
(device.
is_host
()) {
21
return
0;
22
}
else
{
23
return
device.
id
() +
first_device_id
;
24
}
25
}
26
30
inline
31
ttg::device::Device
parsec_device_to_ttg_device
(
int
parsec_id) {
32
if
(parsec_id <
first_device_id
) {
33
return
ttg::device::Device
(parsec_id,
ttg::ExecutionSpace::Host
);
34
}
35
return
ttg::device::Device
(parsec_id -
first_device_id
,
36
ttg::device::available_execution_space
);
37
}
38
}
// namespace detail
39
40
41
inline
42
int
num_devices
() {
43
return
parsec_nb_devices -
detail::first_device_id
;
44
}
45
46
}
// namespace ttg_parsec
47
48
#endif
// TTG_PARSEC_DEVICE_H
ttg::device::Device
Represents a device in a specific execution space.
Definition
device.h:19
ttg::device::Device::is_host
bool is_host() const
Definition
device.h:56
ttg::device::Device::id
int id() const
Definition
device.h:34
device.h
ttg::device::available_execution_space
constexpr ttg::ExecutionSpace available_execution_space
Definition
device.h:133
ttg_parsec::detail::parsec_device_to_ttg_device
ttg::device::Device parsec_device_to_ttg_device(int parsec_id)
Definition
device.h:31
ttg_parsec::detail::first_device_id
int first_device_id
Definition
device.h:13
ttg_parsec::detail::ttg_device_to_parsec_device
int ttg_device_to_parsec_device(const ttg::device::Device &device)
Definition
device.h:19
ttg_parsec
this contains PaRSEC-based TTG functionality
Definition
fwd.h:19
ttg_parsec::num_devices
int num_devices()
Definition
device.h:42
ttg::ExecutionSpace::Host
@ Host
Generated at Mon Nov 24 2025 13:41:21 for
ttg
1.0.0 by
1.9.8