mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Prepare OCL tests for switch to zebin
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
7a4fb24448
commit
b7a780868a
@ -137,18 +137,8 @@ TEST_F(KernelSubGroupInfoKhrReturnCompileSizeTest, GivenKernelWhenGettingRequire
|
|||||||
¶mValueSizeRet);
|
¶mValueSizeRet);
|
||||||
|
|
||||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||||
|
|
||||||
EXPECT_EQ(paramValueSizeRet, sizeof(size_t));
|
EXPECT_EQ(paramValueSizeRet, sizeof(size_t));
|
||||||
|
EXPECT_EQ(pKernel->getKernelInfo().kernelDescriptor.kernelMetadata.requiredSubGroupSize, paramValue);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(KernelSubGroupInfoKhrTest, GivenNullKernelWhenGettingKernelSubGroupInfoThenInvalidKernelErrorIsReturned) {
|
TEST_F(KernelSubGroupInfoKhrTest, GivenNullKernelWhenGettingKernelSubGroupInfoThenInvalidKernelErrorIsReturned) {
|
||||||
|
@ -1410,6 +1410,9 @@ HWTEST_F(PatchTokenTests, givenKernelRequiringConstantAllocationWhenMakeResident
|
|||||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||||
|
|
||||||
auto pKernelInfo = pProgram->getKernelInfo("test", rootDeviceIndex);
|
auto pKernelInfo = pProgram->getKernelInfo("test", rootDeviceIndex);
|
||||||
|
if (pKernelInfo->kernelDescriptor.kernelAttributes.binaryFormat == NEO::DeviceBinaryFormat::Zebin) {
|
||||||
|
GTEST_SKIP();
|
||||||
|
}
|
||||||
|
|
||||||
ASSERT_NE(nullptr, pProgram->getConstantSurface(pClDevice->getRootDeviceIndex()));
|
ASSERT_NE(nullptr, pProgram->getConstantSurface(pClDevice->getRootDeviceIndex()));
|
||||||
|
|
||||||
@ -1685,6 +1688,9 @@ TEST_F(ProgramWithDebugSymbolsTests, GivenProgramCreatedWithDashGOptionWhenGetti
|
|||||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||||
|
|
||||||
ArrayRef<const uint8_t> archive(reinterpret_cast<const uint8_t *>(testBinary.get()), size);
|
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];
|
auto productAbbreviation = hardwarePrefix[pDevice->getHardwareInfo().platform.eProductFamily];
|
||||||
|
|
||||||
HardwareInfo copyHwInfo = pDevice->getHardwareInfo();
|
HardwareInfo copyHwInfo = pDevice->getHardwareInfo();
|
||||||
@ -2284,6 +2290,10 @@ TEST_F(ProgramTests, GivenFailingGenBinaryProgramWhenRebuildingBinaryThenInvalid
|
|||||||
auto pBinary = loadDataFromFile(filePath.c_str(), binarySize);
|
auto pBinary = loadDataFromFile(filePath.c_str(), binarySize);
|
||||||
EXPECT_NE(0u, 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
|
// Create program from loaded binary
|
||||||
retVal = program->createProgramFromBinary(pBinary.get(), binarySize, *pClDevice);
|
retVal = program->createProgramFromBinary(pBinary.get(), binarySize, *pClDevice);
|
||||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||||
|
@ -55,8 +55,11 @@ TEST(ProgramFromBinary, givenBinaryWithDebugDataWhenCreatingProgramFromBinaryThe
|
|||||||
|
|
||||||
size_t binarySize = 0;
|
size_t binarySize = 0;
|
||||||
auto pBinary = loadDataFromFile(filePath.c_str(), binarySize);
|
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_EQ(CL_SUCCESS, retVal);
|
||||||
EXPECT_NE(nullptr, program->getDebugData(device->getRootDeviceIndex()));
|
EXPECT_NE(nullptr, program->getDebugData(device->getRootDeviceIndex()));
|
||||||
EXPECT_NE(0u, program->getDebugDataSize(device->getRootDeviceIndex()));
|
EXPECT_NE(0u, program->getDebugDataSize(device->getRootDeviceIndex()));
|
||||||
@ -303,11 +306,12 @@ TEST_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsLinke
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(ProgramWithKernelDebuggingTest, givenProgramWithKernelDebugEnabledWhenBuiltThenPatchTokenAllocateSipSurfaceHasSizeGreaterThanZero) {
|
TEST_F(ProgramWithKernelDebuggingTest, givenProgramWithKernelDebugEnabledWhenBuiltThenPatchTokenAllocateSipSurfaceHasSizeGreaterThanZero) {
|
||||||
auto &refBin = pProgram->buildInfos[pDevice->getRootDeviceIndex()].unpackedDeviceBinary;
|
auto &devBinary = pProgram->buildInfos[pDevice->getRootDeviceIndex()].packedDeviceBinary;
|
||||||
auto refBinSize = pProgram->buildInfos[pDevice->getRootDeviceIndex()].unpackedDeviceBinarySize;
|
auto devBinarySize = pProgram->buildInfos[pDevice->getRootDeviceIndex()].packedDeviceBinarySize;
|
||||||
if (NEO::isDeviceBinaryFormat<NEO::DeviceBinaryFormat::Zebin>(ArrayRef<const uint8_t>::fromAny(refBin.get(), refBinSize))) {
|
if (NEO::isDeviceBinaryFormat<NEO::DeviceBinaryFormat::Zebin>(ArrayRef<const uint8_t>::fromAny(devBinary.get(), devBinarySize))) {
|
||||||
GTEST_SKIP();
|
GTEST_SKIP();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto retVal = pProgram->build(pProgram->getDevices(), CompilerOptions::debugKernelEnable.data(), false);
|
auto retVal = pProgram->build(pProgram->getDevices(), CompilerOptions::debugKernelEnable.data(), false);
|
||||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||||
|
|
||||||
|
@ -161,7 +161,9 @@ struct ArgDescriptor final {
|
|||||||
case ArgTImage:
|
case ArgTImage:
|
||||||
return (KernelArgMetadata::AccessReadOnly == traits.accessQualifier);
|
return (KernelArgMetadata::AccessReadOnly == traits.accessQualifier);
|
||||||
case ArgTPointer:
|
case ArgTPointer:
|
||||||
return (KernelArgMetadata::AddrConstant == traits.addressQualifier) || (traits.typeQualifiers.constQual);
|
return (KernelArgMetadata::AddrConstant == traits.addressQualifier) ||
|
||||||
|
(KernelArgMetadata::AccessReadOnly == traits.accessQualifier) ||
|
||||||
|
traits.typeQualifiers.constQual;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,6 +181,13 @@ TEST(ArgDescriptorIsReadOnly, GivenPointerArgWhenConstantAddressSpaceThenReturns
|
|||||||
EXPECT_FALSE(arg.isReadOnly());
|
EXPECT_FALSE(arg.isReadOnly());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(ArgDescriptorIsReadOnly, GivenPointerArgWhenAccessQualifierIsReadOnlyThenReturnsTrue) {
|
||||||
|
NEO::ArgDescriptor arg;
|
||||||
|
arg.as<NEO::ArgDescPointer>(true);
|
||||||
|
arg.getTraits().accessQualifier = NEO::KernelArgMetadata::AccessReadOnly;
|
||||||
|
EXPECT_TRUE(arg.isReadOnly());
|
||||||
|
}
|
||||||
|
|
||||||
TEST(ArgDescriptorIsReadOnly, GivenSamplerArgThenReturnsTrue) {
|
TEST(ArgDescriptorIsReadOnly, GivenSamplerArgThenReturnsTrue) {
|
||||||
NEO::ArgDescriptor arg;
|
NEO::ArgDescriptor arg;
|
||||||
arg.as<NEO::ArgDescSampler>(true);
|
arg.as<NEO::ArgDescSampler>(true);
|
||||||
|
Reference in New Issue
Block a user