Skip to content

Conversation

@tcclevenger
Copy link
Contributor

@tcclevenger tcclevenger commented Oct 20, 2025

Update testing to C++20 and fix C++20 specific warnings (and an additional generic warning).

Motivation

Eventually we will want to update all of E3SM to use C++20, this is a first step.

@tcclevenger tcclevenger marked this pull request as draft October 20, 2025 19:32
@tcclevenger tcclevenger force-pushed the tcclevenger/cpp_20_updates branch from ee0ded2 to a2ff3f8 Compare October 21, 2025 14:33
@tcclevenger tcclevenger force-pushed the tcclevenger/cpp_20_updates branch from a2ff3f8 to 2e58334 Compare October 21, 2025 17:08
@tcclevenger tcclevenger changed the title Update EKAT to default to Fix C++20 related errors Oct 21, 2025
@tcclevenger tcclevenger changed the title Fix C++20 related errors Address warnings Oct 21, 2025
@tcclevenger tcclevenger force-pushed the tcclevenger/cpp_20_updates branch 2 times, most recently from 88b8df1 to 23ca911 Compare October 21, 2025 17:29
Types of warnings:

warning: bitwise operation between different enumeration types is
deprecated [-Wdeprecated-enum-enum-conversion]

warning: compound assignment with ‘volatile’-qualified left operand is
deprecated [-Wvolatile]

warning: comparison of floating-point type with enumeration type is
deprecated [-Wdeprecated-enum-float-conversion]

warning: arithmetic between different enumeration types is deprecated
[-Wdeprecated-enum-enum-conversion]
@tcclevenger tcclevenger changed the title Address warnings Update testing to C++20 and address warnings Oct 21, 2025
@tcclevenger tcclevenger marked this pull request as ready for review October 21, 2025 18:23
@tcclevenger tcclevenger requested a review from bartgol October 21, 2025 18:23
#define EKAT_PACK_WHERE_HPP

#include "ekat_where.hpp"
#include "ekat_pack.hpp"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This caused a build error in EAMxx. Is it not tested in EKAT?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, good catch. The unit test includes ekat_pack.hpp before ekat_pack_where.hpp, so the error gets masked (no pun intended).

Kokkos::single(Kokkos::PerTeam(team_member), [&] () {
int volatile* const data = &test_data(wi);
*data += 1;
*data = *data + 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious: was the old version causing errors/warnings? If so, any idea why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A c++20 deprecation

warning: compound assignment with ‘volatile’-qualified left operand is
deprecated [-Wvolatile]

@tcclevenger tcclevenger merged commit 945b015 into master Oct 21, 2025
8 checks passed
@tcclevenger tcclevenger deleted the tcclevenger/cpp_20_updates branch October 21, 2025 20:56
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.

3 participants