2019-09-25 11:30:19 +02:00
|
|
|
/*
|
2022-05-09 17:40:30 +00:00
|
|
|
* Copyright (C) 2019-2022 Intel Corporation
|
2019-09-25 11:30:19 +02:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/os_interface/os_context.h"
|
2021-01-21 13:10:13 +01:00
|
|
|
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
2021-10-12 16:42:24 +00:00
|
|
|
#include "shared/test/common/mocks/mock_csr.h"
|
2021-01-21 13:10:13 +01:00
|
|
|
#include "shared/test/common/mocks/mock_device.h"
|
2021-07-06 15:44:16 +02:00
|
|
|
#include "shared/test/common/mocks/mock_execution_environment.h"
|
2021-10-06 15:19:50 +00:00
|
|
|
#include "shared/test/common/test_macros/test_checks_shared.h"
|
2020-02-24 10:22:30 +01:00
|
|
|
|
2020-03-18 13:08:45 +01:00
|
|
|
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
2020-02-23 15:20:22 +01:00
|
|
|
#include "opencl/test/unit_test/mocks/mock_context.h"
|
2019-09-25 11:30:19 +02:00
|
|
|
|
|
|
|
namespace NEO {
|
2021-10-06 15:19:50 +00:00
|
|
|
template <bool setupBlitter>
|
|
|
|
struct DispatchFlagsTestsBase : public ::testing::Test {
|
2019-09-25 11:30:19 +02:00
|
|
|
template <typename CsrType>
|
2022-05-09 17:40:30 +00:00
|
|
|
void SetUpImpl() { // NOLINT(readability-identifier-naming)
|
2021-10-06 15:19:50 +00:00
|
|
|
HardwareInfo hwInfo = *defaultHwInfo;
|
|
|
|
if (setupBlitter) {
|
|
|
|
hwInfo.capabilityTable.blitterOperationsSupported = true;
|
|
|
|
}
|
|
|
|
|
2019-11-05 13:38:20 +01:00
|
|
|
environmentWrapper.setCsrType<CsrType>();
|
2021-10-06 15:19:50 +00:00
|
|
|
device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo));
|
2019-09-25 11:30:19 +02:00
|
|
|
context = std::make_unique<MockContext>(device.get());
|
|
|
|
}
|
|
|
|
|
2019-11-05 13:38:20 +01:00
|
|
|
EnvironmentWithCsrWrapper environmentWrapper;
|
2020-01-14 14:32:11 +01:00
|
|
|
std::unique_ptr<MockClDevice> device;
|
2019-09-25 11:30:19 +02:00
|
|
|
std::unique_ptr<MockContext> context;
|
|
|
|
DebugManagerStateRestore restore;
|
|
|
|
};
|
2021-10-06 15:19:50 +00:00
|
|
|
|
|
|
|
using DispatchFlagsTests = DispatchFlagsTestsBase<false>;
|
|
|
|
using DispatchFlagsBlitTests = DispatchFlagsTestsBase<true>;
|
2019-09-25 11:30:19 +02:00
|
|
|
} // namespace NEO
|