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

Kokkos_Cuda.hpp: Fix shadow warning with cuda/11.0 #4252

Merged
merged 1 commit into from
Aug 19, 2021

Conversation

ndellingwood
Copy link
Contributor

The shadow warning triggered -Werror compilation errors in cuda/11.0 nightly builds for example with configuration:

$KOKKOS_PATH/generate_makefile.bash --with-devices=Cuda,Serial --arch=SNB,Volta70 --compiler=$KOKKOS_PATH/bin/nvcc_wrapper --cxxflags="-O3 -Wall -Wunused-parameter -Wshadow -pedantic -Werror -Wsign-compare -Wtype-limits -Wuninitialized " --cxxstandard="17" --kokkos-path=$KOKKOS_PATH --with-cuda-options=enable_lambda  --no-examples

@ndellingwood
Copy link
Contributor Author

Hip-ROCm-4.2-C++17 build error seems to be CI glitch:

ERROR: The container started but didn't run the expected command. Please double check your ENTRYPOINT does execute the command passed as docker run argument, as required by official docker images (see https://github.com/docker-library/official-images#consistency for entrypoint consistency requirements).
Alternatively you can force image entrypoint to be disabled by adding option `--entrypoint=''`.

@ndellingwood
Copy link
Contributor Author

retest this please

@dalg24
Copy link
Member

dalg24 commented Aug 19, 2021

I fail to see what would be shadowed by this parameter name. Would you post the warning that was emitted?

@ndellingwood
Copy link
Contributor Author

I fail to see what would be shadowed by this parameter name. Would you post the warning that was emitted?

@dalg24 sure, I should've done so with the PR. The warning was strange to me, occurs with cuda/11.0+gcc/9.3.0, does not happen in other builds with older cuda versions or cuda/11.1+gcc/8.3.0

21:24:42 /home/jenkins/jenkins-new/workspace/Kokkos_develop_kokkosdev2_cuda110_gcc920_cpp17/kokkos/core/src/Kokkos_Cuda.hpp:288:1: error: declaration of ‘exec_space’ shadows a global declaration [-Werror=shadow]
21:24:42   288 |   }
21:24:42       | ^
21:24:42 /home/jenkins/jenkins-new/workspace/Kokkos_develop_kokkosdev2_cuda110_gcc920_cpp17/kokkos/core/perf_test/test_atomic_minmax_simple.cpp:17:7: note: shadowed declaration is here
21:24:42    17 | using exec_space = Kokkos::DefaultExecutionSpace;
21:24:42       |       ^~~~~~~~~~

@dalg24
Copy link
Member

dalg24 commented Aug 19, 2021

Thank you

@dalg24 dalg24 merged commit 3f94f9c into kokkos:develop Aug 19, 2021
@ndellingwood ndellingwood deleted the fix-shadowwarning branch August 19, 2021 17:46
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.

None yet

4 participants