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

Fixed an incorrect struct initialization #5028

Merged
merged 1 commit into from
May 17, 2022

Conversation

ldh4
Copy link
Contributor

@ldh4 ldh4 commented May 17, 2022

Building Kokkos for a HIP build with -DKokkos_ENABLE_HIP_RELOCATABLE_DEVICE_CODE=ON produced an error:

[  4%] Building CXX object core/src/CMakeFiles/kokkoscore.dir/desul/src/Lock_Array_HIP.cpp.o
/ascldap/users/donlee/kokkos/kokkos/core/src/HIP/Kokkos_HIP_Locks.cpp:60:67: error: cannot initialize a member subobject of type 'std::int32_t' (aka 'int') with an rvalue of type 'nullptr_t'
                                                                  nullptr, 0};
                                                                  ^~~~~~~
1 error generated when compiling for gfx908.

It turned out that there was a HIPLockArrays struct variable that was being initialized incorrectly.

@dalg24 dalg24 requested a review from Rombur May 17, 2022 19:33
@@ -56,8 +56,7 @@ namespace Kokkos {

#ifdef KOKKOS_ENABLE_HIP_RELOCATABLE_DEVICE_CODE
namespace Impl {
__device__ __constant__ HIPLockArrays g_device_hip_lock_arrays = {nullptr,
nullptr, 0};
__device__ __constant__ HIPLockArrays g_device_hip_lock_arrays = {nullptr, 0};
Copy link
Member

Choose a reason for hiding this comment

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

For reference

struct HIPLockArrays {
std::int32_t* atomic;
std::int32_t n;
};

@dalg24 dalg24 added the Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos) label May 17, 2022
@dalg24
Copy link
Member

dalg24 commented May 17, 2022

Bug was introduced in #4371

@dalg24
Copy link
Member

dalg24 commented May 17, 2022

This needs to be cherry picked in the patch release

@dalg24
Copy link
Member

dalg24 commented May 17, 2022

NVHPC failure is the issue reported in #5025

49: [ RUN      ] openmp.scatterview_devicetype
49: /var/jenkins/workspace/Kokkos/containers/unit_tests/TestScatterView.hpp:363: Failure
49: The difference between val0 and 4.0 is 4, which exceeds 1e-14 * 4.0, where
49: val0 evaluates to 8,
49: 4.0 evaluates to 4, and
49: 1e-14 * 4.0 evaluates to 4e-14.
49: Data differs at index 9

@dalg24 dalg24 merged commit 2ad88ec into kokkos:develop May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos) Patch Release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants