libpromeki 1.0.0-alpha
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
cuda.h
Go to the documentation of this file.
1
8#pragma once
9
10
11#if PROMEKI_ENABLE_CORE
12#include <promeki/namespace.h>
13#include <promeki/config.h>
14#include <promeki/string.h>
15#include <promeki/error.h>
16
17PROMEKI_NAMESPACE_BEGIN
18
53class CudaDevice {
54 public:
56 CudaDevice() = default;
57
65 explicit CudaDevice(int ordinal);
66
68 static bool isAvailable();
69
74 static int deviceCount();
75
81 static CudaDevice current();
82
96 static Error setCurrent(int ordinal);
97
99 bool isValid() const { return _ordinal >= 0; }
100
102 int ordinal() const { return _ordinal; }
103
105 const String &name() const { return _name; }
106
108 size_t totalMemory() const { return _totalMem; }
109
111 int computeMajor() const { return _ccMajor; }
112
114 int computeMinor() const { return _ccMinor; }
115
116 private:
117 int _ordinal = -1;
118 String _name;
119 size_t _totalMem = 0;
120 int _ccMajor = 0;
121 int _ccMinor = 0;
122};
123
138class CudaBootstrap {
139 public:
150 static Error ensureRegistered();
151
160 static bool isRegistered();
161};
162
165PROMEKI_NAMESPACE_END
166
167#endif // PROMEKI_ENABLE_CORE