Pleora Technologies Inc. eBUS SDK v7.0.1.7536 API



PvCudaBuffer.h
1 // *****************************************************************************
2 //
3 // Copyright (c) 2025, Pleora Technologies Inc., All rights reserved.
4 //
5 // *****************************************************************************
6 
7 #ifndef __PVCUDABUFFER_H__
8 #define __PVCUDABUFFER_H__
9 
10 #include <PvBufferLib.h>
11 #include <PvPayloadType.h>
12 #include <PvPixelType.h>
13 
14 namespace PvBufferLib
15 {
16 class CudaBuffer;
17 class Buffer;
18 } // namespace PvBufferLib
19 
20 enum class PvCudaMemorySpaceType
21 {
22  PvCudaHost,
23  PvCudaDevice,
24  PvCudaUVM
25 };
26 
27 class PvCudaBuffer;
28 class PvBuffer;
29 
43 class PV_BUFFER_API PvCudaBuffer
44 {
45 public:
52 
56  virtual ~PvCudaBuffer();
57 
64  PvPayloadType GetPayloadType() const;
65 
73  PvCudaMemorySpaceType GetMemorySpaceType() const;
74 
85  const uint8_t* GetDataPointer() const;
86 
92  uint8_t* GetDataPointer();
93 
99  PvPixelType GetPixelType() const;
100 
106  uint32_t GetSize() const;
107 
119  PvResult AllocCudaHost( uint32_t aSize, PvPixelType aPixelType );
120 
132  PvResult AllocCudaDevice( uint32_t aSize, PvPixelType aPixelType );
133 
145  PvResult AllocCudaUVM( uint32_t aSize, PvPixelType aPixelType );
146 
152  bool IsAllocated() const;
153 
158  void Free();
159 
165  PvResult Reallocate( uint32_t aSize );
166 
170  PvResult CopyFrom( const PvBuffer* aSrcPvBuffer, unsigned int aSize );
171 
175  PvResult CopyTo( PvBuffer* aDstPvBuffer, unsigned int aSize );
176 
180  PvResult CopyFrom( const PvCudaBuffer* aSrcPvCudaBuffer, unsigned int aSize );
181 
185  PvResult CopyTo( PvCudaBuffer* aDstPvCudaBuffer, unsigned int aSize );
186 
187 
188 private:
189  // Not implemented
190  PvCudaBuffer( const PvCudaBuffer& );
191  const PvCudaBuffer& operator=( const PvCudaBuffer& );
192 
193  friend class PvCudaBufferConverter;
194 
195  PvBufferLib::CudaBuffer* mThis;
196 };
197 
198 
199 #endif
PvResult
Result information.
Definition: PvResult.h:29
PvPayloadType.h
GVSP payload type constants.
PvCudaBuffer
Represents a block of Cuda data in memory either on host, device side or both if using UVM.
Definition: PvCudaBuffer.h:43
PvPayloadType
PvPayloadType
GVSP payload type.
Definition: PvPayloadType.h:19
PvPayloadTypeImage
@ PvPayloadTypeImage
Image payload type. Access from PvBuffer using PvBuffer::GetImage.
Definition: PvPayloadType.h:27
PvPixelType.h
PvPixelType
PvPixelType
Definition: PvPixelType.h:50
PvBuffer
Represents a block of GigE Vision or USB3 Vision data in memory.
Definition: PvBuffer.h:110
PvCudaBufferConverter
Used to convert a PvBuffer to another pixel type.
Definition: PvCudaBufferConverter.h:67

Copyright (c) 2002-2026 Pleora Technologies Inc.
www.pleora.com