mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-09 22:43:00 +08:00
[33/n] Internal 4GB allocator.
- Move indirect heap to internal allocator domain. - Add logic in getIndirectHeap to allocate with proper API depending on heap type - Add State base Address programming, reflecting that now Indirect Object Heap is placed in 4GB domain. - For AddPatchInfoCommentsForAUBDump mode , keep all heaps in non 4GB mode. Change-Id: I6862f6a249e444d0d6cfe7e499a10d43f284553e
This commit is contained in:
committed by
sys_ocldev
parent
81362d5b7d
commit
d900bdffc6
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Intel Corporation
|
||||
* Copyright (c) 2017 - 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -25,15 +25,16 @@
|
||||
|
||||
namespace OCLRT {
|
||||
|
||||
class IndirectHeap;
|
||||
class LinearStream;
|
||||
|
||||
template <typename GfxFamily>
|
||||
struct StateBaseAddressHelper {
|
||||
static void programStateBaseAddress(
|
||||
LinearStream &commandStream,
|
||||
const LinearStream &dsh,
|
||||
const LinearStream &ioh,
|
||||
const LinearStream &ssh,
|
||||
const IndirectHeap &dsh,
|
||||
const IndirectHeap &ioh,
|
||||
const IndirectHeap &ssh,
|
||||
uint64_t generalStateBase,
|
||||
uint32_t statelessMocsIndex,
|
||||
uint64_t internalHeapBase);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Intel Corporation
|
||||
* Copyright (c) 2017 - 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
#include "hw_cmds.h"
|
||||
#include "runtime/command_stream/linear_stream.h"
|
||||
#include "runtime/indirect_heap/indirect_heap.h"
|
||||
#include "runtime/helpers/cache_policy.h"
|
||||
#include "runtime/gmm_helper/gmm_helper.h"
|
||||
#include "runtime/memory_manager/memory_constants.h"
|
||||
@@ -30,9 +30,9 @@ namespace OCLRT {
|
||||
template <typename GfxFamily>
|
||||
void StateBaseAddressHelper<GfxFamily>::programStateBaseAddress(
|
||||
LinearStream &commandStream,
|
||||
const LinearStream &dsh,
|
||||
const LinearStream &ioh,
|
||||
const LinearStream &ssh,
|
||||
const IndirectHeap &dsh,
|
||||
const IndirectHeap &ioh,
|
||||
const IndirectHeap &ssh,
|
||||
uint64_t generalStateBase,
|
||||
uint32_t statelessMocsIndex,
|
||||
uint64_t internalHeapBase) {
|
||||
@@ -51,7 +51,6 @@ void StateBaseAddressHelper<GfxFamily>::programStateBaseAddress(
|
||||
// GSH must be set to 0 for stateless
|
||||
pCmd->setGeneralStateBaseAddress(generalStateBase);
|
||||
pCmd->setSurfaceStateBaseAddress(reinterpret_cast<uintptr_t>(ssh.getCpuBase()));
|
||||
pCmd->setIndirectObjectBaseAddress(reinterpret_cast<uintptr_t>(ioh.getCpuBase()));
|
||||
pCmd->setInstructionBaseAddress(internalHeapBase);
|
||||
|
||||
pCmd->setDynamicStateBufferSizeModifyEnable(true);
|
||||
@@ -61,7 +60,9 @@ void StateBaseAddressHelper<GfxFamily>::programStateBaseAddress(
|
||||
|
||||
pCmd->setDynamicStateBufferSize(static_cast<uint32_t>((dsh.getMaxAvailableSpace() + MemoryConstants::pageMask) / MemoryConstants::pageSize));
|
||||
pCmd->setGeneralStateBufferSize(static_cast<uint32_t>(-1));
|
||||
pCmd->setIndirectObjectBufferSize(static_cast<uint32_t>((ioh.getMaxAvailableSpace() + MemoryConstants::pageMask) / MemoryConstants::pageSize));
|
||||
|
||||
pCmd->setIndirectObjectBaseAddress(ioh.getHeapGpuBase());
|
||||
pCmd->setIndirectObjectBufferSize(ioh.getHeapSizeInPages());
|
||||
|
||||
pCmd->setInstructionBufferSize(MemoryConstants::sizeOf4GBinPageEntities);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user