SWDEV-333581 - Pass free and/or total size_t as nullptr.
Change-Id: Ib83467a351b6df22ef641c0e82284c7e0fac32e3
[ROCm/clr commit: a527c241a2]
This commit is contained in:
کامیت شده توسط
Jaydeepkumar Patel
والد
57a0d997d3
کامیت
33a50636e9
@@ -661,18 +661,27 @@ hipError_t hipMemGetAddressRange(hipDeviceptr_t* pbase, size_t* psize, hipDevice
|
||||
hipError_t hipMemGetInfo(size_t* free, size_t* total) {
|
||||
HIP_INIT_API(hipMemGetInfo, free, total);
|
||||
|
||||
size_t freeMemory[2];
|
||||
amd::Device* device = hip::getCurrentDevice()->devices()[0];
|
||||
if(device == nullptr) {
|
||||
HIP_RETURN(hipErrorInvalidDevice);
|
||||
}
|
||||
|
||||
if(!device->globalFreeMemory(freeMemory)) {
|
||||
if (free == nullptr && total == nullptr) {
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
|
||||
*free = freeMemory[0] * Ki;
|
||||
*total = device->info().globalMemSize_;
|
||||
size_t freeMemory[2];
|
||||
amd::Device* device = hip::getCurrentDevice()->devices()[0];
|
||||
if (device == nullptr) {
|
||||
HIP_RETURN(hipErrorInvalidDevice);
|
||||
}
|
||||
|
||||
if (!device->globalFreeMemory(freeMemory)) {
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
|
||||
if (free != nullptr) {
|
||||
*free = freeMemory[0] * Ki;
|
||||
}
|
||||
|
||||
if (total != nullptr) {
|
||||
*total = device->info().globalMemSize_;
|
||||
}
|
||||
|
||||
HIP_RETURN(hipSuccess);
|
||||
}
|
||||
|
||||
مرجع در شماره جدید
Block a user