Skip to content

Commit 1fda2a3

Browse files
authored
[SYCL] Allow ESIMD backend only when explicitly set by ONEAPI_DEVICE_SELECTOR (#7336)
ONEAPI_DEVICE_SELECTOR would previously implicitly allow ESIMD backends . This isn't desired behavior; desired behavior is to only allow ESIMD backend only when explicitly specified by ONEAPI_DEVICE_SELECTOR. Fix suggested by @lbushi25 Signed-off-by: Rauf, Rana <[email protected]>
1 parent 276b3c2 commit 1fda2a3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sycl/source/detail/device_filter.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,13 @@ ods_target_list::ods_target_list(const std::string &envStr) {
237237
// 1. Filter backend is '*' which means ANY backend.
238238
// 2. Filter backend match exactly with the given 'Backend'
239239
bool ods_target_list::backendCompatible(backend Backend) {
240+
241+
bool isESIMD = Backend == backend::ext_intel_esimd_emulator;
240242
return std::any_of(
241243
TargetList.begin(), TargetList.end(), [&](ods_target &Target) {
242244
backend TargetBackend = Target.Backend.value_or(backend::all);
243-
return (TargetBackend == Backend) || (TargetBackend == backend::all);
245+
return (TargetBackend == Backend) ||
246+
(TargetBackend == backend::all && !isESIMD);
244247
});
245248
}
246249

0 commit comments

Comments
 (0)