SWDEV-403768 - Check mem type is managed and result mem addresses are not null.
Change-Id: Ib40c468a981e0dd42b2da65aeb7543b11af4bc90
This commit is contained in:
committed by
Jaydeepkumar Patel
parent
0a20da39cd
commit
a6e72de83d
@@ -196,6 +196,24 @@ hipError_t hipMemRangeGetAttributes(void** data, size_t* data_sizes,
|
|||||||
HIP_RETURN(hipErrorInvalidValue);
|
HIP_RETURN(hipErrorInvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (*data_sizes > 0) {
|
||||||
|
for (int i = 0 ; i<*data_sizes ; i++) {
|
||||||
|
if (!data[i]) {
|
||||||
|
HIP_RETURN(hipErrorInvalidValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t offset = 0;
|
||||||
|
amd::Memory* memObj = getMemoryObject(dev_ptr, offset);
|
||||||
|
if (memObj) {
|
||||||
|
if (!(memObj->getMemFlags() & (CL_MEM_SVM_FINE_GRAIN_BUFFER | CL_MEM_ALLOC_HOST_PTR))) {
|
||||||
|
HIP_RETURN(hipErrorInvalidValue);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
HIP_RETURN(hipErrorInvalidValue);
|
||||||
|
}
|
||||||
|
|
||||||
// Shouldn't matter for which device the interface is called
|
// Shouldn't matter for which device the interface is called
|
||||||
amd::Device* dev = g_devices[0]->devices()[0];
|
amd::Device* dev = g_devices[0]->devices()[0];
|
||||||
// Get the allocation attributes from AMD HMM
|
// Get the allocation attributes from AMD HMM
|
||||||
|
|||||||
Reference in New Issue
Block a user