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

WIP: Updated mdspan #801

Closed
wants to merge 5 commits into from
Closed

WIP: Updated mdspan #801

wants to merge 5 commits into from

Conversation

brryan
Copy link
Contributor

@brryan brryan commented Apr 13, 2020

Background

Purpose of Pull Request

Description of changes

  • Download the latest version of mdspan for the kokkos github and update src/experimental in Draco

Status

@brryan brryan added the bug label Apr 13, 2020
@brryan brryan added this to the Draco-7_7_0 milestone Apr 13, 2020
@brryan brryan requested a review from KineticTheory April 13, 2020 21:39
@brryan brryan self-assigned this Apr 13, 2020
Copy link
Collaborator

@KineticTheory KineticTheory left a comment

Choose a reason for hiding this comment

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

We need to keep the encompassing compiler pragmas in to avoid build errors. No need to fix these issues as they don't belong to us.

#pragma clang diagnostic ignored "-Wunused-parameter"
#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
Copy link
Collaborator

Choose a reason for hiding this comment

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

We added all of the above suppressions. Probably should keep these. You may need to add a new one for gcc.

#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Werror=undef"
#endif

[original content of mdspan goes here]

#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif

Copy link
Collaborator

Choose a reason for hiding this comment

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

Optionally, create a new file mdspan_wrapper.hh that contains all of these pragmas and has one line of code: #include <experimental/mdspan. This might might updating mdspan easier.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since a separate wrapper header file will I think require one of (1) switching #include <mdspan> (which is nice because it mimics future STL behavior) with #include <mdspan_wrapper> (2) changing the kokkos/mdspan mdspanto e.g.mdspan_wrappedand including this in a newmdspan` file, I'm in favor of just leaving things the way they are now. Also I now know how to re-add the compiler guards (which may anyways change with future versions of mdspan...)


#ifdef _MSC_FULL_VER
#pragma warning(pop)
#endif
Copy link
Collaborator

Choose a reason for hiding this comment

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

We need to keep these pop pragmas (plus add the gnu one that I mentioned above).

@@ -45,20 +45,22 @@

#include "macros.hpp"

#include <cstddef>
#include <cstddef> // ptrdiff_t
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did you process these with clang-format? If so, that is fine. I'm also okay with adding a pragma to tell clang-format to ignore the file. Ref: https://philwrightdev.wordpress.com/2014/10/01/making-clang-format-ignore-sections/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Preserving our discussion on mattermost here: clang-format'ing this version of kokkos/mdspan appears to cause compiler errors. So format checking is now disabled for experimental with a .clang-format

@@ -56,9 +56,13 @@
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif

#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Werror=undef"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be -Wundef.

The error message is confusing because we also have -Werror that converts warning to errors for the CI to capture.

@KineticTheory
Copy link
Collaborator

There are fatal bugs in the new mdspan wrt compiling with gcc-8.1.0. See kokkos/mdspan#21 and associated issue kokkos/mdspan#20. You can merge my diff into draco or wait for kokkos/mdspan to fix this issue.

@KineticTheory
Copy link
Collaborator

KineticTheory commented Apr 14, 2020

It looks like Visual Studio also has major issues with the new version of mdspan. I'm digging into it. The errors are significant and beyond my ability to debug. We may have to pass on this version.

We may want to find the new #ifdef __INTEL_COMPILER sections and pull those into the previous version of mdspan.

@brryan
Copy link
Contributor Author

brryan commented Apr 14, 2020

My thinking is it would be best to wait for these fixes to go into kokkos/mdspan so we can reference a specific commit of theirs. If we need intel 17 + CPT in the near future and the VS errors are challenging, maybe the thing to do will be to patch in manually unrolled dimensional indexing to the Draco tabulated DEDX reader for now.

@KineticTheory
Copy link
Collaborator

My thinking is it would be best to wait for these fixes to go into kokkos/mdspan so we can reference a specific commit of theirs. If we need intel 17 + CPT in the near future and the VS errors are challenging, maybe the thing to do will be to patch in manually unrolled dimensional indexing to the Draco tabulated DEDX reader for now.

I agree. Let's put this PR on hold.

@KineticTheory KineticTheory changed the title Updated mdspan WIP: Updated mdspan Apr 14, 2020
@KineticTheory KineticTheory mentioned this pull request Apr 28, 2020
6 tasks
@KineticTheory
Copy link
Collaborator

Replaced by #814

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

Successfully merging this pull request may close these issues.

Update mdspan to match upstream
2 participants