Remove platform references from mock_aub_center_fixture.h
Related-To: NEO-5894 Signed-off-by: Piotr Obst <piotr.obst@intel.com>
This commit is contained in:
parent
dc41512fce
commit
dc6a35286b
|
@ -20,6 +20,8 @@
|
|||
#include "level_zero/core/test/unit_tests/fixtures/device_fixture.h"
|
||||
#include "level_zero/core/test/unit_tests/mocks/mock_device.h"
|
||||
|
||||
#include "third_party/opencl_headers/CL/cl_ext_intel.h"
|
||||
|
||||
namespace L0 {
|
||||
namespace ult {
|
||||
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
*/
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/helpers/common_types.h"
|
||||
|
||||
#include "opencl/source/api/cl_types.h"
|
||||
#include "opencl/source/cl_device/cl_device_vector.h"
|
||||
#include "opencl/source/helpers/base_object.h"
|
||||
|
@ -30,7 +32,6 @@ struct OpenCLObjectMapper<_cl_platform_id> {
|
|||
typedef class Platform DerivedType;
|
||||
};
|
||||
|
||||
using DeviceVector = std::vector<std::unique_ptr<Device>>;
|
||||
class Platform : public BaseObject<_cl_platform_id> {
|
||||
public:
|
||||
static const cl_ulong objectMagic = 0x8873ACDEF2342133LL;
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
#include "opencl/test/unit_test/fixtures/platform_fixture.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_platform.h"
|
||||
#include "test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include "opencl/test/unit_test/mocks/mock_async_event_handler.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_cl_execution_environment.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_memory_manager.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_platform.h"
|
||||
#include "test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "opencl/test/unit_test/fixtures/memory_management_fixture.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_memory_manager.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_platform.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_kernel.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_platform.h"
|
||||
#include "test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
|
||||
#include "shared/test/common/mocks/mock_device.h"
|
||||
|
||||
#include "opencl/test/unit_test/mocks/mock_platform.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
bool &MockClDevice::createSingleDevice = MockDevice::createSingleDevice;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_platform.h"
|
||||
|
||||
#include "gmock/gmock.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
|
|
@ -13,6 +13,8 @@ namespace NEO {
|
|||
struct EngineControl;
|
||||
using EngineControlContainer = std::vector<EngineControl>;
|
||||
using DeviceBitfield = std::bitset<32>;
|
||||
class Device;
|
||||
using DeviceVector = std::vector<std::unique_ptr<Device>>;
|
||||
|
||||
enum class DebugPauseState : uint32_t {
|
||||
disabled,
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "shared/source/os_interface/windows/os_context_win.h"
|
||||
#include "shared/source/os_interface/windows/os_environment_win.h"
|
||||
#include "shared/source/os_interface/windows/wddm_memory_operations_handler.h"
|
||||
#include "shared/test/common/fixtures/device_fixture.h"
|
||||
#include "shared/test/common/fixtures/mock_execution_environment_gmm_fixture.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||
|
@ -100,9 +101,10 @@ struct WddmFixtureWithMockGdiDll : public GdiDllFixture, public MockExecutionEnv
|
|||
RootDeviceEnvironment *rootDeviceEnvironment = nullptr;
|
||||
};
|
||||
|
||||
struct WddmInstrumentationGmmFixture {
|
||||
struct WddmInstrumentationGmmFixture : DeviceFixture {
|
||||
void SetUp() {
|
||||
executionEnvironment = platform()->peekExecutionEnvironment();
|
||||
DeviceFixture::SetUp();
|
||||
executionEnvironment = pDevice->getExecutionEnvironment();
|
||||
auto rootDeviceEnvironment = executionEnvironment->rootDeviceEnvironments[0].get();
|
||||
wddm = static_cast<WddmMock *>(Wddm::createWddm(nullptr, *rootDeviceEnvironment));
|
||||
gmmMem = new ::testing::NiceMock<GmockGmmMemory>(rootDeviceEnvironment->getGmmClientContext());
|
||||
|
@ -111,6 +113,7 @@ struct WddmInstrumentationGmmFixture {
|
|||
rootDeviceEnvironment->osInterface->setDriverModel(std::unique_ptr<DriverModel>(wddm));
|
||||
}
|
||||
void TearDown() {
|
||||
DeviceFixture::TearDown();
|
||||
}
|
||||
|
||||
WddmMock *wddm;
|
||||
|
|
|
@ -13,9 +13,6 @@
|
|||
#include "shared/test/common/mocks/mock_aub_manager.h"
|
||||
#include "shared/test/unit_test/tests_configuration.h"
|
||||
|
||||
#include "opencl/source/platform/platform.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_platform.h"
|
||||
|
||||
namespace NEO {
|
||||
struct MockAubCenterFixture {
|
||||
|
||||
|
|
|
@ -37,7 +37,8 @@ struct DeferredDeleterPublic : DeferredDeleter {
|
|||
|
||||
struct DeferrableAllocationDeletionTest : ::testing::Test {
|
||||
void SetUp() override {
|
||||
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
|
||||
executionEnvironment = new MockExecutionEnvironment(defaultHwInfo.get(), false, 1u);
|
||||
executionEnvironment->incRefInternal();
|
||||
memoryManager = new MockMemoryManager(*executionEnvironment);
|
||||
executionEnvironment->memoryManager.reset(memoryManager);
|
||||
device.reset(Device::create<MockDevice>(executionEnvironment, 0u));
|
||||
|
@ -49,7 +50,9 @@ struct DeferrableAllocationDeletionTest : ::testing::Test {
|
|||
void TearDown() override {
|
||||
asyncDeleter->allowExit = true;
|
||||
asyncDeleter->removeClient();
|
||||
executionEnvironment->decRefInternal();
|
||||
}
|
||||
ExecutionEnvironment *executionEnvironment;
|
||||
std::unique_ptr<DeferredDeleterPublic> asyncDeleter;
|
||||
MockMemoryManager *memoryManager = nullptr;
|
||||
std::unique_ptr<MockDevice> device;
|
||||
|
@ -159,7 +162,6 @@ TEST_F(DeferrableAllocationDeletionTest, givenAllocationUsedByUnregisteredEngine
|
|||
DeferrableAllocationDeletion deletion{*memoryManager, *allocation};
|
||||
|
||||
device.reset();
|
||||
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
|
||||
executionEnvironment->rootDeviceEnvironments.clear();
|
||||
EXPECT_EQ(0u, memoryManager->registeredEngines.size());
|
||||
EXPECT_TRUE(allocation->isUsed());
|
||||
|
|
Loading…
Reference in New Issue