MCPcopy Create free account
hub / github.com/RenderKit/oidn / init

Method init

devices/cuda/cuda_external_buffer.cpp:75–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73 }
74
75 void CUDAExternalBuffer::init(const cudaExternalMemoryHandleDesc& handleDesc)
76 {
77 checkError(cudaImportExternalMemory(&extMem, &handleDesc));
78
79 void* devPtr = nullptr;
80 cudaExternalMemoryBufferDesc bufferDesc{};
81 bufferDesc.offset = 0;
82 bufferDesc.size = handleDesc.size;
83 bufferDesc.flags = 0;
84 checkError(cudaExternalMemoryGetMappedBuffer(&devPtr, extMem, &bufferDesc));
85
86 ptr = static_cast<char*>(devPtr);
87 byteSize = handleDesc.size;
88 shared = true;
89 storage = Storage::Device;
90 }
91
92 CUDAExternalBuffer::~CUDAExternalBuffer()
93 {

Callers

nothing calls this directly

Calls 3

cudaImportExternalMemoryFunction · 0.85
checkErrorFunction · 0.70

Tested by

no test coverage detected