-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathCCUDASharedSemaphore.h
49 lines (37 loc) · 1.22 KB
/
CCUDASharedSemaphore.h
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright (C) 2018-2020 - DevSH Graphics Programming Sp. z O.O.
// This file is part of the "Nabla Engine".
// For conditions of distribution and use, see copyright notice in nabla.h
#ifndef _NBL_VIDEO_C_CUDA_SHARED_SEMAPHORE_H_
#define _NBL_VIDEO_C_CUDA_SHARED_SEMAPHORE_H_
#ifdef _NBL_COMPILE_WITH_CUDA_
#include "cuda.h"
#include "nvrtc.h"
#if CUDA_VERSION < 9000
#error "Need CUDA 9.0 SDK or higher."
#endif
// useful includes in the future
//#include "cudaEGL.h"
//#include "cudaVDPAU.h"
namespace nbl::video
{
class CCUDASharedSemaphore : public core::IReferenceCounted
{
public:
friend class CCUDADevice;
CUexternalSemaphore getInternalObject() const { return m_handle; }
protected:
CCUDASharedSemaphore(core::smart_refctd_ptr<CCUDADevice> device, core::smart_refctd_ptr<ISemaphore> src, CUexternalSemaphore semaphore, void* osHandle)
: m_device(std::move(device))
, m_src(std::move(m_src))
, m_handle(semaphore)
, m_osHandle(osHandle)
{}
~CCUDASharedSemaphore() override;
core::smart_refctd_ptr<CCUDADevice> m_device;
core::smart_refctd_ptr<ISemaphore> m_src;
CUexternalSemaphore m_handle;
void* m_osHandle;
};
}
#endif // _NBL_COMPILE_WITH_CUDA_
#endif