mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 09:03:14 +08:00
Revert "feature: fail stateful kernel when stateless is required"
This reverts commit 2a8c0d867f.
Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
a744ce6fbb
commit
a0d55768a0
@@ -100,9 +100,8 @@ TEST_F(ClBuildProgramTests, GivenBinaryAsInputWhenCreatingProgramWithSourceThenP
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
}
|
||||
|
||||
HWTEST_F(ClBuildProgramTests, GivenFailBuildProgramIsDisabledAndStatelessDisabledAndBinaryAsInputWhenCreatingProgramWithSourceThenProgramBuildSuccesses) {
|
||||
debugManager.flags.FailBuildProgramWithStatefulAccess.set(0);
|
||||
debugManager.flags.DisableForceToStateless.set(1);
|
||||
HWTEST2_F(ClBuildProgramTests, GivenFailBuildProgramAndBinaryAsInputWhenCreatingProgramWithSourceThenProgramBuildFails, IsAtLeastXeHpcCore) {
|
||||
debugManager.flags.FailBuildProgramWithStatefulAccess.set(1);
|
||||
cl_program pProgram = nullptr;
|
||||
cl_int binaryStatus = CL_SUCCESS;
|
||||
MockZebinWrapper zebin{pDevice->getHardwareInfo()};
|
||||
@@ -127,7 +126,7 @@ HWTEST_F(ClBuildProgramTests, GivenFailBuildProgramIsDisabledAndStatelessDisable
|
||||
nullptr,
|
||||
nullptr);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
EXPECT_EQ(CL_BUILD_PROGRAM_FAILURE, retVal);
|
||||
|
||||
retVal = clReleaseProgram(pProgram);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
@@ -88,7 +88,7 @@ TEST_F(ClCreateProgramWithBinaryTests, GivenInvalidInputWhenCreatingProgramWithB
|
||||
EXPECT_EQ(CL_INVALID_VALUE, retVal);
|
||||
EXPECT_EQ(nullptr, pProgram);
|
||||
|
||||
zebin.binarySizes[1] = zebin.data->storage.size();
|
||||
zebin.binarySizes[1] = zebin.data.storage.size();
|
||||
|
||||
pProgram = clCreateProgramWithBinary(
|
||||
pContext,
|
||||
|
||||
@@ -318,7 +318,7 @@ TEST(clGetProgramInfoTest, GivenMultiDeviceBuiltInProgramCreatedWithGenBinaryWhe
|
||||
cl_program pProgram = nullptr;
|
||||
|
||||
cl_int retVal = CL_INVALID_PROGRAM;
|
||||
pProgram = Program::createBuiltInFromGenBinary(&context, context.getDevices(), zebin.data->storage.data(), zebin.data->storage.size(), &retVal);
|
||||
pProgram = Program::createBuiltInFromGenBinary(&context, context.getDevices(), zebin.data.storage.data(), zebin.data.storage.size(), &retVal);
|
||||
|
||||
EXPECT_NE(nullptr, pProgram);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
@@ -346,8 +346,8 @@ TEST(clGetProgramInfoTest, GivenMultiDeviceBuiltInProgramCreatedWithGenBinaryWhe
|
||||
|
||||
cl_int retVal = CL_INVALID_PROGRAM;
|
||||
|
||||
unsigned char *pBinary = zebin.data->storage.data();
|
||||
const size_t binarySize = zebin.data->storage.size();
|
||||
unsigned char *pBinary = zebin.data.storage.data();
|
||||
const size_t binarySize = zebin.data.storage.size();
|
||||
pProgram = Program::createBuiltInFromGenBinary(&context, context.getDevices(), pBinary, binarySize, &retVal);
|
||||
|
||||
EXPECT_NE(nullptr, pProgram);
|
||||
|
||||
@@ -129,7 +129,6 @@ HWTEST2_F(EnqueueKernelTest, GivenIndirectAccessBufferVersion1WhenExecutingKerne
|
||||
ZebinTestData::ZebinCopyBufferModule<numBits>::Descriptor desc{};
|
||||
desc.execEnv["simd_size"] = std::to_string(simd);
|
||||
desc.execEnv["require_iab"] = "true";
|
||||
desc.isStateless = pDevice->getCompilerProductHelper().isForceToStatelessRequired();
|
||||
auto zebinData = std::make_unique<ZebinTestData::ZebinCopyBufferModule<numBits>>(pDevice->getHardwareInfo(), desc);
|
||||
const auto src = zebinData->storage.data();
|
||||
const auto binarySize = zebinData->storage.size();
|
||||
|
||||
@@ -44,6 +44,11 @@ const char *CompilerProductHelperHw<gfxProduct>::getCachingPolicyOptions(bool is
|
||||
return L1CachePolicyHelper<gfxProduct>::getCachingPolicyOptions(isDebuggerActive);
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool CompilerProductHelperHw<gfxProduct>::failBuildProgramWithStatefulAccessPreference() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool CompilerProductHelperHw<gfxProduct>::oclocEnforceZebinFormat() const {
|
||||
return false;
|
||||
|
||||
@@ -39,9 +39,4 @@ bool CompilerProductHelperHw<gfxProduct>::isSubgroupBufferPrefetchSupported() co
|
||||
return false;
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool CompilerProductHelperHw<gfxProduct>::failBuildProgramWithStatefulAccessPreference() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -43,9 +43,4 @@ bool CompilerProductHelperHw<gfxProduct>::isSubgroupBufferPrefetchSupported() co
|
||||
return true;
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool CompilerProductHelperHw<gfxProduct>::failBuildProgramWithStatefulAccessPreference() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -64,6 +64,11 @@ uint32_t CompilerProductHelperHw<IGFX_PVC>::matchRevisionIdWithProductConfig(Har
|
||||
return pvcConfig.value;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool CompilerProductHelperHw<IGFX_PVC>::failBuildProgramWithStatefulAccessPreference() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool CompilerProductHelperHw<IGFX_PVC>::isMatrixMultiplyAccumulateSupported(const ReleaseHelper *releaseHelper) const {
|
||||
if (releaseHelper) {
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared/source/helpers/compiler_product_helper.h"
|
||||
#include "shared/test/common/libult/global_environment.h"
|
||||
#include "shared/test/common/mocks/mock_modules_zebin.h"
|
||||
|
||||
@@ -20,18 +19,16 @@ template <size_t binariesCount = 1u, Elf::ElfIdentifierClass numBits = is32bit ?
|
||||
struct MockZebinWrapper {
|
||||
using Descriptor = ZebinTestData::ZebinCopyBufferModule<numBits>::Descriptor;
|
||||
|
||||
MockZebinWrapper(const HardwareInfo &hwInfo, Descriptor desc = {}) {
|
||||
auto productHelper = NEO::CompilerProductHelper::create(defaultHwInfo->platform.eProductFamily);
|
||||
desc.isStateless = productHelper->isForceToStatelessRequired();
|
||||
|
||||
data = std::make_unique<ZebinTestData::ZebinCopyBufferModule<numBits>>(hwInfo, desc);
|
||||
|
||||
std::fill_n(binaries.begin(), binariesCount, reinterpret_cast<const unsigned char *>(this->data->storage.data()));
|
||||
std::fill_n(binarySizes.begin(), binariesCount, this->data->storage.size());
|
||||
MockZebinWrapper(const HardwareInfo &hwInfo, Descriptor desc)
|
||||
: data(hwInfo, desc) {
|
||||
std::fill_n(binaries.begin(), binariesCount, reinterpret_cast<const unsigned char *>(this->data.storage.data()));
|
||||
std::fill_n(binarySizes.begin(), binariesCount, this->data.storage.size());
|
||||
}
|
||||
|
||||
MockZebinWrapper(const HardwareInfo &hwInfo) : MockZebinWrapper(hwInfo, Descriptor{}) {}
|
||||
|
||||
auto &getFlags() {
|
||||
return reinterpret_cast<Zebin::Elf::ZebinTargetFlags &>(this->data->elfHeader->flags);
|
||||
return reinterpret_cast<Zebin::Elf::ZebinTargetFlags &>(this->data.elfHeader->flags);
|
||||
}
|
||||
|
||||
void setAsMockCompilerReturnedBinary() {
|
||||
@@ -60,7 +57,7 @@ struct MockZebinWrapper {
|
||||
}};
|
||||
}
|
||||
|
||||
std::unique_ptr<ZebinTestData::ZebinCopyBufferModule<numBits>> data;
|
||||
ZebinTestData::ZebinCopyBufferModule<numBits> data;
|
||||
std::array<const unsigned char *, binariesCount> binaries;
|
||||
std::array<size_t, binariesCount> binarySizes;
|
||||
std::unique_ptr<void, void (*)(void *)> debugVarsRestore{nullptr, nullptr};
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#include "shared/test/common/helpers/gtest_helpers.h"
|
||||
#include "shared/test/common/helpers/unit_test_helper.h"
|
||||
#include "shared/test/common/mocks/mock_device.h"
|
||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||
#include "shared/test/common/mocks/mock_release_helper.h"
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
|
||||
@@ -546,17 +545,3 @@ HWTEST_F(CompilerProductHelperFixture, GivenRequestForExtraKernelCapabilitiesThe
|
||||
EXPECT_EQ(0u, extraCaps);
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(CompilerProductHelperFixture, givenStatefulPlatformWhenFailBuildProgramWithStatefulAccessPreferenceThenFalseIsReturned, IsStatefulBufferPreferredForProduct) {
|
||||
MockExecutionEnvironment executionEnvironment{};
|
||||
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0];
|
||||
auto &compilerProductHelper = rootDeviceEnvironment.getHelper<CompilerProductHelper>();
|
||||
EXPECT_FALSE(compilerProductHelper.failBuildProgramWithStatefulAccessPreference());
|
||||
}
|
||||
|
||||
HWTEST2_F(CompilerProductHelperFixture, givenNotStatefulPlatformWhenFailBuildProgramWithStatefulAccessPreferenceThenTrueIsReturned, IsStatelessBufferPreferredForProduct) {
|
||||
MockExecutionEnvironment executionEnvironment{};
|
||||
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0];
|
||||
auto &compilerProductHelper = rootDeviceEnvironment.getHelper<CompilerProductHelper>();
|
||||
EXPECT_TRUE(compilerProductHelper.failBuildProgramWithStatefulAccessPreference());
|
||||
}
|
||||
@@ -38,6 +38,13 @@ PVCTEST_F(CompilerProductHelperPvcTest, givenPvcConfigsWhenMatchConfigWithRevIdT
|
||||
EXPECT_EQ(compilerProductHelper.matchRevisionIdWithProductConfig(AOT::PVC_XT_C0_VG, 0x2f), AOT::PVC_XT_C0_VG);
|
||||
}
|
||||
|
||||
PVCTEST_F(CompilerProductHelperPvcTest, givenPvcWhenFailBuildProgramWithStatefulAccessPreferenceThenFalseIsReturned) {
|
||||
MockExecutionEnvironment executionEnvironment{};
|
||||
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0];
|
||||
auto &compilerProductHelper = rootDeviceEnvironment.getHelper<CompilerProductHelper>();
|
||||
EXPECT_FALSE(compilerProductHelper.failBuildProgramWithStatefulAccessPreference());
|
||||
}
|
||||
|
||||
PVCTEST_F(CompilerProductHelperPvcTest, givenPvcB0AndLaterThenMatrixMultiplyAccumulateTF32IsSupported) {
|
||||
MockExecutionEnvironment executionEnvironment{};
|
||||
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0];
|
||||
|
||||
Reference in New Issue
Block a user