2018-03-09 21:40:31 +08:00
|
|
|
/*
|
2020-02-22 16:28:27 +08:00
|
|
|
* Copyright (C) 2017-2020 Intel Corporation
|
2018-09-18 15:11:08 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
2018-03-09 21:40:31 +08:00
|
|
|
|
2020-02-24 20:10:44 +08:00
|
|
|
#include "shared/source/built_ins/built_ins.h"
|
|
|
|
#include "shared/source/built_ins/sip.h"
|
|
|
|
|
2020-02-23 22:20:22 +08:00
|
|
|
#include "opencl/test/unit_test/global_environment.h"
|
|
|
|
#include "opencl/test/unit_test/helpers/test_files.h"
|
|
|
|
#include "opencl/test/unit_test/mocks/mock_device.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
#include "test.h"
|
2018-03-09 21:40:31 +08:00
|
|
|
|
2019-02-27 18:39:32 +08:00
|
|
|
#include "gtest/gtest.h"
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
using namespace NEO;
|
2018-03-09 21:40:31 +08:00
|
|
|
|
|
|
|
namespace SipKernelTests {
|
|
|
|
extern std::string getDebugSipKernelNameWithBitnessAndProductSuffix(std::string &base, const char *product);
|
|
|
|
|
|
|
|
typedef ::testing::Test gen9SipTests;
|
|
|
|
|
2018-03-13 23:55:41 +08:00
|
|
|
GEN9TEST_F(gen9SipTests, DISABLED_givenDebugCsrSipKernelWithLocalMemoryWhenAskedForDebugSurfaceBtiAndSizeThenBtiIsZeroAndSizeGreaterThanZero) {
|
2018-07-03 16:00:12 +08:00
|
|
|
auto mockDevice = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
|
2018-03-09 21:40:31 +08:00
|
|
|
EXPECT_NE(nullptr, mockDevice);
|
|
|
|
MockCompilerDebugVars igcDebugVars;
|
|
|
|
|
|
|
|
std::string name = "sip_dummy_kernel_debug";
|
2018-04-24 19:06:49 +08:00
|
|
|
std::string builtInFileRoot = testFiles + getDebugSipKernelNameWithBitnessAndProductSuffix(name, binaryNameSuffix.c_str());
|
2018-03-09 21:40:31 +08:00
|
|
|
std::string builtInGenFile = builtInFileRoot;
|
|
|
|
builtInGenFile.append(".gen");
|
|
|
|
|
|
|
|
igcDebugVars.fileName = builtInGenFile;
|
|
|
|
gEnvironment->igcPushDebugVars(igcDebugVars);
|
|
|
|
|
2018-08-22 19:57:21 +08:00
|
|
|
auto &builtins = *mockDevice->getExecutionEnvironment()->getBuiltIns();
|
2018-03-09 21:40:31 +08:00
|
|
|
auto &sipKernel = builtins.getSipKernel(SipKernelType::DbgCsrLocal, *mockDevice);
|
|
|
|
|
2018-03-19 17:11:30 +08:00
|
|
|
EXPECT_NE(nullptr, &sipKernel);
|
|
|
|
EXPECT_EQ(SipKernelType::DbgCsrLocal, sipKernel.getType());
|
2018-03-09 21:40:31 +08:00
|
|
|
|
|
|
|
gEnvironment->igcPopDebugVars();
|
|
|
|
}
|
2018-04-06 20:25:22 +08:00
|
|
|
|
|
|
|
GEN9TEST_F(gen9SipTests, givenDebuggingActiveWhenSipTypeIsQueriedThenDbgCsrLocalIsReturned) {
|
|
|
|
auto sipType = SipKernel::getSipKernelType(renderCoreFamily, true);
|
|
|
|
EXPECT_EQ(SipKernelType::DbgCsrLocal, sipType);
|
|
|
|
}
|
2018-03-09 21:40:31 +08:00
|
|
|
} // namespace SipKernelTests
|