Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace spelled out logical operators: breaks Kokkos windows tests #344

Merged
merged 2 commits into from
Jun 14, 2024

Conversation

crtrott
Copy link
Member

@crtrott crtrott commented Jun 14, 2024

Errors such as:

D:\a\kokkos\kokkos\tpls\mdspan\include\experimental\__p0009_bits\utility.hpp(19): error : expected a "," [D:\a\kokkos\kokkos\build\core\src\kokkoscore.vcxproj]
      static_assert(std::is_integral<I1>::value and

@masterleinad
Copy link
Contributor

Alternatively, you could do

diff --git a/include/experimental/__p0009_bits/macros.hpp b/include/experimental/__p0009_bits/macros.hpp
index 30209a6..34e2528 100644
--- a/include/experimental/__p0009_bits/macros.hpp
+++ b/include/experimental/__p0009_bits/macros.hpp
@@ -25,6 +25,10 @@
 #include "assert.h"
 #endif
 
+#ifdef _MSC_VER
+#include <iso646.h>
+#endif
+
 #ifndef _MDSPAN_HOST_DEVICE
 #  if defined(_MDSPAN_HAS_CUDA) || defined(_MDSPAN_HAS_HIP)
 #    define _MDSPAN_HOST_DEVICE __host__ __device__

@crtrott
Copy link
Member Author

crtrott commented Jun 14, 2024

Let's avoid forcing default behavior change on downstream users.

Copy link
Member

@tpadioleau tpadioleau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include/experimental/__p0009_bits/layout_stride.hpp Outdated Show resolved Hide resolved
Copy link

@JBludau JBludau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all of them look correct to me

@mhoemmen
Copy link
Contributor

I was going to say that including <iso646.h> is the suggested option.

https://learn.microsoft.com/en-us/cpp/c-runtime-library/iso646-operators?view=msvc-170

The alternative spellings are required by the C++ Standard. Windows is nonconforming because it requires use of a header. That being said, I don't object to the proposed solution.

@crtrott
Copy link
Member Author

crtrott commented Jun 14, 2024

Including that thing is transitive though, do we really want to change the default behavior of MSVC for everyone downstream?

@crtrott crtrott merged commit 421d2c2 into kokkos:stable Jun 14, 2024
14 checks passed
@mhoemmen
Copy link
Contributor

Including that thing is transitive though, do we really want to change the default behavior of MSVC for everyone downstream?

Just FYI, including that header doesn't "change the default behavior of MSVC," it makes MSVC conform to the C++ Standard a bit better. That being said, I don't object to the proposed solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants