P4 to Git Change 1140158 by gandryey@gera-w8 on 2015/04/13 14:47:04
ECR #304775 - Add capability to provide just free memory for CL_DEVICE_GLOBAL_FREE_MEMORY_AMD
- if the app provided space just for one value, then return total free memory only
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_device.cpp#57 edit
[ROCm/clr commit: 8fabccae76]
Этот коммит содержится в:
@@ -615,13 +615,20 @@ RUNTIME_ENTRY(cl_int, clGetDeviceInfo, (
|
||||
if (as_amd(device)->type() == CL_DEVICE_TYPE_GPU) {
|
||||
switch (param_name) {
|
||||
case CL_DEVICE_GLOBAL_FREE_MEMORY_AMD: {
|
||||
// Free memory should contain 2 values:
|
||||
// total free memory and the biggest free block
|
||||
size_t freeMemory[2];
|
||||
if (as_amd(device)->globalFreeMemory(freeMemory)) {
|
||||
if (!as_amd(device)->globalFreeMemory(freeMemory)) {
|
||||
return CL_INVALID_DEVICE;
|
||||
}
|
||||
if (param_value_size < sizeof(freeMemory)) {
|
||||
// Return just total free memory if the app provided space for one value
|
||||
return amd::clGetInfo(
|
||||
freeMemory, param_value_size, param_value, param_value_size_ret);
|
||||
freeMemory[0], param_value_size, param_value, param_value_size_ret);
|
||||
}
|
||||
else {
|
||||
return CL_INVALID_DEVICE;
|
||||
return amd::clGetInfo(
|
||||
freeMemory, param_value_size, param_value, param_value_size_ret);
|
||||
}
|
||||
}
|
||||
CASE(CL_DEVICE_SIMD_PER_COMPUTE_UNIT_AMD, simdPerCU_);
|
||||
|
||||
Ссылка в новой задаче
Block a user