Skip to content

Commit f17feae

Browse files
Revert "fix: Check if provided CCS number is correct"
This reverts commit 94be802. Signed-off-by: Compute-Runtime-Validation <[email protected]> Source: fc62e02
1 parent 69ace3f commit f17feae

File tree

13 files changed

+27
-175
lines changed

13 files changed

+27
-175
lines changed

shared/source/execution_environment/execution_environment.cpp

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -354,10 +354,8 @@ void ExecutionEnvironment::adjustCcsCountImpl(RootDeviceEnvironment *rootDeviceE
354354
productHelper.adjustNumberOfCcs(*hwInfo);
355355
}
356356

357-
bool ExecutionEnvironment::adjustCcsCount() {
358-
if (!parseCcsCountLimitations()) {
359-
return false;
360-
}
357+
void ExecutionEnvironment::adjustCcsCount() {
358+
parseCcsCountLimitations();
361359

362360
for (auto rootDeviceIndex = 0u; rootDeviceIndex < rootDeviceEnvironments.size(); rootDeviceIndex++) {
363361
auto &rootDeviceEnvironment = rootDeviceEnvironments[rootDeviceIndex];
@@ -366,42 +364,32 @@ bool ExecutionEnvironment::adjustCcsCount() {
366364
adjustCcsCountImpl(rootDeviceEnvironment.get());
367365
}
368366
}
369-
370-
return true;
371367
}
372368

373-
bool ExecutionEnvironment::adjustCcsCount(const uint32_t rootDeviceIndex) const {
369+
void ExecutionEnvironment::adjustCcsCount(const uint32_t rootDeviceIndex) const {
374370
auto &rootDeviceEnvironment = rootDeviceEnvironments[rootDeviceIndex];
375371
UNRECOVERABLE_IF(!rootDeviceEnvironment);
376372
if (rootDeviceNumCcsMap.find(rootDeviceIndex) != rootDeviceNumCcsMap.end()) {
377-
if (!rootDeviceEnvironment->setNumberOfCcs(rootDeviceNumCcsMap.at(rootDeviceIndex))) {
378-
return false;
379-
}
373+
rootDeviceEnvironment->setNumberOfCcs(rootDeviceNumCcsMap.at(rootDeviceIndex));
380374
} else {
381375
adjustCcsCountImpl(rootDeviceEnvironment.get());
382376
}
383-
384-
return true;
385377
}
386378

387-
bool ExecutionEnvironment::parseCcsCountLimitations() {
379+
void ExecutionEnvironment::parseCcsCountLimitations() {
388380
const auto &numberOfCcsString = debugManager.flags.ZEX_NUMBER_OF_CCS.get();
389381

390382
if (numberOfCcsString.compare("default") == 0 ||
391383
numberOfCcsString.empty()) {
392-
return true;
384+
return;
393385
}
394386

395387
for (auto rootDeviceIndex = 0u; rootDeviceIndex < rootDeviceEnvironments.size(); rootDeviceIndex++) {
396388
auto &rootDeviceEnvironment = rootDeviceEnvironments[rootDeviceIndex];
397389
UNRECOVERABLE_IF(!rootDeviceEnvironment);
398390
auto &productHelper = rootDeviceEnvironment->getHelper<ProductHelper>();
399-
if (!productHelper.parseCcsMode(numberOfCcsString, rootDeviceNumCcsMap, rootDeviceIndex, rootDeviceEnvironment.get())) {
400-
return false;
401-
}
391+
productHelper.parseCcsMode(numberOfCcsString, rootDeviceNumCcsMap, rootDeviceIndex, rootDeviceEnvironment.get());
402392
}
403-
404-
return true;
405393
}
406394

407395
void ExecutionEnvironment::configureNeoEnvironment() {

shared/source/execution_environment/execution_environment.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ class ExecutionEnvironment : public ReferenceTrackedObject<ExecutionEnvironment>
3737
virtual void prepareRootDeviceEnvironments(uint32_t numRootDevices);
3838
void prepareRootDeviceEnvironment(const uint32_t rootDeviceIndexForReInit);
3939
void parseAffinityMask();
40-
bool adjustCcsCount();
41-
bool adjustCcsCount(const uint32_t rootDeviceIndex) const;
40+
void adjustCcsCount();
41+
void adjustCcsCount(const uint32_t rootDeviceIndex) const;
4242
void sortNeoDevices();
4343
void setDeviceHierarchyMode(const GfxCoreHelper &gfxCoreHelper);
4444
void setDeviceHierarchyMode(const DeviceHierarchyMode deviceHierarchyMode) {
@@ -47,7 +47,7 @@ class ExecutionEnvironment : public ReferenceTrackedObject<ExecutionEnvironment>
4747
DeviceHierarchyMode getDeviceHierarchyMode() const { return deviceHierarchyMode; }
4848
void adjustRootDeviceEnvironments();
4949
void prepareForCleanup() const;
50-
MOCKABLE_VIRTUAL void configureCcsMode();
50+
void configureCcsMode();
5151
void setDebuggingMode(DebuggingMode debuggingMode) {
5252
debuggingEnabledMode = debuggingMode;
5353
}
@@ -97,7 +97,7 @@ class ExecutionEnvironment : public ReferenceTrackedObject<ExecutionEnvironment>
9797

9898
protected:
9999
static bool comparePciIdBusNumber(std::unique_ptr<RootDeviceEnvironment> &rootDeviceEnvironment1, std::unique_ptr<RootDeviceEnvironment> &rootDeviceEnvironment2);
100-
bool parseCcsCountLimitations();
100+
void parseCcsCountLimitations();
101101
void adjustCcsCountImpl(RootDeviceEnvironment *rootDeviceEnvironment) const;
102102
void configureNeoEnvironment();
103103
void restoreCcsMode();

shared/source/execution_environment/root_device_environment.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -246,19 +246,12 @@ BuiltIns *RootDeviceEnvironment::getBuiltIns() {
246246
return this->builtins.get();
247247
}
248248

249-
bool RootDeviceEnvironment::setNumberOfCcs(uint32_t numberOfCcs) {
250-
if (hwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled < numberOfCcs || numberOfCcs == 0) {
251-
NEO::printDebugString(NEO::debugManager.flags.PrintDebugMessages.get(), stderr, "Error: Invalid number of CCS: %u. Maximum available number of CCS: %u\n", numberOfCcs, hwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled);
252-
return false;
253-
}
254-
255-
hwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled = numberOfCcs;
249+
void RootDeviceEnvironment::setNumberOfCcs(uint32_t numberOfCcs) {
250+
hwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled = std::min(hwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled, numberOfCcs);
256251
limitedNumberOfCcs = true;
257252
if (aubCenter) {
258253
aubCenter->getAubManager()->setCCSMode(hwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled);
259254
}
260-
261-
return true;
262255
}
263256

264257
uint32_t RootDeviceEnvironment::getNumberOfCcs() const {

shared/source/execution_environment/root_device_environment.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ struct RootDeviceEnvironment : NonCopyableClass {
8181
BindlessHeapsHelper *getBindlessHeapsHelper() const;
8282
AssertHandler *getAssertHandler(Device *neoDevice);
8383
void createBindlessHeapsHelper(Device *rootDevice, bool availableDevices);
84-
bool setNumberOfCcs(uint32_t numberOfCcs);
84+
void setNumberOfCcs(uint32_t numberOfCcs);
8585
uint32_t getNumberOfCcs() const;
8686
bool isNumberOfCcsLimited() const;
8787
void setRcsExposure();

shared/source/os_interface/device_factory.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,7 @@ bool DeviceFactory::prepareDeviceEnvironmentsForProductFamilyOverride(ExecutionE
164164

165165
executionEnvironment.setDeviceHierarchyMode(executionEnvironment.rootDeviceEnvironments[0]->getHelper<GfxCoreHelper>());
166166
executionEnvironment.parseAffinityMask();
167-
if (!executionEnvironment.adjustCcsCount()) {
168-
return false;
169-
}
167+
executionEnvironment.adjustCcsCount();
170168
executionEnvironment.calculateMaxOsContextCount();
171169
return true;
172170
}
@@ -274,9 +272,7 @@ bool DeviceFactory::prepareDeviceEnvironments(ExecutionEnvironment &executionEnv
274272
executionEnvironment.sortNeoDevices();
275273
executionEnvironment.parseAffinityMask();
276274
executionEnvironment.adjustRootDeviceEnvironments();
277-
if (!executionEnvironment.adjustCcsCount()) {
278-
return false;
279-
}
275+
executionEnvironment.adjustCcsCount();
280276
executionEnvironment.calculateMaxOsContextCount();
281277

282278
return true;
@@ -298,9 +294,7 @@ bool DeviceFactory::prepareDeviceEnvironment(ExecutionEnvironment &executionEnvi
298294
return false;
299295
}
300296

301-
if (!executionEnvironment.adjustCcsCount(rootDeviceIndex)) {
302-
return false;
303-
}
297+
executionEnvironment.adjustCcsCount(rootDeviceIndex);
304298
return true;
305299
}
306300

shared/source/os_interface/product_helper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class ProductHelper {
227227
virtual void fillPipelineSelectPropertiesSupportStructure(PipelineSelectPropertiesSupport &propertiesSupport, const HardwareInfo &hwInfo) const = 0;
228228
virtual void fillStateBaseAddressPropertiesSupportStructure(StateBaseAddressPropertiesSupport &propertiesSupport) const = 0;
229229

230-
virtual bool parseCcsMode(std::string ccsModeString, std::unordered_map<uint32_t, uint32_t> &rootDeviceNumCcsMap, uint32_t rootDeviceIndex, RootDeviceEnvironment *rootDeviceEnvironment) const = 0;
230+
virtual void parseCcsMode(std::string ccsModeString, std::unordered_map<uint32_t, uint32_t> &rootDeviceNumCcsMap, uint32_t rootDeviceIndex, RootDeviceEnvironment *rootDeviceEnvironment) const = 0;
231231

232232
virtual bool isFusedEuDisabledForDpas(bool kernelHasDpasInstructions, const uint32_t *lws, const uint32_t *groupCount, const HardwareInfo &hwInfo) const = 0;
233233
virtual bool isCalculationForDisablingEuFusionWithDpasNeeded(const HardwareInfo &hwInfo) const = 0;

shared/source/os_interface/product_helper.inl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -715,16 +715,12 @@ void ProductHelperHw<gfxProduct>::fillStateBaseAddressPropertiesSupportStructure
715715
}
716716

717717
template <PRODUCT_FAMILY gfxProduct>
718-
bool ProductHelperHw<gfxProduct>::parseCcsMode(std::string ccsModeString, std::unordered_map<uint32_t, uint32_t> &rootDeviceNumCcsMap, uint32_t rootDeviceIndex, RootDeviceEnvironment *rootDeviceEnvironment) const {
718+
void ProductHelperHw<gfxProduct>::parseCcsMode(std::string ccsModeString, std::unordered_map<uint32_t, uint32_t> &rootDeviceNumCcsMap, uint32_t rootDeviceIndex, RootDeviceEnvironment *rootDeviceEnvironment) const {
719719

720720
auto ccsCount = StringHelpers::toUint32t(ccsModeString);
721721

722722
rootDeviceNumCcsMap.insert({rootDeviceIndex, ccsCount});
723-
if (!rootDeviceEnvironment->setNumberOfCcs(ccsCount)) {
724-
return false;
725-
}
726-
727-
return true;
723+
rootDeviceEnvironment->setNumberOfCcs(ccsCount);
728724
}
729725

730726
template <PRODUCT_FAMILY gfxProduct>

shared/source/os_interface/product_helper_hw.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class ProductHelperHw : public ProductHelper {
165165
void fillFrontEndPropertiesSupportStructure(FrontEndPropertiesSupport &propertiesSupport, const HardwareInfo &hwInfo) const override;
166166
void fillPipelineSelectPropertiesSupportStructure(PipelineSelectPropertiesSupport &propertiesSupport, const HardwareInfo &hwInfo) const override;
167167
void fillStateBaseAddressPropertiesSupportStructure(StateBaseAddressPropertiesSupport &propertiesSupport) const override;
168-
bool parseCcsMode(std::string ccsModeString, std::unordered_map<uint32_t, uint32_t> &rootDeviceNumCcsMap, uint32_t rootDeviceIndex, RootDeviceEnvironment *rootDeviceEnvironment) const override;
168+
void parseCcsMode(std::string ccsModeString, std::unordered_map<uint32_t, uint32_t> &rootDeviceNumCcsMap, uint32_t rootDeviceIndex, RootDeviceEnvironment *rootDeviceEnvironment) const override;
169169

170170
bool isFusedEuDisabledForDpas(bool kernelHasDpasInstructions, const uint32_t *lws, const uint32_t *groupCount, const HardwareInfo &hwInfo) const override;
171171
bool isCalculationForDisablingEuFusionWithDpasNeeded(const HardwareInfo &hwInfo) const override;

shared/source/xe_hpc_core/pvc/os_agnostic_product_helper_pvc.inl

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -153,28 +153,21 @@ bool ProductHelperHw<gfxProduct>::isBlitCopyRequiredForLocalMemory(const RootDev
153153
}
154154

155155
template <>
156-
bool ProductHelperHw<gfxProduct>::parseCcsMode(std::string ccsModeString, std::unordered_map<uint32_t, uint32_t> &rootDeviceNumCcsMap, uint32_t rootDeviceIndex, RootDeviceEnvironment *rootDeviceEnvironment) const {
156+
void ProductHelperHw<gfxProduct>::parseCcsMode(std::string ccsModeString, std::unordered_map<uint32_t, uint32_t> &rootDeviceNumCcsMap, uint32_t rootDeviceIndex, RootDeviceEnvironment *rootDeviceEnvironment) const {
157157
auto numberOfCcsEntries = StringHelpers::split(ccsModeString, ",");
158158

159159
for (const auto &entry : numberOfCcsEntries) {
160160
auto subEntries = StringHelpers::split(entry, ":");
161-
if (subEntries.size() < 2) {
162-
NEO::printDebugString(NEO::debugManager.flags.PrintDebugMessages.get(), stderr, "Error: Invalid ZEX_NUMBER_OF_CCS format '%s'\n", ccsModeString.c_str());
163-
return false;
164-
}
165-
166161
uint32_t rootDeviceIndexParsed = StringHelpers::toUint32t(subEntries[0]);
167162

168163
if (rootDeviceIndexParsed == rootDeviceIndex) {
169-
uint32_t maxCcsCount = StringHelpers::toUint32t(subEntries[1]);
170-
rootDeviceNumCcsMap.insert({rootDeviceIndex, maxCcsCount});
171-
if (!rootDeviceEnvironment->setNumberOfCcs(maxCcsCount)) {
172-
return false;
164+
if (subEntries.size() > 1) {
165+
uint32_t maxCcsCount = StringHelpers::toUint32t(subEntries[1]);
166+
rootDeviceNumCcsMap.insert({rootDeviceIndex, maxCcsCount});
167+
rootDeviceEnvironment->setNumberOfCcs(maxCcsCount);
173168
}
174169
}
175170
}
176-
177-
return true;
178171
}
179172

180173
template <>

shared/test/common/mocks/mock_execution_environment.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,4 @@ void MockExecutionEnvironment::initGmm() {
9191
}
9292
}
9393

94-
void MockExecutionEnvironment::addToRootDeviceNumCcsMap(uint32_t rootDeviceIndex, uint32_t numCcs) {
95-
this->rootDeviceNumCcsMap.insert({rootDeviceIndex, numCcs});
96-
}
97-
9894
} // namespace NEO

0 commit comments

Comments
 (0)