mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-20 13:11:34 +08:00
Pass os context to ScratchSpaceController::setRequiredScratchSpace
Related-To: NEO-3691 Change-Id: I3c040b9dd8e31dc798d70c7d0b12e2a89d22fa80 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:

committed by
sys_ocldev

parent
f18b3bb5f5
commit
f7f420b066
@ -228,7 +228,7 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
|
||||
requiredScratchSize,
|
||||
requiredPrivateScratchSize,
|
||||
this->taskCount,
|
||||
this->osContext->getContextId(),
|
||||
*this->osContext,
|
||||
stateBaseAddressDirty,
|
||||
checkVfeStateDirty);
|
||||
if (checkVfeStateDirty) {
|
||||
|
@ -19,6 +19,7 @@ class GraphicsAllocation;
|
||||
class InternalAllocationStorage;
|
||||
class MemoryManager;
|
||||
struct HardwareInfo;
|
||||
class OsContext;
|
||||
|
||||
namespace ScratchSpaceConstants {
|
||||
constexpr size_t scratchSpaceOffsetFor64Bit = 4096u;
|
||||
@ -39,7 +40,7 @@ class ScratchSpaceController {
|
||||
uint32_t requiredPerThreadScratchSize,
|
||||
uint32_t requiredPerThreadPrivateScratchSize,
|
||||
uint32_t currentTaskCount,
|
||||
uint32_t deviceIdx,
|
||||
OsContext &osContext,
|
||||
bool &stateBaseAddressDirty,
|
||||
bool &vfeStateDirty) = 0;
|
||||
virtual uint64_t calculateNewGSH() = 0;
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "runtime/memory_manager/graphics_allocation.h"
|
||||
#include "runtime/memory_manager/internal_allocation_storage.h"
|
||||
#include "runtime/memory_manager/memory_manager.h"
|
||||
#include "runtime/os_interface/os_context.h"
|
||||
|
||||
namespace NEO {
|
||||
ScratchSpaceControllerBase::ScratchSpaceControllerBase(ExecutionEnvironment &environment, InternalAllocationStorage &allocationStorage)
|
||||
@ -25,13 +26,13 @@ void ScratchSpaceControllerBase::setRequiredScratchSpace(void *sshBaseAddress,
|
||||
uint32_t requiredPerThreadScratchSize,
|
||||
uint32_t requiredPerThreadPrivateScratchSize,
|
||||
uint32_t currentTaskCount,
|
||||
uint32_t contextId,
|
||||
OsContext &osContext,
|
||||
bool &stateBaseAddressDirty,
|
||||
bool &vfeStateDirty) {
|
||||
size_t requiredScratchSizeInBytes = requiredPerThreadScratchSize * computeUnitsUsedForScratch;
|
||||
if (requiredScratchSizeInBytes && (!scratchAllocation || scratchSizeBytes < requiredScratchSizeInBytes)) {
|
||||
if (scratchAllocation) {
|
||||
scratchAllocation->updateTaskCount(currentTaskCount, contextId);
|
||||
scratchAllocation->updateTaskCount(currentTaskCount, osContext.getContextId());
|
||||
csrAllocationStorage.storeAllocation(std::unique_ptr<GraphicsAllocation>(scratchAllocation), TEMPORARY_ALLOCATION);
|
||||
}
|
||||
scratchSizeBytes = requiredScratchSizeInBytes;
|
||||
|
@ -18,7 +18,7 @@ class ScratchSpaceControllerBase : public ScratchSpaceController {
|
||||
uint32_t requiredPerThreadScratchSize,
|
||||
uint32_t requiredPerThreadPrivateScratchSize,
|
||||
uint32_t currentTaskCount,
|
||||
uint32_t contextId,
|
||||
OsContext &osContext,
|
||||
bool &stateBaseAddressDirty,
|
||||
bool &vfeStateDirty) override;
|
||||
uint64_t calculateNewGSH() override;
|
||||
|
Reference in New Issue
Block a user