Skip to content

Commit 2827893

Browse files
[SYCL] Fix unused variable warning detected by post-commit tests (#3884)
Fix post-commit after PR #3826
1 parent ce1c5a4 commit 2827893

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

sycl/source/detail/allowlist.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <detail/device_impl.hpp>
1212
#include <detail/platform_info.hpp>
1313

14+
#include <algorithm>
1415
#include <regex>
1516

1617
__SYCL_INLINE_NAMESPACE(cl) {
@@ -239,10 +240,14 @@ AllowListParsedT parseAllowList(const std::string &AllowListRaw) {
239240
// Checking if we can allow device with device description DeviceDesc
240241
bool deviceIsAllowed(const DeviceDescT &DeviceDesc,
241242
const AllowListParsedT &AllowListParsed) {
242-
for (const auto &SupportedKeyName : SupportedAllowListKeyNames)
243-
assert((DeviceDesc.find(SupportedKeyName) != DeviceDesc.end()) &&
244-
"DeviceDesc map should have all supported keys for "
245-
"SYCL_DEVICE_ALLOWLIST.");
243+
assert(std::all_of(SupportedAllowListKeyNames.begin(),
244+
SupportedAllowListKeyNames.end(),
245+
[&DeviceDesc](const auto &SupportedKeyName) {
246+
return DeviceDesc.find(SupportedKeyName) !=
247+
DeviceDesc.end();
248+
}) &&
249+
"DeviceDesc map should have all supported keys for "
250+
"SYCL_DEVICE_ALLOWLIST.");
246251
auto EqualityComp = [&](const std::string &KeyName,
247252
const DeviceDescT &AllowListDeviceDesc) {
248253
// change to map::contains after switching DPC++ RT to C++20

0 commit comments

Comments
 (0)