Move getDeviceIndex method to CommandStreamReceiverSimulatedCommonHw class

Related-To: NEO-3691
Change-Id: Ie425c035fcdd1467269ead131c4bd063c8b83e08
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2019-12-17 15:53:15 +01:00
committed by sys_ocldev
parent cf02ada7a1
commit d11d3ad27e
7 changed files with 27 additions and 14 deletions

View File

@@ -303,10 +303,6 @@ IndirectHeap &CommandStreamReceiver::getIndirectHeap(IndirectHeap::Type heapType
return *heap;
}
uint32_t CommandStreamReceiver::getDeviceIndex() const {
return osContext->getDeviceBitfield().any() ? static_cast<uint32_t>(Math::log2(static_cast<uint32_t>(osContext->getDeviceBitfield().to_ulong()))) : 0u;
}
void CommandStreamReceiver::allocateHeapMemory(IndirectHeap::Type heapType,
size_t minRequiredSize, IndirectHeap *&indirectHeap) {
size_t reservedSize = 0;

View File

@@ -193,7 +193,6 @@ class CommandStreamReceiver {
protected:
void cleanupResources();
MOCKABLE_VIRTUAL uint32_t getDeviceIndex() const;
std::unique_ptr<FlushStampTracker> flushStamp;
std::unique_ptr<SubmissionAggregator> submissionAggregator;

View File

@@ -24,16 +24,17 @@ class HardwareContextController;
template <typename GfxFamily>
class CommandStreamReceiverSimulatedCommonHw : public CommandStreamReceiverHw<GfxFamily> {
protected:
using CommandStreamReceiverHw<GfxFamily>::CommandStreamReceiverHw;
using CommandStreamReceiverHw<GfxFamily>::osContext;
using CommandStreamReceiverHw<GfxFamily>::getDeviceIndex;
using AUB = typename AUBFamilyMapper<GfxFamily>::AUB;
using MiContextDescriptorReg = typename AUB::MiContextDescriptorReg;
bool getParametersForWriteMemory(GraphicsAllocation &graphicsAllocation, uint64_t &gpuAddress, void *&cpuAddress, size_t &size) const;
void freeEngineInfo(AddressMapper &gttRemap);
MOCKABLE_VIRTUAL uint32_t getDeviceIndex() const;
public:
CommandStreamReceiverSimulatedCommonHw(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex);
~CommandStreamReceiverSimulatedCommonHw() override;
uint64_t getGTTBits() const {
return 0u;
}

View File

@@ -89,4 +89,12 @@ void CommandStreamReceiverSimulatedCommonHw<GfxFamily>::freeEngineInfo(AddressMa
engineInfo.pRingBuffer = nullptr;
}
template <typename GfxFamily>
uint32_t CommandStreamReceiverSimulatedCommonHw<GfxFamily>::getDeviceIndex() const {
return osContext->getDeviceBitfield().any() ? static_cast<uint32_t>(Math::log2(static_cast<uint32_t>(osContext->getDeviceBitfield().to_ulong()))) : 0u;
}
template <typename GfxFamily>
CommandStreamReceiverSimulatedCommonHw<GfxFamily>::CommandStreamReceiverSimulatedCommonHw(ExecutionEnvironment &executionEnvironment, uint32_t rootDeviceIndex) : CommandStreamReceiverHw<GfxFamily>(executionEnvironment, rootDeviceIndex) {}
template <typename GfxFamily>
CommandStreamReceiverSimulatedCommonHw<GfxFamily>::~CommandStreamReceiverSimulatedCommonHw() = default;
} // namespace NEO