Prepare OCL tests for switch to zebin

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
This commit is contained in:
Krystian Chmielewski
2022-09-14 13:00:13 +00:00
committed by Compute-Runtime-Automation
parent 7a4fb24448
commit b7a780868a
5 changed files with 29 additions and 16 deletions

View File

@ -137,18 +137,8 @@ TEST_F(KernelSubGroupInfoKhrReturnCompileSizeTest, GivenKernelWhenGettingRequire
&paramValueSizeRet);
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_EQ(paramValueSizeRet, sizeof(size_t));
size_t requiredSubGroupSize = 0;
auto start = pKernel->getKernelInfo().kernelDescriptor.kernelMetadata.kernelLanguageAttributes.find("intel_reqd_sub_group_size(");
if (start != std::string::npos) {
start += strlen("intel_reqd_sub_group_size(");
auto stop = pKernel->getKernelInfo().kernelDescriptor.kernelMetadata.kernelLanguageAttributes.find(")", start);
requiredSubGroupSize = stoi(pKernel->getKernelInfo().kernelDescriptor.kernelMetadata.kernelLanguageAttributes.substr(start, stop - start));
}
EXPECT_EQ(paramValue, requiredSubGroupSize);
EXPECT_EQ(pKernel->getKernelInfo().kernelDescriptor.kernelMetadata.requiredSubGroupSize, paramValue);
}
TEST_F(KernelSubGroupInfoKhrTest, GivenNullKernelWhenGettingKernelSubGroupInfoThenInvalidKernelErrorIsReturned) {

View File

@ -1410,6 +1410,9 @@ HWTEST_F(PatchTokenTests, givenKernelRequiringConstantAllocationWhenMakeResident
ASSERT_EQ(CL_SUCCESS, retVal);
auto pKernelInfo = pProgram->getKernelInfo("test", rootDeviceIndex);
if (pKernelInfo->kernelDescriptor.kernelAttributes.binaryFormat == NEO::DeviceBinaryFormat::Zebin) {
GTEST_SKIP();
}
ASSERT_NE(nullptr, pProgram->getConstantSurface(pClDevice->getRootDeviceIndex()));
@ -1685,6 +1688,9 @@ TEST_F(ProgramWithDebugSymbolsTests, GivenProgramCreatedWithDashGOptionWhenGetti
EXPECT_EQ(CL_SUCCESS, retVal);
ArrayRef<const uint8_t> archive(reinterpret_cast<const uint8_t *>(testBinary.get()), size);
if (NEO::isDeviceBinaryFormat<NEO::DeviceBinaryFormat::Zebin>(archive)) {
GTEST_SKIP();
}
auto productAbbreviation = hardwarePrefix[pDevice->getHardwareInfo().platform.eProductFamily];
HardwareInfo copyHwInfo = pDevice->getHardwareInfo();
@ -2284,6 +2290,10 @@ TEST_F(ProgramTests, GivenFailingGenBinaryProgramWhenRebuildingBinaryThenInvalid
auto pBinary = loadDataFromFile(filePath.c_str(), binarySize);
EXPECT_NE(0u, binarySize);
if (NEO::isDeviceBinaryFormat<NEO::DeviceBinaryFormat::Zebin>({reinterpret_cast<const uint8_t *>(pBinary.get()), binarySize})) {
GTEST_SKIP();
}
// Create program from loaded binary
retVal = program->createProgramFromBinary(pBinary.get(), binarySize, *pClDevice);
EXPECT_EQ(CL_SUCCESS, retVal);

View File

@ -55,8 +55,11 @@ TEST(ProgramFromBinary, givenBinaryWithDebugDataWhenCreatingProgramFromBinaryThe
size_t binarySize = 0;
auto pBinary = loadDataFromFile(filePath.c_str(), binarySize);
cl_int retVal = program->createProgramFromBinary(pBinary.get(), binarySize, *device);
if (NEO::isDeviceBinaryFormat<NEO::DeviceBinaryFormat::Zebin>({reinterpret_cast<const uint8_t *>(pBinary.get()), binarySize})) {
GTEST_SKIP();
}
cl_int retVal = program->createProgramFromBinary(pBinary.get(), binarySize, *device);
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_NE(nullptr, program->getDebugData(device->getRootDeviceIndex()));
EXPECT_NE(0u, program->getDebugDataSize(device->getRootDeviceIndex()));
@ -303,11 +306,12 @@ TEST_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsLinke
}
TEST_F(ProgramWithKernelDebuggingTest, givenProgramWithKernelDebugEnabledWhenBuiltThenPatchTokenAllocateSipSurfaceHasSizeGreaterThanZero) {
auto &refBin = pProgram->buildInfos[pDevice->getRootDeviceIndex()].unpackedDeviceBinary;
auto refBinSize = pProgram->buildInfos[pDevice->getRootDeviceIndex()].unpackedDeviceBinarySize;
if (NEO::isDeviceBinaryFormat<NEO::DeviceBinaryFormat::Zebin>(ArrayRef<const uint8_t>::fromAny(refBin.get(), refBinSize))) {
auto &devBinary = pProgram->buildInfos[pDevice->getRootDeviceIndex()].packedDeviceBinary;
auto devBinarySize = pProgram->buildInfos[pDevice->getRootDeviceIndex()].packedDeviceBinarySize;
if (NEO::isDeviceBinaryFormat<NEO::DeviceBinaryFormat::Zebin>(ArrayRef<const uint8_t>::fromAny(devBinary.get(), devBinarySize))) {
GTEST_SKIP();
}
auto retVal = pProgram->build(pProgram->getDevices(), CompilerOptions::debugKernelEnable.data(), false);
EXPECT_EQ(CL_SUCCESS, retVal);