26 #ifndef NVNEURAL_CUDATYPES_H
27 #define NVNEURAL_CUDATYPES_H
34 class INetworkBackendCuda;
36 #define NVNEURAL_INETWORKBACKENDCUDA_OBJECTCLASS "com.nvidia.backendcuda"
38 #define NVNEURAL_ICUDAMEMORYALLOCATOR_OBJECTCLASS "com.nvidia.memoryallocatorcuda"
152 std::size_t gridSizeX,
153 std::size_t gridSizeY,
154 std::size_t gridSizeZ,
155 std::size_t blockSizeX,
156 std::size_t blockSizeY,
157 std::size_t blockSizeZ,
159 std::uint32_t smem)
const noexcept = 0;
165 virtual CUmodule
module() const noexcept = 0;
171 virtual CUfunction function() const noexcept = 0;
177 virtual std::
size_t compiledBinarySize() const noexcept = 0;
183 virtual const
void* compiledBinary() const noexcept = 0;
200 const char* pModuleName =
nullptr;
202 const char* pModuleSource =
nullptr;
204 const char* pModuleEntryPoint =
nullptr;
238 virtual
NeuralResult setTargetArchitecture(const
char* pTargetArch) noexcept = 0;
281 virtual CUcontext getCudaContext() const noexcept = 0;
284 virtual CUdevice getCudaDevice() const noexcept = 0;
290 virtual CUstream getCudaStream() const noexcept = 0;
Fundamental NvNeural data types are declared here.
MemorySemantic
Describes the intended purpose of allocated GPU memory.
Definition: CoreTypes.h:629
MemoryHandle__type * MemoryHandle
Opaque typedef used to represent INetworkBackend memory handles.
Definition: CoreTypes.h:624
NeuralResult
NeuralResult is a generic success/failure result type similar to COM HRESULT.
Definition: CoreTypes.h:273
Represents a runtime-compiled function object from ICudaRuntimeCompiler.
Definition: CudaTypes.h:132
virtual CUmodule module() const noexcept=0
Returns the CUmodule containing this function object.
virtual NeuralResult launch(INetworkBackendCuda *pBackend, std::size_t gridSizeX, std::size_t gridSizeY, std::size_t gridSizeZ, std::size_t blockSizeX, std::size_t blockSizeY, std::size_t blockSizeZ, void **ppArguments, std::uint32_t smem) const noexcept=0
Launches the function on the specified CUDA backend's stream.
Generic interface for CUDA device memory allocation.
Definition: CudaTypes.h:52
static const IRefObject::TypeId typeID
Interface TypeId for InterfaceOf purposes.
Definition: CudaTypes.h:55
virtual NeuralResult unlockMemoryBlock(MemoryHandle handle) noexcept=0
Removes a lock from a preexisting memory block.
virtual std::size_t getSizeForMemoryBlock(MemoryHandle handle) const noexcept=0
Returns the buffer size associated with a memory handle.
virtual NeuralResult compactMemory() noexcept=0
Signals the allocator to release unused memory blocks back to the system.
virtual void * getAddressForMemoryBlock(MemoryHandle handle) const noexcept=0
Converts a memory handle to a GPU virtual address.
virtual NeuralResult lockMemoryBlock(MemoryHandle handle) noexcept=0
Adds a lock to a preexisting memory block.
virtual NeuralResult freeMemoryBlock(MemoryHandle handle) noexcept=0
Frees a memory block.
virtual NeuralResult allocateMemoryBlock(MemoryHandle *pHandleOut, std::size_t byteCount, MemorySemantic semantic) noexcept=0
Allocates a new memory block and returns a handle to it.
Represents a runtime compiler that can transform CUDA source code into compiled functions.
Definition: CudaTypes.h:191
virtual const char * targetArchitecture() const noexcept=0
Returns the current target GPU architecture for compilation.
INetworkBackend companion interface with CUDA-specific functionality.
Definition: CudaTypes.h:267
virtual ICudaMemoryAllocator * getAllocator() const noexcept=0
Returns the CUDA memory allocator interface.
Base class for all objects, similar to COM's IUnknown.
Definition: CoreTypes.h:341
std::uint64_t TypeId
Every interface must define a unique TypeId. This should be randomized.
Definition: CoreTypes.h:347
IStringList represents an immutable collection of strings.
Definition: CoreTypes.h:946
Params struct describing a compilation request.
Definition: CudaTypes.h:198