mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Add ult for isSimulation
Change-Id: Iabc28bb0716fdf3d87e7dfc34793b4d294282b9f Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com> Related-To: NEO-4648
This commit is contained in:
@ -13,6 +13,7 @@
|
||||
#include "shared/test/unit_test/helpers/ult_hw_config.h"
|
||||
#include "shared/test/unit_test/helpers/variable_backup.h"
|
||||
|
||||
#include "opencl/source/command_stream/tbx_command_stream_receiver.h"
|
||||
#include "opencl/source/platform/platform.h"
|
||||
#include "opencl/test/unit_test/fixtures/device_fixture.h"
|
||||
#include "opencl/test/unit_test/helpers/unit_test_helper.h"
|
||||
@ -130,6 +131,24 @@ HWTEST_F(DeviceTest, WhenDeviceIsCreatedThenActualEngineTypeIsSameAsDefault) {
|
||||
EXPECT_EQ(defaultEngineType, actualEngineType);
|
||||
}
|
||||
|
||||
HWTEST_F(DeviceTest, givenNoHwCsrTypeAndModifiedDefaultEngineIndexWhenIsSimulationIsCalledThenTrueIsReturned) {
|
||||
EXPECT_FALSE(pDevice->isSimulation());
|
||||
auto csr = TbxCommandStreamReceiver::create("", false, *pDevice->executionEnvironment, 0);
|
||||
pDevice->defaultEngineIndex = 1;
|
||||
pDevice->resetCommandStreamReceiver(csr);
|
||||
|
||||
EXPECT_TRUE(pDevice->isSimulation());
|
||||
|
||||
std::array<CommandStreamReceiverType, 3> exptectedEngineTypes = {CommandStreamReceiverType::CSR_HW,
|
||||
CommandStreamReceiverType::CSR_TBX,
|
||||
CommandStreamReceiverType::CSR_HW};
|
||||
|
||||
for (uint32_t i = 0u; i < 3u; ++i) {
|
||||
auto engineType = pDevice->engines[i].commandStreamReceiver->getType();
|
||||
EXPECT_EQ(exptectedEngineTypes[i], engineType);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(DeviceCleanup, givenDeviceWhenItIsDestroyedThenFlushBatchedSubmissionsIsCalled) {
|
||||
auto mockDevice = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
|
||||
MockCommandStreamReceiver *csr = new MockCommandStreamReceiver(*mockDevice->getExecutionEnvironment(), mockDevice->getRootDeviceIndex());
|
||||
|
@ -46,6 +46,7 @@ class MockDevice : public RootDevice {
|
||||
using Device::getGlobalMemorySize;
|
||||
using Device::initializeCaps;
|
||||
using RootDevice::createEngines;
|
||||
using RootDevice::defaultEngineIndex;
|
||||
using RootDevice::subdevices;
|
||||
|
||||
void setOSTime(OSTime *osTime);
|
||||
|
Reference in New Issue
Block a user