mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 10:17:01 +08:00
Remove EngineInstanceT.
Change-Id: I08543b5f4ef5e91e6beb8390d448e53702cd9dac Signed-off-by: Piotr Fusik <piotr.fusik@intel.com>
This commit is contained in:
@@ -41,7 +41,7 @@ class CommandStreamReceiverSimulatedCommonHw : public CommandStreamReceiverHw<Gf
|
||||
uint64_t getPPGTTAdditionalBits(GraphicsAllocation *gfxAllocation);
|
||||
void getGTTData(void *memory, AubGTTData &data);
|
||||
uint32_t getMemoryBankForGtt() const;
|
||||
static const AubMemDump::LrcaHelper &getCsTraits(EngineInstanceT engineInstance);
|
||||
static const AubMemDump::LrcaHelper &getCsTraits(EngineType engineType);
|
||||
void initEngineMMIO();
|
||||
void submitLRCA(const MiContextDescriptorReg &contextDescriptor);
|
||||
void setupContext(OsContext &osContext) override;
|
||||
|
||||
@@ -55,13 +55,13 @@ uint32_t CommandStreamReceiverSimulatedCommonHw<GfxFamily>::getMemoryBankForGtt(
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
const AubMemDump::LrcaHelper &CommandStreamReceiverSimulatedCommonHw<GfxFamily>::getCsTraits(EngineInstanceT engineInstance) {
|
||||
return *AUBFamilyMapper<GfxFamily>::csTraits[engineInstance.type];
|
||||
const AubMemDump::LrcaHelper &CommandStreamReceiverSimulatedCommonHw<GfxFamily>::getCsTraits(EngineType engineType) {
|
||||
return *AUBFamilyMapper<GfxFamily>::csTraits[engineType];
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
void CommandStreamReceiverSimulatedCommonHw<GfxFamily>::initEngineMMIO() {
|
||||
auto mmioList = AUBFamilyMapper<GfxFamily>::perEngineMMIO[osContext->getEngineType().type];
|
||||
auto mmioList = AUBFamilyMapper<GfxFamily>::perEngineMMIO[osContext->getEngineType()];
|
||||
|
||||
DEBUG_BREAK_IF(!mmioList);
|
||||
for (auto &mmioPair : *mmioList) {
|
||||
|
||||
@@ -23,16 +23,6 @@ constexpr uint32_t lowPriorityGpgpuEngineIndex = 1;
|
||||
constexpr uint32_t numGpgpuEngineInstances = 2;
|
||||
} // namespace EngineInstanceConstants
|
||||
|
||||
struct EngineInstanceT {
|
||||
constexpr EngineInstanceT(EngineType type) : type(type), id(0) {}
|
||||
constexpr EngineInstanceT(EngineType type, int id) : type(type), id(id) {}
|
||||
|
||||
EngineType type;
|
||||
int id;
|
||||
};
|
||||
|
||||
constexpr EngineInstanceT lowPriorityGpgpuEngine{ENGINE_RCS, 1};
|
||||
|
||||
constexpr uint32_t maxOsContextCount = EngineInstanceConstants::numGpgpuEngineInstances;
|
||||
constexpr uint32_t maxHandleCount = 1u;
|
||||
} // namespace OCLRT
|
||||
|
||||
@@ -184,7 +184,7 @@ bool Device::createEngines(const HardwareInfo *pHwInfo) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (gpgpuEngines[deviceCsrIndex].type == defaultEngineType && gpgpuEngines[deviceCsrIndex].id == 0) {
|
||||
if (gpgpuEngines[deviceCsrIndex] == defaultEngineType && !lowPriority) {
|
||||
defaultEngineIndex = deviceCsrIndex;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ HardwareContextController::HardwareContextController(aub_stream::AubManager &aub
|
||||
auto deviceBitfield = osContext.getDeviceBitfield();
|
||||
for (uint32_t deviceIndex = 0; deviceIndex < deviceBitfield.size(); deviceIndex++) {
|
||||
if (deviceBitfield.test(deviceIndex)) {
|
||||
hardwareContexts.emplace_back(aubManager.createHardwareContext(deviceIndex, osContext.getEngineType().type, flags));
|
||||
hardwareContexts.emplace_back(aubManager.createHardwareContext(deviceIndex, osContext.getEngineType(), flags));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ class HwHelper {
|
||||
virtual uint32_t getConfigureAddressSpaceMode() = 0;
|
||||
virtual bool isLocalMemoryEnabled(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool isPageTableManagerSupported(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual const AubMemDump::LrcaHelper &getCsTraits(EngineInstanceT engineInstance) const = 0;
|
||||
virtual const AubMemDump::LrcaHelper &getCsTraits(EngineType engineType) const = 0;
|
||||
virtual bool supportsYTiling() const = 0;
|
||||
virtual bool obtainRenderBufferCompressionPreference(const HardwareInfo &hwInfo) const = 0;
|
||||
static bool renderCompressedBuffersSupported(const HardwareInfo &hwInfo);
|
||||
@@ -57,7 +57,7 @@ class HwHelper {
|
||||
uint32_t surfaceType,
|
||||
bool forceNonAuxMode) = 0;
|
||||
virtual size_t getScratchSpaceOffsetFor64bit() = 0;
|
||||
virtual const std::vector<EngineInstanceT> getGpgpuEngineInstances() const = 0;
|
||||
virtual const std::vector<EngineType> getGpgpuEngineInstances() const = 0;
|
||||
virtual bool getEnableLocalMemory(const HardwareInfo &hwInfo) const = 0;
|
||||
|
||||
protected:
|
||||
@@ -99,7 +99,7 @@ class HwHelperHw : public HwHelper {
|
||||
return sizeof(RENDER_SURFACE_STATE);
|
||||
}
|
||||
|
||||
const AubMemDump::LrcaHelper &getCsTraits(EngineInstanceT engineInstance) const override;
|
||||
const AubMemDump::LrcaHelper &getCsTraits(EngineType engineType) const override;
|
||||
|
||||
size_t getMaxBarrierRegisterPerSlice() const override;
|
||||
|
||||
@@ -140,7 +140,7 @@ class HwHelperHw : public HwHelper {
|
||||
|
||||
size_t getScratchSpaceOffsetFor64bit() override;
|
||||
|
||||
const std::vector<EngineInstanceT> getGpgpuEngineInstances() const override;
|
||||
const std::vector<EngineType> getGpgpuEngineInstances() const override;
|
||||
|
||||
bool getEnableLocalMemory(const HardwareInfo &hwInfo) const override;
|
||||
|
||||
|
||||
@@ -77,8 +77,8 @@ size_t HwHelperHw<Family>::getMaxBarrierRegisterPerSlice() const {
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
const AubMemDump::LrcaHelper &HwHelperHw<Family>::getCsTraits(EngineInstanceT engineInstance) const {
|
||||
return *AUBFamilyMapper<Family>::csTraits[engineInstance.type];
|
||||
const AubMemDump::LrcaHelper &HwHelperHw<Family>::getCsTraits(EngineType engineType) const {
|
||||
return *AUBFamilyMapper<Family>::csTraits[engineType];
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
@@ -168,10 +168,10 @@ size_t HwHelperHw<Family>::getScratchSpaceOffsetFor64bit() {
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
const std::vector<EngineInstanceT> HwHelperHw<Family>::getGpgpuEngineInstances() const {
|
||||
constexpr std::array<EngineInstanceT, 2> gpgpuEngineInstances = {{{ENGINE_RCS, 0},
|
||||
lowPriorityGpgpuEngine}};
|
||||
return std::vector<EngineInstanceT>(gpgpuEngineInstances.begin(), gpgpuEngineInstances.end());
|
||||
const std::vector<EngineType> HwHelperHw<Family>::getGpgpuEngineInstances() const {
|
||||
constexpr std::array<EngineType, 2> gpgpuEngineInstances = {{ENGINE_RCS,
|
||||
ENGINE_RCS}}; // low priority
|
||||
return std::vector<EngineType>(gpgpuEngineInstances.begin(), gpgpuEngineInstances.end());
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
|
||||
@@ -187,7 +187,7 @@ bool MemoryManager::isMemoryBudgetExhausted() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
OsContext *MemoryManager::createAndRegisterOsContext(CommandStreamReceiver *commandStreamReceiver, EngineInstanceT engineType,
|
||||
OsContext *MemoryManager::createAndRegisterOsContext(CommandStreamReceiver *commandStreamReceiver, EngineType engineType,
|
||||
DeviceBitfield deviceBitfield, PreemptionMode preemptionMode, bool lowPriority) {
|
||||
auto contextId = ++latestContextId;
|
||||
auto osContext = OsContext::create(executionEnvironment.osInterface.get(), contextId, deviceBitfield, engineType, preemptionMode, lowPriority);
|
||||
|
||||
@@ -174,7 +174,7 @@ class MemoryManager {
|
||||
::alignedFree(ptr);
|
||||
}
|
||||
|
||||
OsContext *createAndRegisterOsContext(CommandStreamReceiver *commandStreamReceiver, EngineInstanceT engineType,
|
||||
OsContext *createAndRegisterOsContext(CommandStreamReceiver *commandStreamReceiver, EngineType engineType,
|
||||
DeviceBitfield deviceBitfield, PreemptionMode preemptionMode, bool lowPriority);
|
||||
uint32_t getRegisteredEnginesCount() const { return static_cast<uint32_t>(registeredEngines.size()); }
|
||||
CommandStreamReceiver *getDefaultCommandStreamReceiver(uint32_t deviceId) const;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
namespace OCLRT {
|
||||
|
||||
OsContext *OsContext::create(OSInterface *osInterface, uint32_t contextId, DeviceBitfield deviceBitfield,
|
||||
EngineInstanceT engineType, PreemptionMode preemptionMode, bool lowPriority) {
|
||||
EngineType engineType, PreemptionMode preemptionMode, bool lowPriority) {
|
||||
if (osInterface) {
|
||||
return new OsContextLinux(*osInterface->get()->getDrm(), contextId, deviceBitfield, engineType, preemptionMode, lowPriority);
|
||||
}
|
||||
@@ -23,10 +23,10 @@ OsContext *OsContext::create(OSInterface *osInterface, uint32_t contextId, Devic
|
||||
}
|
||||
|
||||
OsContextLinux::OsContextLinux(Drm &drm, uint32_t contextId, DeviceBitfield deviceBitfield,
|
||||
EngineInstanceT engineType, PreemptionMode preemptionMode, bool lowPriority)
|
||||
EngineType engineType, PreemptionMode preemptionMode, bool lowPriority)
|
||||
: OsContext(contextId, deviceBitfield, engineType, preemptionMode, lowPriority), drm(drm) {
|
||||
|
||||
engineFlag = DrmEngineMapper::engineNodeMap(engineType.type);
|
||||
engineFlag = DrmEngineMapper::engineNodeMap(engineType);
|
||||
this->drmContextId = drm.createDrmContext();
|
||||
if (drm.isPreemptionSupported() && lowPriority) {
|
||||
drm.setLowPriorityContextParam(this->drmContextId);
|
||||
|
||||
@@ -15,7 +15,7 @@ class OsContextLinux : public OsContext {
|
||||
OsContextLinux() = delete;
|
||||
~OsContextLinux() override;
|
||||
OsContextLinux(Drm &drm, uint32_t contextId, DeviceBitfield deviceBitfield,
|
||||
EngineInstanceT engineType, PreemptionMode preemptionMode, bool lowPriority);
|
||||
EngineType engineType, PreemptionMode preemptionMode, bool lowPriority);
|
||||
|
||||
unsigned int getEngineFlag() const { return engineFlag; }
|
||||
uint32_t getDrmContextId() const { return drmContextId; }
|
||||
|
||||
@@ -22,16 +22,16 @@ class OsContext : public ReferenceTrackedObject<OsContext> {
|
||||
OsContext() = delete;
|
||||
|
||||
static OsContext *create(OSInterface *osInterface, uint32_t contextId, DeviceBitfield deviceBitfield,
|
||||
EngineInstanceT engineType, PreemptionMode preemptionMode, bool lowPriority);
|
||||
EngineType engineType, PreemptionMode preemptionMode, bool lowPriority);
|
||||
uint32_t getContextId() const { return contextId; }
|
||||
uint32_t getNumSupportedDevices() const { return numSupportedDevices; }
|
||||
DeviceBitfield getDeviceBitfield() const { return deviceBitfield; }
|
||||
PreemptionMode getPreemptionMode() const { return preemptionMode; }
|
||||
EngineInstanceT &getEngineType() { return engineType; }
|
||||
EngineType &getEngineType() { return engineType; }
|
||||
bool isLowPriority() const { return lowPriority; }
|
||||
|
||||
protected:
|
||||
OsContext(uint32_t contextId, DeviceBitfield deviceBitfield, EngineInstanceT engineType, PreemptionMode preemptionMode, bool lowPriority)
|
||||
OsContext(uint32_t contextId, DeviceBitfield deviceBitfield, EngineType engineType, PreemptionMode preemptionMode, bool lowPriority)
|
||||
: contextId(contextId),
|
||||
deviceBitfield(deviceBitfield),
|
||||
preemptionMode(preemptionMode),
|
||||
@@ -43,7 +43,7 @@ class OsContext : public ReferenceTrackedObject<OsContext> {
|
||||
const DeviceBitfield deviceBitfield;
|
||||
const PreemptionMode preemptionMode;
|
||||
const uint32_t numSupportedDevices;
|
||||
EngineInstanceT engineType = {EngineType::ENGINE_RCS, 0};
|
||||
EngineType engineType = EngineType::ENGINE_RCS;
|
||||
const bool lowPriority;
|
||||
};
|
||||
} // namespace OCLRT
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
namespace OCLRT {
|
||||
|
||||
OsContext *OsContext::create(OSInterface *osInterface, uint32_t contextId, DeviceBitfield deviceBitfield,
|
||||
EngineInstanceT engineType, PreemptionMode preemptionMode, bool lowPriority) {
|
||||
EngineType engineType, PreemptionMode preemptionMode, bool lowPriority) {
|
||||
if (osInterface) {
|
||||
return new OsContextWin(*osInterface->get()->getWddm(), contextId, deviceBitfield, engineType, preemptionMode, lowPriority);
|
||||
}
|
||||
@@ -22,7 +22,7 @@ OsContext *OsContext::create(OSInterface *osInterface, uint32_t contextId, Devic
|
||||
}
|
||||
|
||||
OsContextWin::OsContextWin(Wddm &wddm, uint32_t contextId, DeviceBitfield deviceBitfield,
|
||||
EngineInstanceT engineType, PreemptionMode preemptionMode, bool lowPriority)
|
||||
EngineType engineType, PreemptionMode preemptionMode, bool lowPriority)
|
||||
: OsContext(contextId, deviceBitfield, engineType, preemptionMode, lowPriority), wddm(wddm), residencyController(wddm, contextId) {
|
||||
|
||||
UNRECOVERABLE_IF(!wddm.isInitialized());
|
||||
|
||||
@@ -18,7 +18,7 @@ class OsContextWin : public OsContext {
|
||||
~OsContextWin() override;
|
||||
|
||||
OsContextWin(Wddm &wddm, uint32_t contextId, DeviceBitfield deviceBitfield,
|
||||
EngineInstanceT engineType, PreemptionMode preemptionMode, bool lowPriority);
|
||||
EngineType engineType, PreemptionMode preemptionMode, bool lowPriority);
|
||||
|
||||
D3DKMT_HANDLE getWddmContextHandle() const { return wddmContextHandle; }
|
||||
void setWddmContextHandle(D3DKMT_HANDLE wddmContextHandle) { this->wddmContextHandle = wddmContextHandle; }
|
||||
|
||||
@@ -657,7 +657,7 @@ bool Wddm::createContext(OsContextWin &osContext) {
|
||||
}
|
||||
|
||||
CreateContext.PrivateDriverDataSize = sizeof(PrivateData);
|
||||
CreateContext.NodeOrdinal = WddmEngineMapper::engineNodeMap(osContext.getEngineType().type);
|
||||
CreateContext.NodeOrdinal = WddmEngineMapper::engineNodeMap(osContext.getEngineType());
|
||||
CreateContext.pPrivateDriverData = &PrivateData;
|
||||
CreateContext.ClientHint = D3DKMT_CLIENTHINT_OPENGL;
|
||||
CreateContext.hDevice = device;
|
||||
|
||||
@@ -355,14 +355,14 @@ TEST_F(clCreateCommandQueueWithPropertiesApi, GivenLowPriorityWhenCreatingComman
|
||||
EXPECT_EQ(retVal, CL_SUCCESS);
|
||||
}
|
||||
|
||||
TEST_F(clCreateCommandQueueWithPropertiesApi, GivenLowPriorityWhenCreatingCommandQueueThenSelectRcs1Engine) {
|
||||
TEST_F(clCreateCommandQueueWithPropertiesApi, GivenLowPriorityWhenCreatingCommandQueueThenSelectRcsEngine) {
|
||||
cl_queue_properties properties[] = {CL_QUEUE_PRIORITY_KHR, CL_QUEUE_PRIORITY_LOW_KHR, 0};
|
||||
auto cmdQ = clCreateCommandQueueWithProperties(pContext, devices[0], properties, nullptr);
|
||||
|
||||
auto commandQueueObj = castToObject<CommandQueue>(cmdQ);
|
||||
auto engine = commandQueueObj->getCommandStreamReceiver().getOsContext().getEngineType();
|
||||
EXPECT_EQ(EngineType::ENGINE_RCS, engine.type);
|
||||
EXPECT_EQ(1, engine.id);
|
||||
auto &osContext = commandQueueObj->getCommandStreamReceiver().getOsContext();
|
||||
EXPECT_EQ(EngineType::ENGINE_RCS, osContext.getEngineType());
|
||||
EXPECT_TRUE(osContext.isLowPriority());
|
||||
|
||||
clReleaseCommandQueue(cmdQ);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ void AUBCommandStreamFixture::SetUp(CommandQueue *pCmdQ) {
|
||||
const ::testing::TestInfo *const testInfo = ::testing::UnitTest::GetInstance()->current_test_info();
|
||||
std::stringstream strfilename;
|
||||
auto engineType = pCmdQ->getCommandStreamReceiver().getOsContext().getEngineType();
|
||||
strfilename << testInfo->test_case_name() << "_" << testInfo->name() << "_" << hwHelper.getCsTraits(engineType.type).name;
|
||||
strfilename << testInfo->test_case_name() << "_" << testInfo->name() << "_" << hwHelper.getCsTraits(engineType).name;
|
||||
|
||||
if (testMode == TestMode::AubTestsWithTbx) {
|
||||
pCommandStreamReceiver = TbxCommandStreamReceiver::create(hwInfo, strfilename.str(), true, *device.executionEnvironment);
|
||||
|
||||
@@ -41,7 +41,7 @@ struct AUBFixture : public AUBCommandStreamFixture,
|
||||
|
||||
template <typename FamilyType>
|
||||
void testNoopIdXcs(EngineType engineType) {
|
||||
pCommandStreamReceiver->getOsContext().getEngineType().type = engineType;
|
||||
pCommandStreamReceiver->getOsContext().getEngineType() = engineType;
|
||||
|
||||
typedef typename FamilyType::MI_NOOP MI_NOOP;
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWithAubMana
|
||||
HWTEST_F(AubCommandStreamReceiverTests, givenAubCsrWhenOsContextIsSetThenCreateHardwareContext) {
|
||||
uint32_t deviceIndex = 3;
|
||||
|
||||
MockOsContext osContext(0, 8, {EngineType::ENGINE_BCS}, PreemptionMode::Disabled, false);
|
||||
MockOsContext osContext(0, 8, EngineType::ENGINE_BCS, PreemptionMode::Disabled, false);
|
||||
std::string fileName = "file_name.aub";
|
||||
MockAubManager *mockManager = new MockAubManager();
|
||||
MockAubCenter *mockAubCenter = new MockAubCenter(platformDevices[0], false, fileName, CommandStreamReceiverType::CSR_AUB);
|
||||
@@ -191,7 +191,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCsrWhenOsContextIsSetThenCreateH
|
||||
}
|
||||
|
||||
HWTEST_F(AubCommandStreamReceiverTests, givenAubCsrWhenLowPriorityOsContextIsSetThenDontCreateHardwareContext) {
|
||||
MockOsContext osContext(0, 1, lowPriorityGpgpuEngine, PreemptionMode::Disabled, true);
|
||||
MockOsContext osContext(0, 1, EngineType::ENGINE_RCS, PreemptionMode::Disabled, true);
|
||||
std::string fileName = "file_name.aub";
|
||||
MockAubManager *mockManager = new MockAubManager();
|
||||
MockAubCenter *mockAubCenter = new MockAubCenter(platformDevices[0], false, fileName, CommandStreamReceiverType::CSR_AUB);
|
||||
@@ -785,7 +785,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenOsContextWithMultipleDevicesSupport
|
||||
DeviceBitfield deviceBitfield;
|
||||
deviceBitfield.set(0);
|
||||
deviceBitfield.set(1);
|
||||
MockOsContext osContext(1, deviceBitfield, {EngineType::ENGINE_RCS, 0}, PreemptionMode::Disabled, false);
|
||||
MockOsContext osContext(1, deviceBitfield, EngineType::ENGINE_RCS, PreemptionMode::Disabled, false);
|
||||
auto aubCsr = std::make_unique<AUBCommandStreamReceiverHw<FamilyType>>(*platformDevices[0], "", true, *pDevice->executionEnvironment);
|
||||
aubCsr->setupContext(osContext);
|
||||
|
||||
@@ -1096,7 +1096,7 @@ TEST_F(HardwareContextContainerTests, givenOsContextWithMultipleDevicesSupported
|
||||
DeviceBitfield deviceBitfield;
|
||||
deviceBitfield.set(0);
|
||||
deviceBitfield.set(1);
|
||||
MockOsContext osContext(1, deviceBitfield, {EngineType::ENGINE_RCS, 0}, PreemptionMode::Disabled, false);
|
||||
MockOsContext osContext(1, deviceBitfield, EngineType::ENGINE_RCS, PreemptionMode::Disabled, false);
|
||||
|
||||
HardwareContextController hwContextControler(aubManager, osContext, 0);
|
||||
EXPECT_EQ(2u, hwContextControler.hardwareContexts.size());
|
||||
@@ -1112,7 +1112,7 @@ TEST_F(HardwareContextContainerTests, givenMultipleHwContextWhenSingleMethodIsCa
|
||||
DeviceBitfield deviceBitfield;
|
||||
deviceBitfield.set(0);
|
||||
deviceBitfield.set(1);
|
||||
MockOsContext osContext(1, deviceBitfield, {EngineType::ENGINE_RCS, 0}, PreemptionMode::Disabled, false);
|
||||
MockOsContext osContext(1, deviceBitfield, EngineType::ENGINE_RCS, PreemptionMode::Disabled, false);
|
||||
HardwareContextController hwContextContainer(aubManager, osContext, 0);
|
||||
EXPECT_EQ(2u, hwContextContainer.hardwareContexts.size());
|
||||
|
||||
@@ -1153,7 +1153,7 @@ TEST_F(HardwareContextContainerTests, givenMultipleHwContextWhenSingleMethodIsCa
|
||||
DeviceBitfield deviceBitfield;
|
||||
deviceBitfield.set(0);
|
||||
deviceBitfield.set(1);
|
||||
MockOsContext osContext(1, deviceBitfield, {EngineType::ENGINE_RCS, 0}, PreemptionMode::Disabled, false);
|
||||
MockOsContext osContext(1, deviceBitfield, EngineType::ENGINE_RCS, PreemptionMode::Disabled, false);
|
||||
HardwareContextController hwContextContainer(aubManager, osContext, 0);
|
||||
EXPECT_EQ(2u, hwContextContainer.hardwareContexts.size());
|
||||
|
||||
|
||||
@@ -894,7 +894,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationWritableWhenDumpA
|
||||
|
||||
pDevice->executionEnvironment->aubCenter.reset(mockAubCenter);
|
||||
MockAubCsr<FamilyType> aubCsr(**platformDevices, "", true, *pDevice->executionEnvironment);
|
||||
MockOsContext osContext(0, 1, {EngineType::ENGINE_RCS, 0}, PreemptionMode::Disabled, false);
|
||||
MockOsContext osContext(0, 1, EngineType::ENGINE_RCS, PreemptionMode::Disabled, false);
|
||||
aubCsr.setupContext(osContext);
|
||||
|
||||
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
|
||||
@@ -919,7 +919,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationWritableWhenDumpA
|
||||
|
||||
pDevice->executionEnvironment->aubCenter.reset(mockAubCenter);
|
||||
MockAubCsr<FamilyType> aubCsr(**platformDevices, "", true, *pDevice->executionEnvironment);
|
||||
MockOsContext osContext(0, 1, {EngineType::ENGINE_RCS, 0}, PreemptionMode::Disabled, false);
|
||||
MockOsContext osContext(0, 1, EngineType::ENGINE_RCS, PreemptionMode::Disabled, false);
|
||||
aubCsr.setupContext(osContext);
|
||||
|
||||
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
|
||||
@@ -946,7 +946,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationNonWritableWhenDu
|
||||
|
||||
pDevice->executionEnvironment->aubCenter.reset(mockAubCenter);
|
||||
MockAubCsr<FamilyType> aubCsr(**platformDevices, "", true, *pDevice->executionEnvironment);
|
||||
MockOsContext osContext(0, 1, {EngineType::ENGINE_RCS, 0}, PreemptionMode::Disabled, false);
|
||||
MockOsContext osContext(0, 1, EngineType::ENGINE_RCS, PreemptionMode::Disabled, false);
|
||||
aubCsr.setupContext(osContext);
|
||||
|
||||
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
|
||||
@@ -974,7 +974,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationNotDumpableWhenDu
|
||||
|
||||
pDevice->executionEnvironment->aubCenter.reset(mockAubCenter);
|
||||
MockAubCsr<FamilyType> aubCsr(**platformDevices, "", true, *pDevice->executionEnvironment);
|
||||
MockOsContext osContext(0, 1, {EngineType::ENGINE_RCS, 0}, PreemptionMode::Disabled, false);
|
||||
MockOsContext osContext(0, 1, EngineType::ENGINE_RCS, PreemptionMode::Disabled, false);
|
||||
aubCsr.setupContext(osContext);
|
||||
|
||||
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
|
||||
@@ -1003,7 +1003,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationDumpableWhenDumpA
|
||||
|
||||
pDevice->executionEnvironment->aubCenter.reset(mockAubCenter);
|
||||
MockAubCsr<FamilyType> aubCsr(**platformDevices, "", true, *pDevice->executionEnvironment);
|
||||
MockOsContext osContext(0, 1, {EngineType::ENGINE_RCS, 0}, PreemptionMode::Disabled, false);
|
||||
MockOsContext osContext(0, 1, EngineType::ENGINE_RCS, PreemptionMode::Disabled, false);
|
||||
aubCsr.setupContext(osContext);
|
||||
|
||||
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
|
||||
@@ -1031,7 +1031,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationWritableWhenDumpA
|
||||
|
||||
pDevice->executionEnvironment->aubCenter.reset(mockAubCenter);
|
||||
MockAubCsr<FamilyType> aubCsr(**platformDevices, "", true, *pDevice->executionEnvironment);
|
||||
MockOsContext osContext(0, 1, {EngineType::ENGINE_RCS, 0}, PreemptionMode::Disabled, false);
|
||||
MockOsContext osContext(0, 1, EngineType::ENGINE_RCS, PreemptionMode::Disabled, false);
|
||||
aubCsr.setupContext(osContext);
|
||||
aubCsr.latestSentTaskCount = 1;
|
||||
|
||||
|
||||
@@ -262,7 +262,7 @@ HWTEST_F(AubFileStreamTests, givenNewTasksAndHardwareContextPresentWhenCallingPo
|
||||
|
||||
pDevice->executionEnvironment->aubCenter.reset(mockAubCenter);
|
||||
MockAubCsr<FamilyType> aubCsr(**platformDevices, "", true, *pDevice->executionEnvironment);
|
||||
MockOsContext osContext(0, 1, {EngineType::ENGINE_RCS, 0}, PreemptionMode::Disabled, false);
|
||||
MockOsContext osContext(0, 1, EngineType::ENGINE_RCS, PreemptionMode::Disabled, false);
|
||||
aubCsr.setupContext(osContext);
|
||||
auto hardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
|
||||
aubCsr.stream = aubStream.get();
|
||||
@@ -282,7 +282,7 @@ HWTEST_F(AubFileStreamTests, givenNoNewTasksAndHardwareContextPresentWhenCalling
|
||||
|
||||
pDevice->executionEnvironment->aubCenter.reset(mockAubCenter);
|
||||
MockAubCsr<FamilyType> aubCsr(**platformDevices, "", true, *pDevice->executionEnvironment);
|
||||
MockOsContext osContext(0, 1, {EngineType::ENGINE_RCS, 0}, PreemptionMode::Disabled, false);
|
||||
MockOsContext osContext(0, 1, EngineType::ENGINE_RCS, PreemptionMode::Disabled, false);
|
||||
aubCsr.setupContext(osContext);
|
||||
auto hardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
|
||||
aubCsr.stream = aubStream.get();
|
||||
@@ -365,7 +365,7 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenFlushIsCalledThenI
|
||||
|
||||
pDevice->executionEnvironment->aubCenter.reset(mockAubCenter);
|
||||
MockAubCsr<FamilyType> aubCsr(**platformDevices, "", true, *pDevice->executionEnvironment);
|
||||
MockOsContext osContext(0, 1, {EngineType::ENGINE_RCS, 0}, PreemptionMode::Disabled, false);
|
||||
MockOsContext osContext(0, 1, EngineType::ENGINE_RCS, PreemptionMode::Disabled, false);
|
||||
aubCsr.setupContext(osContext);
|
||||
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
|
||||
aubCsr.stream = aubStream.get();
|
||||
@@ -394,7 +394,7 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenFlushIsCalledWithZ
|
||||
|
||||
pDevice->executionEnvironment->aubCenter.reset(mockAubCenter);
|
||||
MockAubCsr<FamilyType> aubCsr(**platformDevices, "", true, *pDevice->executionEnvironment);
|
||||
MockOsContext osContext(0, 1, {EngineType::ENGINE_RCS, 0}, PreemptionMode::Disabled, false);
|
||||
MockOsContext osContext(0, 1, EngineType::ENGINE_RCS, PreemptionMode::Disabled, false);
|
||||
aubCsr.setupContext(osContext);
|
||||
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
|
||||
aubCsr.stream = aubStream.get();
|
||||
@@ -418,7 +418,7 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenMakeResidentIsCall
|
||||
|
||||
pDevice->executionEnvironment->aubCenter.reset(mockAubCenter);
|
||||
MockAubCsr<FamilyType> aubCsr(**platformDevices, "", true, *pDevice->executionEnvironment);
|
||||
MockOsContext osContext(0, 1, {EngineType::ENGINE_RCS, 0}, PreemptionMode::Disabled, false);
|
||||
MockOsContext osContext(0, 1, EngineType::ENGINE_RCS, PreemptionMode::Disabled, false);
|
||||
aubCsr.setupContext(osContext);
|
||||
|
||||
MockGraphicsAllocation allocation(reinterpret_cast<void *>(0x1000), 0x1000);
|
||||
@@ -434,7 +434,7 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenExpectMemoryEqualI
|
||||
|
||||
pDevice->executionEnvironment->aubCenter.reset(mockAubCenter);
|
||||
MockAubCsr<FamilyType> aubCsr(**platformDevices, "", true, *pDevice->executionEnvironment);
|
||||
MockOsContext osContext(0, 1, {EngineType::ENGINE_RCS, 0}, PreemptionMode::Disabled, false);
|
||||
MockOsContext osContext(0, 1, EngineType::ENGINE_RCS, PreemptionMode::Disabled, false);
|
||||
aubCsr.setupContext(osContext);
|
||||
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
|
||||
|
||||
@@ -450,7 +450,7 @@ HWTEST_F(AubFileStreamTests, givenAubCommandStreamReceiverWhenExpectMemoryNotEqu
|
||||
|
||||
pDevice->executionEnvironment->aubCenter.reset(mockAubCenter);
|
||||
MockAubCsr<FamilyType> aubCsr(**platformDevices, "", true, *pDevice->executionEnvironment);
|
||||
MockOsContext osContext(0, 1, {EngineType::ENGINE_RCS, 0}, PreemptionMode::Disabled, false);
|
||||
MockOsContext osContext(0, 1, EngineType::ENGINE_RCS, PreemptionMode::Disabled, false);
|
||||
aubCsr.setupContext(osContext);
|
||||
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ struct MyMockCsr : UltCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME> {
|
||||
FlushStamp flush(BatchBuffer &batchBuffer, ResidencyContainer &allocationsForResidency) override {
|
||||
flushParametrization.wasCalled = true;
|
||||
flushParametrization.receivedBatchBuffer = &batchBuffer;
|
||||
flushParametrization.receivedEngine = osContext->getEngineType().type;
|
||||
flushParametrization.receivedEngine = osContext->getEngineType();
|
||||
flushParametrization.receivedAllocationsForResidency = &allocationsForResidency;
|
||||
processResidency(allocationsForResidency);
|
||||
return flushParametrization.flushStampToReturn;
|
||||
@@ -189,7 +189,7 @@ HWTEST_P(CommandStreamReceiverWithAubDumpTest, givenCommandStreamReceiverWithAub
|
||||
LinearStream cs(commandBuffer);
|
||||
|
||||
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
|
||||
auto engineType = csrWithAubDump->getOsContext().getEngineType().type;
|
||||
auto engineType = csrWithAubDump->getOsContext().getEngineType();
|
||||
|
||||
ResidencyContainer allocationsForResidency;
|
||||
FlushStamp flushStamp = csrWithAubDump->flush(batchBuffer, allocationsForResidency);
|
||||
|
||||
@@ -351,7 +351,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenFlushIsCalledTh
|
||||
|
||||
pDevice->executionEnvironment->aubCenter.reset(mockAubCenter);
|
||||
MockTbxCsr<FamilyType> tbxCsr(**platformDevices, *pDevice->executionEnvironment);
|
||||
MockOsContext osContext(0, 1, {EngineType::ENGINE_RCS, 0}, PreemptionMode::Disabled, false);
|
||||
MockOsContext osContext(0, 1, EngineType::ENGINE_RCS, PreemptionMode::Disabled, false);
|
||||
tbxCsr.setupContext(osContext);
|
||||
auto mockHardwareContext = static_cast<MockHardwareContext *>(tbxCsr.hardwareContextController->hardwareContexts[0].get());
|
||||
|
||||
@@ -381,7 +381,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverInBatchedModeWhenFl
|
||||
|
||||
pDevice->executionEnvironment->aubCenter.reset(mockAubCenter);
|
||||
MockTbxCsr<FamilyType> tbxCsr(**platformDevices, *pDevice->executionEnvironment);
|
||||
MockOsContext osContext(0, 1, {EngineType::ENGINE_RCS, 0}, PreemptionMode::Disabled, false);
|
||||
MockOsContext osContext(0, 1, EngineType::ENGINE_RCS, PreemptionMode::Disabled, false);
|
||||
tbxCsr.setupContext(osContext);
|
||||
|
||||
auto commandBuffer = pDevice->executionEnvironment->memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
|
||||
@@ -403,7 +403,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenFlushIsCalledWi
|
||||
|
||||
pDevice->executionEnvironment->aubCenter.reset(mockAubCenter);
|
||||
MockTbxCsr<FamilyType> tbxCsr(**platformDevices, *pDevice->executionEnvironment);
|
||||
MockOsContext osContext(0, 1, {EngineType::ENGINE_RCS, 0}, PreemptionMode::Disabled, false);
|
||||
MockOsContext osContext(0, 1, EngineType::ENGINE_RCS, PreemptionMode::Disabled, false);
|
||||
tbxCsr.setupContext(osContext);
|
||||
auto mockHardwareContext = static_cast<MockHardwareContext *>(tbxCsr.hardwareContextController->hardwareContexts[0].get());
|
||||
|
||||
@@ -425,7 +425,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenMakeResidentIsC
|
||||
|
||||
pDevice->executionEnvironment->aubCenter.reset(mockAubCenter);
|
||||
MockTbxCsr<FamilyType> tbxCsr(**platformDevices, *pDevice->executionEnvironment);
|
||||
MockOsContext osContext(0, 1, {EngineType::ENGINE_RCS, 0}, PreemptionMode::Disabled, false);
|
||||
MockOsContext osContext(0, 1, EngineType::ENGINE_RCS, PreemptionMode::Disabled, false);
|
||||
tbxCsr.setupContext(osContext);
|
||||
|
||||
MockGraphicsAllocation allocation(reinterpret_cast<void *>(0x1000), 0x1000);
|
||||
@@ -441,7 +441,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCommandStreamReceiverWhenMakeCoherentIsC
|
||||
|
||||
pDevice->executionEnvironment->aubCenter.reset(mockAubCenter);
|
||||
MockTbxCsr<FamilyType> tbxCsr(**platformDevices, *pDevice->executionEnvironment);
|
||||
MockOsContext osContext(0, 1, {EngineType::ENGINE_RCS, 0}, PreemptionMode::Disabled, false);
|
||||
MockOsContext osContext(0, 1, EngineType::ENGINE_RCS, PreemptionMode::Disabled, false);
|
||||
tbxCsr.setupContext(osContext);
|
||||
auto mockHardwareContext = static_cast<MockHardwareContext *>(tbxCsr.hardwareContextController->hardwareContexts[0].get());
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ TEST_F(DeviceTest, retainAndRelease) {
|
||||
TEST_F(DeviceTest, getEngineTypeDefault) {
|
||||
auto pTestDevice = std::unique_ptr<Device>(createWithUsDeviceId(0));
|
||||
|
||||
EngineType actualEngineType = pDevice->getDefaultEngine().osContext->getEngineType().type;
|
||||
EngineType actualEngineType = pDevice->getDefaultEngine().osContext->getEngineType();
|
||||
EngineType defaultEngineType = pDevice->getHardwareInfo().capabilityTable.defaultEngineType;
|
||||
|
||||
EXPECT_EQ(&pDevice->getDefaultEngine().commandStreamReceiver->getOsContext(), pDevice->getDefaultEngine().osContext);
|
||||
@@ -210,11 +210,10 @@ TEST(DeviceCreation, givenMultiDeviceWhenTheyAreCreatedThenEachDeviceHasSeperate
|
||||
TEST(DeviceCreation, givenDeviceWhenAskingForDefaultEngineThenReturnValidValue) {
|
||||
ExecutionEnvironment *executionEnvironment = platformImpl->peekExecutionEnvironment();
|
||||
auto device = std::unique_ptr<MockDevice>(Device::create<MockDevice>(platformDevices[0], executionEnvironment, 0));
|
||||
auto osContext = device->getDefaultEngine().osContext;
|
||||
|
||||
auto defaultEngine = device->getDefaultEngine().osContext->getEngineType();
|
||||
|
||||
EXPECT_EQ(platformDevices[0]->capabilityTable.defaultEngineType, defaultEngine.type);
|
||||
EXPECT_EQ(0, defaultEngine.id);
|
||||
EXPECT_EQ(platformDevices[0]->capabilityTable.defaultEngineType, osContext->getEngineType());
|
||||
EXPECT_FALSE(osContext->isLowPriority());
|
||||
}
|
||||
|
||||
TEST(DeviceCreation, givenFtrSimulationModeFlagTrueWhenNoOtherSimulationFlagsArePresentThenIsSimulationReturnsTrue) {
|
||||
|
||||
@@ -12,18 +12,8 @@ using namespace OCLRT;
|
||||
|
||||
template <typename FamilyType>
|
||||
void whenGetGpgpuEnginesThenReturnTwoRcsEngines() {
|
||||
auto &hwHelper = HwHelperHw<FamilyType>::get();
|
||||
auto &gpgpuEngines = hwHelper.getGpgpuEngineInstances();
|
||||
auto gpgpuEngines = HwHelperHw<FamilyType>::get().getGpgpuEngineInstances();
|
||||
EXPECT_EQ(2u, gpgpuEngines.size());
|
||||
int numRcsEngines = 0;
|
||||
for (auto &engine : gpgpuEngines) {
|
||||
if (ENGINE_RCS == engine.type) {
|
||||
EXPECT_EQ(numRcsEngines, engine.id);
|
||||
numRcsEngines++;
|
||||
}
|
||||
EXPECT_EQ(ENGINE_RCS, engine.type);
|
||||
}
|
||||
EXPECT_EQ(2, numRcsEngines);
|
||||
EXPECT_EQ(gpgpuEngines[EngineInstanceConstants::lowPriorityGpgpuEngineIndex].type, lowPriorityGpgpuEngine.type);
|
||||
EXPECT_EQ(gpgpuEngines[EngineInstanceConstants::lowPriorityGpgpuEngineIndex].id, lowPriorityGpgpuEngine.id);
|
||||
EXPECT_EQ(ENGINE_RCS, gpgpuEngines[0]);
|
||||
EXPECT_EQ(ENGINE_RCS, gpgpuEngines[1]);
|
||||
}
|
||||
|
||||
@@ -80,8 +80,8 @@ bool HwHelperHw<GENX>::setupPreemptionRegisters(HardwareInfo *pHwInfo, bool enab
|
||||
}
|
||||
|
||||
template <>
|
||||
const AubMemDump::LrcaHelper &HwHelperHw<GENX>::getCsTraits(EngineInstanceT engineInstance) const {
|
||||
return *AUBFamilyMapper<GENX>::csTraits[engineInstance.type];
|
||||
const AubMemDump::LrcaHelper &HwHelperHw<GENX>::getCsTraits(EngineType engineType) const {
|
||||
return *AUBFamilyMapper<GENX>::csTraits[engineType];
|
||||
}
|
||||
|
||||
template <>
|
||||
|
||||
@@ -1524,8 +1524,8 @@ HWTEST_F(GraphicsAllocationTests, givenAllocationUsedByManyOsContextsWhenCheckin
|
||||
auto defaultCsr = reinterpret_cast<UltCommandStreamReceiver<FamilyType> *>(device->getDefaultEngine().commandStreamReceiver);
|
||||
auto defaultOsContext = device->getDefaultEngine().osContext;
|
||||
|
||||
EXPECT_FALSE(defaultOsContext->getEngineType().id == nonDefaultOsContext->getEngineType().id &&
|
||||
defaultOsContext->getEngineType().type == nonDefaultOsContext->getEngineType().type);
|
||||
EXPECT_FALSE(defaultOsContext->isLowPriority());
|
||||
EXPECT_TRUE(nonDefaultOsContext->isLowPriority());
|
||||
|
||||
auto graphicsAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace OCLRT {
|
||||
class MockOsContext : public OsContext {
|
||||
public:
|
||||
MockOsContext(uint32_t contextId, DeviceBitfield deviceBitfield,
|
||||
EngineInstanceT engineType, PreemptionMode preemptionMode, bool lowPriority)
|
||||
EngineType engineType, PreemptionMode preemptionMode, bool lowPriority)
|
||||
: OsContext(contextId, deviceBitfield, engineType, preemptionMode, lowPriority) {}
|
||||
};
|
||||
} // namespace OCLRT
|
||||
|
||||
@@ -147,8 +147,6 @@ TEST(DrmTest, GivenDrmWhenAskedForContextThatFailsThenFalseIsReturned) {
|
||||
delete pDrm;
|
||||
}
|
||||
|
||||
constexpr EngineInstanceT defaultEngine{ENGINE_RCS, 0};
|
||||
|
||||
TEST(DrmTest, givenDrmWhenOsContextIsCreatedThenCreateAndDestroyNewDrmOsContext) {
|
||||
DrmMock drmMock;
|
||||
|
||||
@@ -157,14 +155,14 @@ TEST(DrmTest, givenDrmWhenOsContextIsCreatedThenCreateAndDestroyNewDrmOsContext)
|
||||
|
||||
{
|
||||
drmMock.StoredCtxId = drmContextId1;
|
||||
OsContextLinux osContext1(drmMock, 0u, 1, defaultEngine, PreemptionMode::Disabled, false);
|
||||
OsContextLinux osContext1(drmMock, 0u, 1, EngineType::ENGINE_RCS, PreemptionMode::Disabled, false);
|
||||
|
||||
EXPECT_EQ(drmContextId1, osContext1.getDrmContextId());
|
||||
EXPECT_EQ(0u, drmMock.receivedDestroyContextId);
|
||||
|
||||
{
|
||||
drmMock.StoredCtxId = drmContextId2;
|
||||
OsContextLinux osContext2(drmMock, 0u, 1, defaultEngine, PreemptionMode::Disabled, false);
|
||||
OsContextLinux osContext2(drmMock, 0u, 1, EngineType::ENGINE_RCS, PreemptionMode::Disabled, false);
|
||||
EXPECT_EQ(drmContextId2, osContext2.getDrmContextId());
|
||||
EXPECT_EQ(0u, drmMock.receivedDestroyContextId);
|
||||
}
|
||||
@@ -180,17 +178,17 @@ TEST(DrmTest, givenDrmPreemptionEnabledAndLowPriorityEngineWhenCreatingOsContext
|
||||
drmMock.StoredCtxId = 123;
|
||||
drmMock.preemptionSupported = false;
|
||||
|
||||
OsContextLinux osContext1(drmMock, 0u, 1, defaultEngine, PreemptionMode::Disabled, false);
|
||||
OsContextLinux osContext2(drmMock, 0u, 1, lowPriorityGpgpuEngine, PreemptionMode::Disabled, true);
|
||||
OsContextLinux osContext1(drmMock, 0u, 1, EngineType::ENGINE_RCS, PreemptionMode::Disabled, false);
|
||||
OsContextLinux osContext2(drmMock, 0u, 1, EngineType::ENGINE_RCS, PreemptionMode::Disabled, true);
|
||||
|
||||
EXPECT_EQ(0u, drmMock.receivedContextParamRequestCount);
|
||||
|
||||
drmMock.preemptionSupported = true;
|
||||
|
||||
OsContextLinux osContext3(drmMock, 0u, 1, defaultEngine, PreemptionMode::Disabled, false);
|
||||
OsContextLinux osContext3(drmMock, 0u, 1, EngineType::ENGINE_RCS, PreemptionMode::Disabled, false);
|
||||
EXPECT_EQ(0u, drmMock.receivedContextParamRequestCount);
|
||||
|
||||
OsContextLinux osContext4(drmMock, 0u, 1, lowPriorityGpgpuEngine, PreemptionMode::Disabled, true);
|
||||
OsContextLinux osContext4(drmMock, 0u, 1, EngineType::ENGINE_RCS, PreemptionMode::Disabled, true);
|
||||
EXPECT_EQ(1u, drmMock.receivedContextParamRequestCount);
|
||||
EXPECT_EQ(drmMock.StoredCtxId, drmMock.receivedContextParamRequest.ctx_id);
|
||||
EXPECT_EQ(static_cast<uint64_t>(I915_CONTEXT_PARAM_PRIORITY), drmMock.receivedContextParamRequest.param);
|
||||
|
||||
@@ -527,7 +527,7 @@ TEST_F(Wddm20WithMockGdiDllTestsWithoutWddmInit, givenUseNoRingFlushesKmdModeDeb
|
||||
TEST_F(Wddm20WithMockGdiDllTestsWithoutWddmInit, givenEngineTypeWhenCreatingContextThenPassCorrectNodeOrdinal) {
|
||||
init();
|
||||
auto createContextParams = this->getCreateContextDataFcn();
|
||||
UINT expected = WddmEngineMapper::engineNodeMap(HwHelper::get(platformDevices[0]->pPlatform->eRenderCoreFamily).getGpgpuEngineInstances()[0].type);
|
||||
UINT expected = WddmEngineMapper::engineNodeMap(HwHelper::get(platformDevices[0]->pPlatform->eRenderCoreFamily).getGpgpuEngineInstances()[0]);
|
||||
EXPECT_EQ(expected, createContextParams->NodeOrdinal);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,11 +66,9 @@ TEST(WddmMemoryManager, NonAssignable) {
|
||||
EXPECT_FALSE(std::is_copy_assignable<WddmMemoryManager>::value);
|
||||
}
|
||||
|
||||
constexpr EngineInstanceT defaultRcsEngine{ENGINE_RCS, 0};
|
||||
|
||||
TEST(WddmAllocationTest, givenAllocationIsTrimCandidateInOneOsContextWhenGettingTrimCandidatePositionThenReturnItsPositionAndUnusedPositionInOtherContexts) {
|
||||
WddmAllocation allocation{GraphicsAllocation::AllocationType::UNDECIDED, nullptr, 0, nullptr, MemoryPool::MemoryNull, false};
|
||||
MockOsContext osContext(1u, 1, defaultRcsEngine, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
|
||||
MockOsContext osContext(1u, 1, ENGINE_RCS, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
|
||||
allocation.setTrimCandidateListPosition(osContext.getContextId(), 700u);
|
||||
EXPECT_EQ(trimListUnusedPosition, allocation.getTrimCandidateListPosition(0u));
|
||||
EXPECT_EQ(700u, allocation.getTrimCandidateListPosition(1u));
|
||||
@@ -1349,16 +1347,16 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWithNoRegisteredOsContextsWh
|
||||
}
|
||||
|
||||
TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWithRegisteredOsContextWhenCallingIsMemoryBudgetExhaustedThenReturnFalse) {
|
||||
memoryManager->createAndRegisterOsContext(nullptr, defaultRcsEngine, 1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
|
||||
memoryManager->createAndRegisterOsContext(nullptr, defaultRcsEngine, 1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
|
||||
memoryManager->createAndRegisterOsContext(nullptr, defaultRcsEngine, 1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
|
||||
memoryManager->createAndRegisterOsContext(nullptr, ENGINE_RCS, 1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
|
||||
memoryManager->createAndRegisterOsContext(nullptr, ENGINE_RCS, 1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
|
||||
memoryManager->createAndRegisterOsContext(nullptr, ENGINE_RCS, 1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
|
||||
EXPECT_FALSE(memoryManager->isMemoryBudgetExhausted());
|
||||
}
|
||||
|
||||
TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWithRegisteredOsContextWithExhaustedMemoryBudgetWhenCallingIsMemoryBudgetExhaustedThenReturnTrue) {
|
||||
memoryManager->createAndRegisterOsContext(nullptr, defaultRcsEngine, 1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
|
||||
memoryManager->createAndRegisterOsContext(nullptr, defaultRcsEngine, 1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
|
||||
memoryManager->createAndRegisterOsContext(nullptr, defaultRcsEngine, 1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
|
||||
memoryManager->createAndRegisterOsContext(nullptr, ENGINE_RCS, 1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
|
||||
memoryManager->createAndRegisterOsContext(nullptr, ENGINE_RCS, 1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
|
||||
memoryManager->createAndRegisterOsContext(nullptr, ENGINE_RCS, 1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
|
||||
auto osContext = static_cast<OsContextWin *>(memoryManager->getRegisteredEngines()[1].osContext);
|
||||
osContext->getResidencyController().setMemoryBudgetExhausted();
|
||||
EXPECT_TRUE(memoryManager->isMemoryBudgetExhausted());
|
||||
@@ -1584,7 +1582,7 @@ TEST(WddmMemoryManagerCleanupTest, givenUsedTagAllocationInWddmMemoryManagerWhen
|
||||
executionEnvironment.commandStreamReceivers[0].push_back(std::unique_ptr<CommandStreamReceiver>(csr));
|
||||
|
||||
executionEnvironment.memoryManager = std::make_unique<WddmMemoryManager>(false, false, wddm, executionEnvironment);
|
||||
auto osContext = executionEnvironment.memoryManager->createAndRegisterOsContext(csr, defaultRcsEngine, 1, preemptionMode, false);
|
||||
auto osContext = executionEnvironment.memoryManager->createAndRegisterOsContext(csr, ENGINE_RCS, 1, preemptionMode, false);
|
||||
csr->setupContext(*osContext);
|
||||
EXPECT_EQ(csr, executionEnvironment.memoryManager->getDefaultCommandStreamReceiver(0));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user