mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-09 06:23:01 +08:00
Create dedicated allocation for global fence purposes
Related-To: NEO-3216 Change-Id: I0483a99ea1095c7a10b1318f51569e479386cac4 Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
004ea3946d
commit
8560b2b262
@@ -304,6 +304,29 @@ HWTEST_F(DeviceHwTest, givenHwHelperInputWhenInitializingCsrThenCreatePageTableM
|
||||
EXPECT_EQ(csr2.needsPageTableManager(defaultEngineType), csr2.createPageTableManagerCalled);
|
||||
}
|
||||
|
||||
HWTEST_F(DeviceHwTest, givenDeviceCreationWhenCsrFailsToCreateGlobalSyncAllocationThenReturnNull) {
|
||||
class MockUltCsrThatFailsToCreateGlobalFenceAllocation : public UltCommandStreamReceiver<FamilyType> {
|
||||
public:
|
||||
MockUltCsrThatFailsToCreateGlobalFenceAllocation(ExecutionEnvironment &executionEnvironment)
|
||||
: UltCommandStreamReceiver<FamilyType>(executionEnvironment, 0) {}
|
||||
bool createGlobalFenceAllocation() override {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
class MockDeviceThatFailsToCreateGlobalFenceAllocation : public MockDevice {
|
||||
public:
|
||||
MockDeviceThatFailsToCreateGlobalFenceAllocation(ExecutionEnvironment *executionEnvironment, uint32_t deviceIndex)
|
||||
: MockDevice(executionEnvironment, deviceIndex) {}
|
||||
std::unique_ptr<CommandStreamReceiver> createCommandStreamReceiver() const override {
|
||||
return std::make_unique<MockUltCsrThatFailsToCreateGlobalFenceAllocation>(*executionEnvironment);
|
||||
}
|
||||
};
|
||||
|
||||
auto executionEnvironment = platform()->peekExecutionEnvironment();
|
||||
auto mockDevice(MockDevice::create<MockDeviceThatFailsToCreateGlobalFenceAllocation>(executionEnvironment, 0));
|
||||
EXPECT_EQ(nullptr, mockDevice);
|
||||
}
|
||||
|
||||
TEST(DeviceGenEngineTest, givenHwCsrModeWhenGetEngineThenDedicatedForInternalUsageEngineIsReturned) {
|
||||
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<Device>(nullptr));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user