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