Skip to content

Commit 00eb54c

Browse files
committed
Silence weird warning on Windows
1 parent b8519cb commit 00eb54c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sycl/include/sycl/ext/oneapi/experimental/device_architecture.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,12 @@ static constexpr ext::oneapi::experimental::architecture
355355
// target name is specified via "-fsycl-targets", the associated invocation of
356356
// the device compiler will set this variable to false, and that will trigger
357357
// an error for code that uses "if_architecture_is".
358+
#pragma warning(push)
359+
// By some reason the following diagnostic is emitted which breaks -Werror (/WX)
360+
// build. Preprocessed code looks like (0 == 1) || (0 == 1) || ..., so it looks
361+
// like a bug in the MSVC compiler, hence disabling it.
362+
// (<non-zero constant> || <non-zero constant>) is always a non-zero constant. Did you intend to use the bitwise-and operator?
363+
#pragma warning(disable: 6285)
358364
static constexpr bool is_allowable_aot_mode =
359365
(__SYCL_TARGET_INTEL_X86_64__ == 1) ||
360366
(__SYCL_TARGET_INTEL_GPU_BDW__ == 1) ||
@@ -443,6 +449,7 @@ static constexpr bool is_allowable_aot_mode =
443449
(__SYCL_TARGET_AMD_GPU_GFX1151__ == 1) ||
444450
(__SYCL_TARGET_AMD_GPU_GFX1200__ == 1) ||
445451
(__SYCL_TARGET_AMD_GPU_GFX1201__ == 1);
452+
#pragma warning(pop)
446453

447454
constexpr static std::optional<ext::oneapi::experimental::architecture>
448455
get_current_architecture_aot() {

0 commit comments

Comments
 (0)