Files
compute-runtime/shared/test/unit_test/ail/ail_tests_base.cpp
Kacper Nowak 5fe902c819 feat(AIL): make AIL oneDNN WA platform-independent
If on clCreateProgramWithSource() call we detect a nGen dummy kernel usage,
then enforce fallback to the patchtokens format (only for this kernel).
Extend this logic to all platforms (previously - only for TGL/ICL).
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2023-02-10 20:49:45 +01:00

35 lines
1.0 KiB
C++

/*
* Copyright (C) 2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/ail/ail_configuration.h"
#include "shared/test/common/test_macros/hw_test.h"
namespace NEO {
using AILBaseTests = ::testing::Test;
HWTEST2_F(AILBaseTests, whenKernelSourceIsANGenDummyKernelThenDoEnforcePatchtokensFormat, IsAtLeastSkl) {
std::string dummyKernelSource{"kernel void _(){}"};
bool enforceRebuildToCTNI = false;
AILConfigurationHw<productFamily> ail;
ail.forceFallbackToPatchtokensIfRequired(dummyKernelSource, enforceRebuildToCTNI);
EXPECT_TRUE(enforceRebuildToCTNI);
}
HWTEST2_F(AILBaseTests, whenKernelSourceIsNotANGenDummyKernelThenDoNotEnforcePatchtokensFormat, IsAtLeastSkl) {
std::string dummyKernelSource{"kernel void copybuffer(__global int* a, __global int* b){ //some code }"};
bool enforceRebuildToCTNI = false;
AILConfigurationHw<productFamily> ail;
ail.forceFallbackToPatchtokensIfRequired(dummyKernelSource, enforceRebuildToCTNI);
EXPECT_FALSE(enforceRebuildToCTNI);
}
} // namespace NEO