2019-12-04 20:45:32 +08:00
|
|
|
/*
|
2020-01-14 21:32:11 +08:00
|
|
|
* Copyright (C) 2019-2020 Intel Corporation
|
2019-12-04 20:45:32 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2020-02-24 08:01:38 +08:00
|
|
|
#include "shared/test/unit_test/helpers/debug_manager_state_restore.h"
|
2020-04-02 15:35:50 +08:00
|
|
|
#include "shared/test/unit_test/mocks/mock_device.h"
|
2020-02-24 17:22:30 +08:00
|
|
|
|
2020-03-18 20:08:45 +08:00
|
|
|
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
2020-02-23 22:20:22 +08:00
|
|
|
#include "opencl/test/unit_test/mocks/mock_context.h"
|
|
|
|
#include "opencl/test/unit_test/mocks/mock_memory_manager.h"
|
2019-12-04 20:45:32 +08:00
|
|
|
|
|
|
|
namespace NEO {
|
|
|
|
class MultiRootDeviceFixture : public ::testing::Test {
|
|
|
|
public:
|
|
|
|
void SetUp() override {
|
2020-09-28 19:11:58 +08:00
|
|
|
DebugManager.flags.CreateMultipleRootDevices.set(3 * expectedRootDeviceIndex);
|
|
|
|
|
2020-01-14 21:32:11 +08:00
|
|
|
device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr, expectedRootDeviceIndex));
|
2020-09-28 19:11:58 +08:00
|
|
|
device2 = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr, 2u));
|
|
|
|
|
|
|
|
cl_device_id devices[] = {
|
|
|
|
device.get(), device2.get()};
|
|
|
|
|
2020-11-04 23:50:54 +08:00
|
|
|
context.reset(new MockContext(ClDeviceVector(devices, 2), false));
|
2019-12-04 20:45:32 +08:00
|
|
|
mockMemoryManager = reinterpret_cast<MockMemoryManager *>(device->getMemoryManager());
|
|
|
|
}
|
|
|
|
|
|
|
|
const uint32_t expectedRootDeviceIndex = 1;
|
|
|
|
DebugManagerStateRestore restorer;
|
2020-01-14 21:32:11 +08:00
|
|
|
std::unique_ptr<MockClDevice> device;
|
2020-09-28 19:11:58 +08:00
|
|
|
std::unique_ptr<MockClDevice> device2;
|
2019-12-04 20:45:32 +08:00
|
|
|
std::unique_ptr<MockContext> context;
|
|
|
|
MockMemoryManager *mockMemoryManager;
|
|
|
|
};
|
|
|
|
}; // namespace NEO
|