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

Fix CUDA errors in submdspan about int to size_t narrowing #350

Merged
merged 2 commits into from
Jul 3, 2024

Conversation

aprokop
Copy link
Contributor

@aprokop aprokop commented Jun 21, 2024

I was getting errors on CUDA 11.5.2 with GCC 9.3.0:

<snip>/kokkos/core/src/../../tpls/mdspan/include/mdspan/../experimental/__p2630_bits/submdspan_mapping.hpp(134): error: invalid narrowing conversion from "int" to "size_t"
<snip>/kokkos/core/src/../../tpls/mdspan/include/mdspan/../experimental/__p2630_bits/submdspan_mapping.hpp(364): error: invalid narrowing conversion from "int" to "size_t"

when building Kokkos develop (24454fa82).

I don't really know what I'm doing, so feel free to edit however you need. This fixes it for this particular build, but probably not the best way to go.

@aprokop aprokop changed the title Fix CUDA errors in submdspan about size_t to int narrowing Fix CUDA errors in submdspan about int to size_t narrowing Jun 21, 2024
Copy link
Contributor

@mhoemmen mhoemmen left a comment

Choose a reason for hiding this comment

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

LWG (in WG21) has expressed preference for integer literals (e.g., 0u or even 0UZ for a size_t literal) over casts. It's not a big deal, though.

@ndellingwood
Copy link
Contributor

@crtrott can this be merged and patched into Kokkos? Lots of warnings showing up in Cuda builds

Co-authored-by: Daniel Arndt <[email protected]>
@crtrott crtrott merged commit 98a12b0 into kokkos:stable Jul 3, 2024
15 checks passed
@aprokop aprokop deleted the fix_errors branch July 3, 2024 22:16
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.

5 participants