mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-14 07:45:06 +00:00
nvidia/cuda: Add functions to get device name, UUId and LUId
This commit is contained in:
parent
b4c7d5f91c
commit
1a5dad8d97
2 changed files with 31 additions and 1 deletions
|
@ -114,7 +114,9 @@ streamfx::nvidia::cuda::cuda::cuda() : _library()
|
||||||
|
|
||||||
{ // 3. Load remaining functions.
|
{ // 3. Load remaining functions.
|
||||||
// Device Management
|
// Device Management
|
||||||
// - Not yet needed.
|
P_CUDA_LOAD_SYMBOL(cuDeviceGetName);
|
||||||
|
P_CUDA_LOAD_SYMBOL(cuDeviceGetLuid);
|
||||||
|
P_CUDA_LOAD_SYMBOL(cuDeviceGetUuid);
|
||||||
|
|
||||||
// Primary Context Management
|
// Primary Context Management
|
||||||
P_CUDA_LOAD_SYMBOL(cuDevicePrimaryCtxRetain);
|
P_CUDA_LOAD_SYMBOL(cuDevicePrimaryCtxRetain);
|
||||||
|
|
|
@ -162,6 +162,31 @@ namespace streamfx::nvidia::cuda {
|
||||||
uint32_t reserved[16];
|
uint32_t reserved[16];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct uuid_t {
|
||||||
|
union {
|
||||||
|
char bytes[16];
|
||||||
|
struct {
|
||||||
|
uint32_t a;
|
||||||
|
uint16_t b;
|
||||||
|
uint16_t c;
|
||||||
|
uint16_t d;
|
||||||
|
uint16_t e;
|
||||||
|
uint32_t f;
|
||||||
|
} uuid;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
struct luid_t {
|
||||||
|
union {
|
||||||
|
char bytes[8];
|
||||||
|
struct {
|
||||||
|
uint32_t low;
|
||||||
|
int32_t high;
|
||||||
|
} parts;
|
||||||
|
uint64_t luid;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
class cuda_error : public std::exception {
|
class cuda_error : public std::exception {
|
||||||
::streamfx::nvidia::cuda::result _code;
|
::streamfx::nvidia::cuda::result _code;
|
||||||
|
|
||||||
|
@ -192,6 +217,9 @@ namespace streamfx::nvidia::cuda {
|
||||||
P_CUDA_DEFINE_FUNCTION(cuDriverGetVersion, int32_t* driverVersion);
|
P_CUDA_DEFINE_FUNCTION(cuDriverGetVersion, int32_t* driverVersion);
|
||||||
|
|
||||||
// Device Management
|
// Device Management
|
||||||
|
P_CUDA_DEFINE_FUNCTION(cuDeviceGetName, char* name, int32_t length, device_t device);
|
||||||
|
P_CUDA_DEFINE_FUNCTION(cuDeviceGetLuid, luid_t* luid, uint32_t* device_node_mask, device_t device);
|
||||||
|
P_CUDA_DEFINE_FUNCTION(cuDeviceGetUuid, uuid_t* uuid, device_t device);
|
||||||
// - Not yet needed.
|
// - Not yet needed.
|
||||||
|
|
||||||
// Primary Context Management
|
// Primary Context Management
|
||||||
|
|
Loading…
Reference in a new issue