refactor: unify programming of preferred slm size 2/n
- add interface that will provide all preferred slm sizes for all releases Related-To: NEO-12639 Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
parent
e240dca7cd
commit
8687a88d06
|
@ -20,6 +20,7 @@ set(NEO_CORE_COMMAND_CONTAINER
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/implicit_scaling.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/implicit_scaling.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/implicit_scaling_before_xe_hp.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/definitions/encode_size_preferred_slm_value.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/definitions/encode_surface_state_args_base.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/definitions${BRANCH_DIR_SUFFIX}encode_surface_state.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/definitions${BRANCH_DIR_SUFFIX}encode_surface_state_args.h
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
* Copyright (C) 2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace NEO {
|
||||
struct SizeToPreferredSlmValue {
|
||||
uint32_t upperLimit;
|
||||
uint32_t valueToProgram;
|
||||
};
|
||||
} // namespace NEO
|
|
@ -7,9 +7,11 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "shared/source/command_container/definitions/encode_size_preferred_slm_value.h"
|
||||
#include "shared/source/helpers/hw_ip_version.h"
|
||||
#include "shared/source/utilities/stackvec.h"
|
||||
|
||||
#include <array>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
@ -25,6 +27,7 @@ using createReleaseHelperFunctionType = std::unique_ptr<ReleaseHelper> (*)(Hardw
|
|||
inline createReleaseHelperFunctionType *releaseHelperFactory[maxArchitecture]{};
|
||||
|
||||
using ThreadsPerEUConfigs = StackVec<uint32_t, 6>;
|
||||
using SizeToPreferredSlmValueArray = std::array<SizeToPreferredSlmValue, 12>;
|
||||
|
||||
class ReleaseHelper {
|
||||
public:
|
||||
|
@ -60,6 +63,7 @@ class ReleaseHelper {
|
|||
virtual uint32_t getAdditionalExtraCaps() const = 0;
|
||||
virtual bool isLocalOnlyAllowed() const = 0;
|
||||
virtual bool isMidThreadPreemptionDisallowedForRayTracingKernels() const = 0;
|
||||
virtual const SizeToPreferredSlmValueArray &getSizeToPreferredSlmValue(bool isHeapless) const = 0;
|
||||
|
||||
protected:
|
||||
ReleaseHelper(HardwareIpVersion hardwareIpVersion) : hardwareIpVersion(hardwareIpVersion) {}
|
||||
|
@ -102,6 +106,7 @@ class ReleaseHelperHw : public ReleaseHelper {
|
|||
uint32_t getAdditionalExtraCaps() const override;
|
||||
bool isLocalOnlyAllowed() const override;
|
||||
bool isMidThreadPreemptionDisallowedForRayTracingKernels() const override;
|
||||
const SizeToPreferredSlmValueArray &getSizeToPreferredSlmValue(bool isHeapless) const override;
|
||||
|
||||
protected:
|
||||
ReleaseHelperHw(HardwareIpVersion hardwareIpVersion) : ReleaseHelper(hardwareIpVersion) {}
|
||||
|
|
|
@ -162,4 +162,10 @@ bool ReleaseHelperHw<releaseType>::isMidThreadPreemptionDisallowedForRayTracingK
|
|||
return false;
|
||||
}
|
||||
|
||||
template <ReleaseType releaseType>
|
||||
const SizeToPreferredSlmValueArray &ReleaseHelperHw<releaseType>::getSizeToPreferredSlmValue(bool isHeapless) const {
|
||||
static const SizeToPreferredSlmValueArray sizeToPreferredSlmValue = {};
|
||||
return sizeToPreferredSlmValue;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
|
|
@ -43,5 +43,9 @@ class MockReleaseHelper : public ReleaseHelper {
|
|||
ADDMETHOD_CONST_NOBASE(getAdditionalExtraCaps, uint32_t, {}, ());
|
||||
ADDMETHOD_CONST_NOBASE(isLocalOnlyAllowed, bool, {}, ());
|
||||
ADDMETHOD_CONST_NOBASE(isMidThreadPreemptionDisallowedForRayTracingKernels, bool, false, ());
|
||||
const SizeToPreferredSlmValueArray &getSizeToPreferredSlmValue(bool isHeapless) const override {
|
||||
static SizeToPreferredSlmValueArray sizeToPreferredSlmValue = {};
|
||||
return sizeToPreferredSlmValue;
|
||||
}
|
||||
};
|
||||
} // namespace NEO
|
||||
|
|
|
@ -71,6 +71,11 @@ TEST_F(ReleaseHelper1255Tests, whenGettingAdditionalFp16AtomicCapabilitiesThenRe
|
|||
TEST_F(ReleaseHelper1255Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
|
||||
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1255Tests, whenIsLocalOnlyAllowedCalledThenTrueReturned) {
|
||||
whenIsLocalOnlyAllowedCalledThenTrueReturned();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1255Tests, whenGettingPreferredSlmSizeThenAllEntriesEmpty) {
|
||||
whenGettingPreferredSlmSizeThenAllEntriesEmpty();
|
||||
}
|
||||
|
|
|
@ -71,6 +71,11 @@ TEST_F(ReleaseHelper1256Tests, whenGettingAdditionalFp16AtomicCapabilitiesThenRe
|
|||
TEST_F(ReleaseHelper1256Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
|
||||
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1256Tests, whenIsLocalOnlyAllowedCalledThenTrueReturned) {
|
||||
whenIsLocalOnlyAllowedCalledThenTrueReturned();
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1256Tests, whenGettingPreferredSlmSizeThenAllEntriesEmpty) {
|
||||
whenGettingPreferredSlmSizeThenAllEntriesEmpty();
|
||||
}
|
||||
|
|
|
@ -71,6 +71,11 @@ TEST_F(ReleaseHelper1257Tests, whenGettingAdditionalFp16AtomicCapabilitiesThenRe
|
|||
TEST_F(ReleaseHelper1257Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
|
||||
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1257Tests, whenIsLocalOnlyAllowedCalledThenTrueReturned) {
|
||||
whenIsLocalOnlyAllowedCalledThenTrueReturned();
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1257Tests, whenGettingPreferredSlmSizeThenAllEntriesEmpty) {
|
||||
whenGettingPreferredSlmSizeThenAllEntriesEmpty();
|
||||
}
|
||||
|
|
|
@ -55,4 +55,8 @@ TEST_F(ReleaseHelper1260Tests, whenGettingAdditionalExtraKernelCapabilitiesThenR
|
|||
|
||||
TEST_F(ReleaseHelper1260Tests, whenIsLocalOnlyAllowedCalledThenTrueReturned) {
|
||||
whenIsLocalOnlyAllowedCalledThenTrueReturned();
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1260Tests, whenGettingPreferredSlmSizeThenAllEntriesEmpty) {
|
||||
whenGettingPreferredSlmSizeThenAllEntriesEmpty();
|
||||
}
|
||||
|
|
|
@ -54,4 +54,8 @@ TEST_F(ReleaseHelper1261Tests, whenGettingAdditionalExtraKernelCapabilitiesThenR
|
|||
|
||||
TEST_F(ReleaseHelper1261Tests, whenIsLocalOnlyAllowedCalledThenTrueReturned) {
|
||||
whenIsLocalOnlyAllowedCalledThenTrueReturned();
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1261Tests, whenGettingPreferredSlmSizeThenAllEntriesEmpty) {
|
||||
whenGettingPreferredSlmSizeThenAllEntriesEmpty();
|
||||
}
|
||||
|
|
|
@ -86,6 +86,11 @@ TEST_F(ReleaseHelper1270Tests, whenGettingAdditionalFp16AtomicCapabilitiesThenRe
|
|||
TEST_F(ReleaseHelper1270Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
|
||||
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1270Tests, whenIsLocalOnlyAllowedCalledThenTrueReturned) {
|
||||
whenIsLocalOnlyAllowedCalledThenTrueReturned();
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1270Tests, whenGettingPreferredSlmSizeThenAllEntriesEmpty) {
|
||||
whenGettingPreferredSlmSizeThenAllEntriesEmpty();
|
||||
}
|
||||
|
|
|
@ -87,6 +87,11 @@ TEST_F(ReleaseHelper1271Tests, whenGettingAdditionalFp16AtomicCapabilitiesThenRe
|
|||
TEST_F(ReleaseHelper1271Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
|
||||
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1271Tests, whenIsLocalOnlyAllowedCalledThenTrueReturned) {
|
||||
whenIsLocalOnlyAllowedCalledThenTrueReturned();
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1271Tests, whenGettingPreferredSlmSizeThenAllEntriesEmpty) {
|
||||
whenGettingPreferredSlmSizeThenAllEntriesEmpty();
|
||||
}
|
||||
|
|
|
@ -70,6 +70,11 @@ TEST_F(ReleaseHelper1274Tests, whenGettingAdditionalFp16AtomicCapabilitiesThenRe
|
|||
TEST_F(ReleaseHelper1274Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
|
||||
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1274Tests, whenIsLocalOnlyAllowedCalledThenTrueReturned) {
|
||||
whenIsLocalOnlyAllowedCalledThenTrueReturned();
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1274Tests, whenGettingPreferredSlmSizeThenAllEntriesEmpty) {
|
||||
whenGettingPreferredSlmSizeThenAllEntriesEmpty();
|
||||
}
|
||||
|
|
|
@ -74,3 +74,7 @@ TEST_F(ReleaseHelper2001Tests, whenGettingAdditionalExtraKernelCapabilitiesThenR
|
|||
TEST_F(ReleaseHelper2001Tests, whenIsLocalOnlyAllowedCalledThenFalseReturned) {
|
||||
whenIsLocalOnlyAllowedCalledThenFalseReturned();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper2001Tests, whenGettingPreferredSlmSizeThenAllEntriesEmpty) {
|
||||
whenGettingPreferredSlmSizeThenAllEntriesEmpty();
|
||||
}
|
||||
|
|
|
@ -91,6 +91,11 @@ TEST_F(ReleaseHelper2004Tests, whenGettingAdditionalFp16AtomicCapabilitiesThenRe
|
|||
TEST_F(ReleaseHelper2004Tests, whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities) {
|
||||
whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper2004Tests, whenIsLocalOnlyAllowedCalledThenFalseReturned) {
|
||||
whenIsLocalOnlyAllowedCalledThenFalseReturned();
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper2004Tests, whenGettingPreferredSlmSizeThenAllEntriesEmpty) {
|
||||
whenGettingPreferredSlmSizeThenAllEntriesEmpty();
|
||||
}
|
||||
|
|
|
@ -120,4 +120,18 @@ void ReleaseHelperTestsBase::whenIsLocalOnlyAllowedCalledThenFalseReturned() {
|
|||
|
||||
EXPECT_FALSE(releaseHelper->isLocalOnlyAllowed());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ReleaseHelperTestsBase::whenGettingPreferredSlmSizeThenAllEntriesEmpty() {
|
||||
for (auto &revision : getRevisions()) {
|
||||
ipVersion.revision = revision;
|
||||
releaseHelper = ReleaseHelper::create(ipVersion);
|
||||
ASSERT_NE(nullptr, releaseHelper);
|
||||
|
||||
auto &preferredSlmValueArray = releaseHelper->getSizeToPreferredSlmValue(false);
|
||||
for (const auto &elem : preferredSlmValueArray) {
|
||||
EXPECT_EQ(0u, elem.upperLimit);
|
||||
EXPECT_EQ(0u, elem.valueToProgram);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ struct ReleaseHelperTestsBase : public ::testing::Test {
|
|||
void whenGettingAdditionalExtraKernelCapabilitiesThenReturnNoCapabilities();
|
||||
void whenIsLocalOnlyAllowedCalledThenTrueReturned();
|
||||
void whenIsLocalOnlyAllowedCalledThenFalseReturned();
|
||||
|
||||
void whenGettingPreferredSlmSizeThenAllEntriesEmpty();
|
||||
virtual std::vector<uint32_t> getRevisions() = 0;
|
||||
|
||||
std::unique_ptr<ReleaseHelper> releaseHelper;
|
||||
|
|
Loading…
Reference in New Issue