From 4e34dcb096fd4d0a19cb555d1640979a04c4460a Mon Sep 17 00:00:00 2001 From: foreman Date: Wed, 13 Aug 2014 12:33:36 -0400 Subject: [PATCH] P4 to Git Change 1065860 by gandryey@gera-dev-w7 on 2014/08/13 12:07:54 ECR #304775 - Device enqueuing - add scratch view detection for the address range with 32bit ISA Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuresource.cpp#190 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuresource.hpp#75 edit --- rocclr/runtime/device/gpu/gpuresource.cpp | 6 +++++- rocclr/runtime/device/gpu/gpuresource.hpp | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/rocclr/runtime/device/gpu/gpuresource.cpp b/rocclr/runtime/device/gpu/gpuresource.cpp index ad30cf6862..9ae11fba57 100644 --- a/rocclr/runtime/device/gpu/gpuresource.cpp +++ b/rocclr/runtime/device/gpu/gpuresource.cpp @@ -86,6 +86,7 @@ Resource::Resource( cal_.imageArray_ = false; cal_.imageType_ = 0; cal_.SVMRes_ = false; + cal_.scratch_ = false; } Resource::Resource( @@ -127,6 +128,7 @@ Resource::Resource( cal_.imageArray_ = false; cal_.imageType_ = imageType; cal_.SVMRes_ = false; + cal_.scratch_ = false; switch (imageType) { case CL_MEM_OBJECT_IMAGE2D: @@ -366,6 +368,7 @@ Resource::create(MemoryType memType, CreateParams* params, bool heap) cal_.type_ = memType; if (memType == Scratch) { cal_.type_ = Local; + cal_.scratch_ = true; } // Force remote allocation if it was requested in the settings @@ -937,7 +940,8 @@ Resource::create(MemoryType memType, CreateParams* params, bool heap) } hbSize_ = static_cast(gslResource->getSurfaceSize()); - if (!dev().settings().use64BitPtr_ && (memType != Scratch)) { + if (!dev().settings().use64BitPtr_ && + !((memType == Scratch) || ((memType == View) && viewOwner_->cal()->scratch_))) { // Make sure runtime doesn't go over the address space limit for buffers if ((memoryType() != Heap) && (cal()->dimension_ == GSL_MOA_BUFFER) && diff --git a/rocclr/runtime/device/gpu/gpuresource.hpp b/rocclr/runtime/device/gpu/gpuresource.hpp index 62024fb5d2..c7dcc635cf 100644 --- a/rocclr/runtime/device/gpu/gpuresource.hpp +++ b/rocclr/runtime/device/gpu/gpuresource.hpp @@ -172,6 +172,7 @@ public: uint buffer_ : 1; //!< GSL resource is a buffer uint tiled_ : 1; //!< GSL resource is tiled uint SVMRes_ : 1; //!< SVM flag to the cal resource + uint scratch_ : 1; //!< Scratch buffer }; uint state_; };