diff --git a/projects/clr/rocclr/runtime/device/pal/paldevice.cpp b/projects/clr/rocclr/runtime/device/pal/paldevice.cpp index a03c69f90b..2b1f78a470 100644 --- a/projects/clr/rocclr/runtime/device/pal/paldevice.cpp +++ b/projects/clr/rocclr/runtime/device/pal/paldevice.cpp @@ -731,6 +731,8 @@ Device::create(Pal::IDevice* device) numDmaEngines_ = properties().engineProperties[Pal::EngineTypeDma].engineCount; + // Creates device settings + settings_ = new pal::Settings(); Pal::PalPublicSettings*const palSettings = iDev()->GetPublicSettings(); // Modify settings here // palSettings ... @@ -740,6 +742,7 @@ Device::create(Pal::IDevice* device) palSettings->cmdBufBatchedSubmitChainLimit = 0; palSettings->disableResourceProcessingManager = true; palSettings->disableScManager = true; + palSettings->numScratchWavesPerCu = settings().numScratchWavesPerCu_; // Commit the new settings for the device result = iDev()->CommitSettingsAndInit(); @@ -768,8 +771,6 @@ Device::create(Pal::IDevice* device) Pal::WorkStationCaps wscaps = {}; iDev()->QueryWorkStationCaps(&wscaps); - // Creates device settings - settings_ = new pal::Settings(); pal::Settings* gpuSettings = reinterpret_cast(settings_); if ((gpuSettings == nullptr) || !gpuSettings->create(properties(), heaps, wscaps, appProfile_.reportAsOCL12Device())) { @@ -1202,7 +1203,6 @@ Device::createBuffer( LogError("Can't get the owner object for subbuffer allocation"); return nullptr; } - return gpuParent->createBufferView(owner); } @@ -1838,7 +1838,7 @@ Device::allocScratch(uint regNum, const VirtualGPU* vgpu) // Calculate the size of the scratch buffer for a queue uint32_t numTotalCUs = info().maxComputeUnits_; uint32_t numMaxWaves = - properties().gfxipProperties.shaderCore.maxScratchWavesPerCu * numTotalCUs; + settings().numScratchWavesPerCu_* numTotalCUs; scratchBuf->size_ = static_cast(properties(). gfxipProperties.shaderCore.wavefrontSize) * scratchBuf->regNum_ * numMaxWaves * sizeof(uint32_t); diff --git a/projects/clr/rocclr/runtime/device/pal/palsettings.cpp b/projects/clr/rocclr/runtime/device/pal/palsettings.cpp index 7aa4080150..9a90c4f91e 100644 --- a/projects/clr/rocclr/runtime/device/pal/palsettings.cpp +++ b/projects/clr/rocclr/runtime/device/pal/palsettings.cpp @@ -124,6 +124,8 @@ Settings::Settings() numDeviceEvents_ = 1024; numWaitEvents_ = 8; + numScratchWavesPerCu_ = 16; + // Don't support platform atomics by default. svmAtomics_ = false; diff --git a/projects/clr/rocclr/runtime/device/pal/palsettings.hpp b/projects/clr/rocclr/runtime/device/pal/palsettings.hpp index c8e33b94fb..0f9f23e648 100644 --- a/projects/clr/rocclr/runtime/device/pal/palsettings.hpp +++ b/projects/clr/rocclr/runtime/device/pal/palsettings.hpp @@ -88,6 +88,7 @@ public: uint numDeviceEvents_; //!< The number of device events uint numWaitEvents_; //!< The number of wait events for device enqueue uint hostMemDirectAccess_; //!< Enables direct access to the host memory + uint numScratchWavesPerCu_; //!< Maximum number of waves when scratch is enabled size_t xferBufSize_; //!< Transfer buffer size for image copy optimization size_t stagedXferSize_; //!< Staged buffer size size_t pinnedXferSize_; //!< Pinned buffer size for transfer