Skip to content

Commit 34dde6d

Browse files
michalpaszkowskiigcbot
authored andcommitted
Ignore OpEntryPoint in pure ESIMD modules
Return false from HasEntryPoints() when the module type is ESIMD, so only the SPMD part is treated as an entry-point module. Fixes the duplicate entry-point error in mixed SPMD+ESIMD builds.
1 parent 0339725 commit 34dde6d

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

IGC/VISALinkerDriver/VLD_SPIRVSplitter.cpp

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -144,30 +144,20 @@ SpvSplitter::Parse(const char *spv_buffer, uint32_t spv_buffer_size_in_bytes) {
144144
}
145145

146146
bool SpvSplitter::HasEntryPoints() const {
147-
auto CurSPIRVType = GetCurrentSPIRVType();
148-
if (entry_points_.size() == 0)
147+
if (GetCurrentSPIRVType() == SPIRVTypeEnum::SPIRV_ESIMD)
149148
return false;
150149

151-
bool AllEntryPointsAreSPMD =
152-
std::all_of(entry_points_.begin(), entry_points_.end(), [&](auto el) {
153-
return esimd_decorated_ids_.find(el) == esimd_decorated_ids_.end();
154-
});
155-
156-
bool AllEntryPointsAreESIMD =
157-
std::all_of(entry_points_.begin(), entry_points_.end(), [&](auto el) {
158-
return esimd_decorated_ids_.find(el) != esimd_decorated_ids_.end();
159-
});
160-
161-
if (CurSPIRVType == SPIRVTypeEnum::SPIRV_ESIMD && AllEntryPointsAreSPMD) {
150+
if (entry_points_.empty())
162151
return false;
163-
}
164152

165-
if (CurSPIRVType == SPIRVTypeEnum::SPIRV_SPMD && AllEntryPointsAreESIMD) {
166-
return false;
167-
}
153+
bool AllEntryPointsAreSPMD =
154+
std::all_of(entry_points_.begin(), entry_points_.end(),
155+
[&](auto id) { return !esimd_decorated_ids_.count(id); });
156+
bool AllEntryPointsAreESIMD = !AllEntryPointsAreSPMD;
168157

169-
// We currently do not support entry points in both parts.
170-
IGC_ASSERT(AllEntryPointsAreESIMD || AllEntryPointsAreSPMD);
158+
if (GetCurrentSPIRVType() == SPIRVTypeEnum::SPIRV_SPMD &&
159+
AllEntryPointsAreESIMD)
160+
return false;
171161

172162
return true;
173163
}

0 commit comments

Comments
 (0)