Add missing check during ocl buffer create on Windows

resolves problem with debug break
Signed-off-by: Katarzyna Cencelewska <katarzyna.cencelewska@intel.com>
This commit is contained in:
Katarzyna Cencelewska
2022-12-14 11:27:22 +00:00
committed by Compute-Runtime-Automation
parent f629b403c8
commit cf6d706d4b
9 changed files with 210 additions and 4 deletions

View File

@@ -182,10 +182,18 @@ bool inline copyHostPointer(Buffer *buffer,
auto &device = context->getDevice(0u)->getDevice();
auto &hwInfo = device.getHardwareInfo();
auto productHelper = ProductHelper::get(hwInfo.platform.eProductFamily);
auto &osInterface = device.getRootDeviceEnvironment().osInterface;
bool isLockable = true;
if (osInterface) {
isLockable = osInterface->isLockablePointer(memory->storageInfo.isLockable);
}
bool copyOnCpuAllowed = implicitScalingEnabled == false &&
size <= Buffer::maxBufferSizeForCopyOnCpu &&
isCompressionEnabled == false &&
productHelper->getLocalMemoryAccessMode(hwInfo) != LocalMemoryAccessMode::CpuAccessDisallowed;
productHelper->getLocalMemoryAccessMode(hwInfo) != LocalMemoryAccessMode::CpuAccessDisallowed &&
isLockable;
if (DebugManager.flags.CopyHostPtrOnCpu.get() != -1) {
copyOnCpuAllowed = DebugManager.flags.CopyHostPtrOnCpu.get() == 1;
}