SWDEV-374363 - hipImportExternalMemory/Semaphore should return error
when the Memory/Semaphore handle desc type is invalid Change-Id: If122b05d87cc65974a797da69c134e2ac264d1db
Este commit está contenido en:
cometido por
Maneesh Gupta
padre
0b4f845475
commit
1ed823a477
@@ -109,6 +109,11 @@ hipError_t hipImportExternalMemory(
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
|
||||
if ((memHandleDesc->type < hipExternalMemoryHandleTypeOpaqueFd) ||
|
||||
(memHandleDesc->type > hipExternalMemoryHandleTypeD3D11ResourceKmt)) {
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
|
||||
size_t sizeBytes = memHandleDesc->size;
|
||||
amd::Context& amdContext = *hip::getCurrentDevice()->asContext();
|
||||
|
||||
@@ -173,6 +178,12 @@ hipError_t hipImportExternalSemaphore(hipExternalSemaphore_t* extSem_out,
|
||||
if (extSem_out == nullptr || semHandleDesc == nullptr) {
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
|
||||
if ((semHandleDesc->type < hipExternalSemaphoreHandleTypeOpaqueFd) ||
|
||||
(semHandleDesc->type > hipExternalSemaphoreHandleTypeD3D12Fence)) {
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
|
||||
amd::Device* device = hip::getCurrentDevice()->devices()[0];
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
Referencia en una nueva incidencia
Block a user