P4 to Git Change 1789549 by vsytchen@vsytchen-remote-ocl-win10 on 2019/05/30 10:15:29

SWDEV-188631 - Allocating large buffers produce wrong kernel result on Windows

	1. Set a limit for USWC allocations to 2GB on Windows.
	2. Allocations larger than the specified limit will get placed into pinned memory instead.

	ReviewBoardURL = http://ocltc.amd.com/reviews/r/17407/diff/

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#138 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#310 edit


[ROCm/clr commit: 66cda9d97a]
This commit is contained in:
foreman
2019-05-30 10:28:59 -04:00
parent 384ae1469b
commit b04657c167
2 changed files with 5 additions and 1 deletions
@@ -1511,7 +1511,8 @@ pal::Memory* Device::createBuffer(amd::Memory& owner, bool directAccess) const {
(settings().remoteAlloc_)) {
// Allocate remote memory if AHP allocation and context has just 1 device
if ((owner.getMemFlags() & CL_MEM_ALLOC_HOST_PTR) &&
(owner.getContext().devices().size() == 1)) {
(owner.getContext().devices().size() == 1) &&
(owner.getSize() < static_cast<size_t>(GPU_MAX_USWC_ALLOC_SIZE) * Mi)) {
if (owner.getMemFlags() &
(CL_MEM_READ_ONLY | CL_MEM_HOST_WRITE_ONLY | CL_MEM_HOST_NO_ACCESS)) {
// GPU will be reading from this host memory buffer,
@@ -183,6 +183,9 @@ release(bool, GPU_ENABLE_WGP_MODE, true, \
"Enables WGP Mode in HW if available") \
release(bool, OCL_DUMP_CODE_OBJECT, false, \
"Enable dump code object") \
release(uint, GPU_MAX_USWC_ALLOC_SIZE, 2048, \
"Set a limit in Mb on the maximum USWC allocation size" \
"-1 = No limit")
namespace amd {