Remove device index from command stream receiver

Change-Id: Ia84b0cb8e03260ec940ee0b175b12693e528b8aa
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2019-09-30 11:33:52 +02:00
committed by sys_ocldev
parent 99e4928743
commit 8410bd6e18
12 changed files with 22 additions and 24 deletions

View File

@@ -126,7 +126,7 @@ void CommandStreamReceiver::ensureCommandBufferAllocation(LinearStream &commandS
auto allocation = this->getInternalAllocationStorage()->obtainReusableAllocation(allocationSize, allocationType).release();
if (allocation == nullptr) {
const AllocationProperties commandStreamAllocationProperties{true, allocationSize, allocationType,
isMultiOsContextCapable(), getDeviceIndexForAllocation()};
isMultiOsContextCapable(), getDeviceIndex()};
allocation = this->getMemoryManager()->allocateGraphicsMemoryWithProperties(commandStreamAllocationProperties);
}
DEBUG_BREAK_IF(allocation == nullptr);
@@ -297,7 +297,7 @@ IndirectHeap &CommandStreamReceiver::getIndirectHeap(IndirectHeap::Type heapType
return *heap;
}
uint32_t CommandStreamReceiver::getDeviceIndexForAllocation() const {
uint32_t CommandStreamReceiver::getDeviceIndex() const {
return osContext->getDeviceBitfield().any() ? static_cast<uint32_t>(Math::log2(static_cast<uint32_t>(osContext->getDeviceBitfield().to_ulong()))) : 0u;
}
@@ -325,7 +325,7 @@ void CommandStreamReceiver::allocateHeapMemory(IndirectHeap::Type heapType,
if (!heapMemory) {
heapMemory = getMemoryManager()->allocateGraphicsMemoryWithProperties({true, finalHeapSize, allocationType,
isMultiOsContextCapable(), getDeviceIndexForAllocation()});
isMultiOsContextCapable(), getDeviceIndex()});
} else {
finalHeapSize = std::max(heapMemory->getUnderlyingBufferSize(), finalHeapSize);
}

View File

@@ -155,7 +155,6 @@ class CommandStreamReceiver {
size_t defaultSshSize;
void setDeviceIndex(uint32_t deviceIndex) { this->deviceIndex = deviceIndex; }
AllocationsList &getTemporaryAllocations();
AllocationsList &getAllocationsForReuse();
InternalAllocationStorage *getInternalAllocationStorage() const { return internalAllocationStorage.get(); }
@@ -191,7 +190,7 @@ class CommandStreamReceiver {
protected:
void cleanupResources();
uint32_t getDeviceIndexForAllocation() const;
MOCKABLE_VIRTUAL uint32_t getDeviceIndex() const;
std::unique_ptr<FlushStampTracker> flushStamp;
std::unique_ptr<SubmissionAggregator> submissionAggregator;
@@ -232,7 +231,6 @@ class CommandStreamReceiver {
PreemptionMode lastPreemptionMode = PreemptionMode::Initial;
uint64_t totalMemoryUsed = 0u;
uint32_t deviceIndex = 0u;
// taskCount - # of tasks submitted
uint32_t taskCount = 0;
uint32_t lastSentL3Config = 0;

View File

@@ -25,8 +25,8 @@ template <typename GfxFamily>
class CommandStreamReceiverSimulatedCommonHw : public CommandStreamReceiverHw<GfxFamily> {
protected:
using CommandStreamReceiverHw<GfxFamily>::CommandStreamReceiverHw;
using CommandStreamReceiverHw<GfxFamily>::deviceIndex;
using CommandStreamReceiverHw<GfxFamily>::osContext;
using CommandStreamReceiverHw<GfxFamily>::getDeviceIndex;
using AUB = typename AUBFamilyMapper<GfxFamily>::AUB;
using MiContextDescriptorReg = typename AUB::MiContextDescriptorReg;

View File

@@ -29,7 +29,7 @@ void CommandStreamReceiverSimulatedCommonHw<GfxFamily>::getGTTData(void *memory,
template <typename GfxFamily>
uint32_t CommandStreamReceiverSimulatedCommonHw<GfxFamily>::getMemoryBankForGtt() const {
return MemoryBanks::getBank(this->deviceIndex);
return MemoryBanks::getBank(getDeviceIndex());
}
template <typename GfxFamily>

View File

@@ -17,10 +17,11 @@ class CommandStreamReceiverSimulatedHw : public CommandStreamReceiverSimulatedCo
protected:
using CommandStreamReceiverSimulatedCommonHw<GfxFamily>::CommandStreamReceiverSimulatedCommonHw;
using CommandStreamReceiverSimulatedCommonHw<GfxFamily>::osContext;
using CommandStreamReceiverSimulatedCommonHw<GfxFamily>::getDeviceIndex;
public:
uint32_t getMemoryBank(GraphicsAllocation *allocation) const {
return MemoryBanks::getBank(this->deviceIndex);
return MemoryBanks::getBank(getDeviceIndex());
}
int getAddressSpace(int hint) {
return AubMemDump::AddressSpaceValues::TraceNonlocal;

View File

@@ -60,7 +60,6 @@ bool ExecutionEnvironment::initializeCommandStreamReceiver(uint32_t deviceIndex,
if (HwHelper::get(hwInfo->platform.eRenderCoreFamily).isPageTableManagerSupported(*hwInfo)) {
commandStreamReceiver->createPageTableManager();
}
commandStreamReceiver->setDeviceIndex(deviceIndex);
this->commandStreamReceivers[deviceIndex][deviceCsrIndex] = std::move(commandStreamReceiver);
return true;
}

View File

@@ -59,5 +59,6 @@ class DrmCommandStreamReceiver : public DeviceCommandStreamReceiver<GfxFamily> {
std::vector<drm_i915_gem_exec_object2> execObjectsStorage;
Drm *drm;
gemCloseWorkerMode gemCloseWorkerOperationMode;
uint32_t handleIndex = 0u;
};
} // namespace NEO