MCPcopy Create free account
hub / github.com/ROCm/clr / hipExternalMemoryGetMappedMipmappedArray

Function hipExternalMemoryGetMappedMipmappedArray

hipamd/src/hip_memory.cpp:4363–4387  ·  view source on GitHub ↗

================================================================================================

Source from the content-addressed store, hash-verified

4361}
4362// ================================================================================================
4363hipError_t hipExternalMemoryGetMappedMipmappedArray(
4364 hipMipmappedArray_t* mipmap, hipExternalMemory_t extMem,
4365 const hipExternalMemoryMipmappedArrayDesc* mipmapDesc) {
4366 HIP_INIT_API(hipExternalMemoryGetMappedMipmappedArray, mipmap, extMem, mipmapDesc);
4367 if (mipmap == nullptr || extMem == nullptr || mipmapDesc == nullptr) {
4368 HIP_RETURN(hipErrorInvalidValue);
4369 }
4370 CHECK_STREAM_CAPTURE_SUPPORTED();
4371
4372 auto buf = reinterpret_cast<amd::ExternalBuffer*>(extMem);
4373 const device::Memory* devMem = buf->getDeviceMemory(*hip::getCurrentDevice()->devices()[0]);
4374
4375 HIP_ARRAY3D_DESCRIPTOR allocateArray = {mipmapDesc->extent.width,
4376 mipmapDesc->extent.height,
4377 mipmapDesc->extent.depth,
4378 hip::getArrayFormat(mipmapDesc->formatDesc),
4379 hip::getNumChannels(mipmapDesc->formatDesc),
4380 mipmapDesc->flags};
4381 if (!hip::CheckArrayFormat(mipmapDesc->formatDesc)) {
4382 HIP_RETURN(hipErrorInvalidValue);
4383 }
4384
4385 HIP_RETURN(ihipMipmapArrayCreate(mipmap, &allocateArray, mipmapDesc->numLevels,
4386 (size_t)mipmapDesc->offset, buf));
4387}
4388
4389hipError_t hipMemGetHandleForAddressRange(void* handle, hipDeviceptr_t dptr, size_t size,
4390 hipMemRangeHandleType handleType,

Callers

nothing calls this directly

Calls 6

getCurrentDeviceFunction · 0.85
getArrayFormatFunction · 0.85
getNumChannelsFunction · 0.85
CheckArrayFormatFunction · 0.85
ihipMipmapArrayCreateFunction · 0.85
getDeviceMemoryMethod · 0.45

Tested by

no test coverage detected