P4 to Git Change 1491909 by gandryey@gera-w8 on 2017/12/07 16:33:58
SWDEV-79445 - OCL generic changes and code clean-up - Add device validation call for LiquidFlash library before usage. Affected files ... ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_lqdflash_amd.cpp#23 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#294 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/pro/prodevice.hpp#4 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/pro/prodriver.hpp#2 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#77 edit
Tá an tiomantas seo le fáil i:
@@ -112,6 +112,28 @@ bool LiquidFlashFile::transferBlock(bool writeBuffer, void* srcDst, uint64_t buf
|
||||
RUNTIME_ENTRY_RET(cl_file_amd, clCreateSsgFileObjectAMD,
|
||||
(cl_context context, cl_file_flags_amd flags, const wchar_t* file_name,
|
||||
cl_int* errcode_ret)) {
|
||||
#if defined WITH_LIQUID_FLASH && defined ATI_OS_LINUX
|
||||
if (!is_valid(context)) {
|
||||
*not_null(errcode_ret) = CL_INVALID_CONTEXT;
|
||||
LogWarning("invalid parameter \"context\"");
|
||||
return (cl_file_amd)0;
|
||||
}
|
||||
|
||||
const std::vector<amd::Device*>& devices = as_amd(context)->devices();
|
||||
bool supportPass = false;
|
||||
for (auto& dev : devices) {
|
||||
if (lf_success == lfCheckExtensionSupportForDevice(dev->info().pcieDeviceId_,
|
||||
dev->info().pcieRevisionId_)) {
|
||||
supportPass = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!supportPass) {
|
||||
*not_null(errcode_ret) = CL_INVALID_DEVICE;
|
||||
LogWarning("SSG isn't supported");
|
||||
return (cl_file_amd)0;
|
||||
}
|
||||
#endif
|
||||
amd::LiquidFlashFile* file = new amd::LiquidFlashFile(file_name, flags);
|
||||
|
||||
if (file == NULL) {
|
||||
|
||||
Tagairt in Eagrán Nua
Cuir bac ar úsáideoir