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_; };