-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDataTypes.h
More file actions
35 lines (24 loc) · 894 Bytes
/
DataTypes.h
File metadata and controls
35 lines (24 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// SPDX-FileCopyrightText: 2020 SeisSol Group
//
// SPDX-License-Identifier: BSD-3-Clause
#ifndef SEISSOLDEVICE_DATATYPES_H_
#define SEISSOLDEVICE_DATATYPES_H_
#include <cstddef>
#include <limits>
namespace device {
struct DeviceGraphHandle {
static const size_t invalidId{std::numeric_limits<size_t>::max()};
public:
explicit DeviceGraphHandle() : graphId(invalidId) {}
explicit DeviceGraphHandle(size_t id) : graphId(id) {}
DeviceGraphHandle(const DeviceGraphHandle& other) = default;
DeviceGraphHandle& operator=(const DeviceGraphHandle& other) = default;
bool isInitialized() const { return graphId != invalidId; }
operator bool() const { return isInitialized(); }
bool operator!() const { return !isInitialized(); }
size_t getGraphId() { return graphId; }
private:
size_t graphId{invalidId};
};
} // namespace device
#endif // SEISSOLDEVICE_DATATYPES_H_