diff --git a/sycl/source/detail/allowlist.cpp b/sycl/source/detail/allowlist.cpp index a684e905194ef..936d6072939a2 100644 --- a/sycl/source/detail/allowlist.cpp +++ b/sycl/source/detail/allowlist.cpp @@ -11,6 +11,7 @@ #include #include +#include #include __SYCL_INLINE_NAMESPACE(cl) { @@ -239,10 +240,14 @@ AllowListParsedT parseAllowList(const std::string &AllowListRaw) { // Checking if we can allow device with device description DeviceDesc bool deviceIsAllowed(const DeviceDescT &DeviceDesc, const AllowListParsedT &AllowListParsed) { - for (const auto &SupportedKeyName : SupportedAllowListKeyNames) - assert((DeviceDesc.find(SupportedKeyName) != DeviceDesc.end()) && - "DeviceDesc map should have all supported keys for " - "SYCL_DEVICE_ALLOWLIST."); + assert(std::all_of(SupportedAllowListKeyNames.begin(), + SupportedAllowListKeyNames.end(), + [&DeviceDesc](const auto &SupportedKeyName) { + return DeviceDesc.find(SupportedKeyName) != + DeviceDesc.end(); + }) && + "DeviceDesc map should have all supported keys for " + "SYCL_DEVICE_ALLOWLIST."); auto EqualityComp = [&](const std::string &KeyName, const DeviceDescT &AllowListDeviceDesc) { // change to map::contains after switching DPC++ RT to C++20