-
Notifications
You must be signed in to change notification settings - Fork 27
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
Fixes several outstanding bugs #1009
Changes from all commits
cae8616
b6c3830
c4024d4
332f3d7
938bff7
cbfad0b
4dc8ca2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,6 +99,25 @@ if (RAJA_DIR) | |
message(STATUS "RAJA loaded: ${RAJA_DIR}") | ||
set(RAJA_FOUND TRUE CACHE BOOL "") | ||
endif() | ||
|
||
# Suppress warnings from cub and cuda related to the (low) version | ||
# of clang that XL compiler pretends to be. | ||
if(C_COMPILER_FAMILY_IS_XL) | ||
if(TARGET RAJA::cub) | ||
blt_add_target_definitions( | ||
TO RAJA::cub | ||
SCOPE INTERFACE | ||
TARGET_DEFINITIONS CUB_IGNORE_DEPRECATED_CPP_DIALECT) | ||
endif() | ||
|
||
if(TARGET cuda) | ||
blt_add_target_definitions( | ||
TO cuda | ||
SCOPE INTERFACE | ||
TARGET_DEFINITIONS THRUST_IGNORE_DEPRECATED_CPP_DIALECT) | ||
endif() | ||
endif() | ||
Comment on lines
+103
to
+119
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These avoid some annoying repeated warnings from cub and thrust about the Clang version needing to be greater than 6. They're not particularly useful to us when using the XL compiler, since it's C++ implementation is sufficiently modern. |
||
|
||
else() | ||
message(STATUS "RAJA support is OFF" ) | ||
set(RAJA_FOUND FALSE CACHE BOOL "") | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,11 +121,17 @@ template <typename Char> AXOM_FMT_FUNC Char decimal_point_impl(locale_ref) { | |
AXOM_FMT_API AXOM_FMT_FUNC format_error::~format_error() noexcept = default; | ||
#endif | ||
|
||
AXOM_FMT_FUNC std::system_error vsystem_error(int error_code, string_view format_str, | ||
// BEGIN AXOM BUGFIX | ||
// NVCC's preprocessor converts 'std::error_code' to `class std::error_code' | ||
// and then complains that `return class std::error_code' isn't valid! | ||
using axom_fmt_system_error = std::system_error; | ||
|
||
AXOM_FMT_FUNC axom_fmt_system_error vsystem_error(int error_code, string_view format_str, | ||
format_args args) { | ||
auto ec = std::error_code(error_code, std::generic_category()); | ||
return std::system_error(ec, vformat(format_str, args)); | ||
return axom_fmt_system_error(ec, vformat(format_str, args)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As far as I can tell, The errors here and below were:
Using a type alias circumvents this problem. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll try to create a simple reproducer (ideally outside of fmt and axom) and log an issue. In the meantime, our |
||
} | ||
// END AXOM BUGFIX | ||
|
||
namespace detail { | ||
|
||
|
@@ -1449,16 +1455,18 @@ AXOM_FMT_FUNC detail::utf8_to_utf16::utf8_to_utf16(string_view s) { | |
buffer_.push_back(0); | ||
} | ||
|
||
// BEGIN AXOM BUGFIX | ||
AXOM_FMT_FUNC void format_system_error(detail::buffer<char>& out, int error_code, | ||
const char* message) noexcept { | ||
AXOM_FMT_TRY { | ||
auto ec = std::error_code(error_code, std::generic_category()); | ||
write(std::back_inserter(out), std::system_error(ec, message).what()); | ||
write(std::back_inserter(out), axom_fmt_system_error(ec, message).what()); | ||
return; | ||
} | ||
AXOM_FMT_CATCH(...) {} | ||
format_error_code(out, error_code, message); | ||
} | ||
// END AXOM BUGFIX | ||
|
||
AXOM_FMT_FUNC void report_system_error(int error_code, | ||
const char* message) noexcept { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
diff --git a/src/thirdparty/axom/fmt/format-inl.h b/src/thirdparty/axom/fmt/format-inl.h | ||
index ff6e6323f..efdbeb40a 100644 | ||
--- a/src/thirdparty/axom/fmt/format-inl.h | ||
+++ b/src/thirdparty/axom/fmt/format-inl.h | ||
@@ -121,11 +121,17 @@ template <typename Char> AXOM_FMT_FUNC Char decimal_point_impl(locale_ref) { | ||
AXOM_FMT_API AXOM_FMT_FUNC format_error::~format_error() noexcept = default; | ||
#endif | ||
|
||
-AXOM_FMT_FUNC std::system_error vsystem_error(int error_code, string_view format_str, | ||
+// BEGIN AXOM BUGFIX | ||
+// NVCC's preprocessor converts 'std::error_code' to `class std::error_code' | ||
+// and then complains that `return class std::error_code' isn't valid! | ||
+using axom_fmt_system_error = std::system_error; | ||
+ | ||
+AXOM_FMT_FUNC axom_fmt_system_error vsystem_error(int error_code, string_view format_str, | ||
format_args args) { | ||
auto ec = std::error_code(error_code, std::generic_category()); | ||
- return std::system_error(ec, vformat(format_str, args)); | ||
+ return axom_fmt_system_error(ec, vformat(format_str, args)); | ||
} | ||
+// END AXOM BUGFIX | ||
|
||
namespace detail { | ||
|
||
@@ -1449,16 +1455,18 @@ AXOM_FMT_FUNC detail::utf8_to_utf16::utf8_to_utf16(string_view s) { | ||
buffer_.push_back(0); | ||
} | ||
|
||
+// BEGIN AXOM BUGFIX | ||
AXOM_FMT_FUNC void format_system_error(detail::buffer<char>& out, int error_code, | ||
const char* message) noexcept { | ||
AXOM_FMT_TRY { | ||
auto ec = std::error_code(error_code, std::generic_category()); | ||
- write(std::back_inserter(out), std::system_error(ec, message).what()); | ||
+ write(std::back_inserter(out), axom_fmt_system_error(ec, message).what()); | ||
return; | ||
} | ||
AXOM_FMT_CATCH(...) {} | ||
format_error_code(out, error_code, message); | ||
} | ||
+// END AXOM BUGFIX | ||
|
||
AXOM_FMT_FUNC void report_system_error(int error_code, | ||
const char* message) noexcept { |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
diff --git a/src/thirdparty/axom/fmt/printf.h b/src/thirdparty/axom/fmt/printf.h | ||
index 1c6f960a6..7f221d01b 100644 | ||
--- a/src/thirdparty/axom/fmt/printf.h | ||
+++ b/src/thirdparty/axom/fmt/printf.h | ||
@@ -220,6 +220,16 @@ template <typename Char> class printf_width_handler { | ||
} | ||
}; | ||
|
||
+// BEGIN AXOM BUGFIX | ||
+// Workaround for a bug with the XL compiler when initializing | ||
+// printf_arg_formatter's base class. | ||
+template <typename Char> | ||
+auto make_arg_formatter(buffer_appender<Char> iter, basic_format_specs<Char>& s) | ||
+ -> arg_formatter<Char> { | ||
+ return {iter, s, locale_ref()}; | ||
+} | ||
+// END AXOM BUGFIX | ||
+ | ||
// The ``printf`` argument formatter. | ||
template <typename OutputIt, typename Char> | ||
class printf_arg_formatter : public arg_formatter<Char> { | ||
@@ -237,8 +247,10 @@ class printf_arg_formatter : public arg_formatter<Char> { | ||
} | ||
|
||
public: | ||
+// BEGIN AXOM BUGFIX | ||
printf_arg_formatter(OutputIt iter, format_specs& s, context_type& ctx) | ||
- : base{iter, s, locale_ref()}, context_(ctx) {} | ||
+ : base(make_arg_formatter(iter, s)), context_(ctx) {} | ||
+// END AXOM BUGFIX | ||
|
||
OutputIt operator()(monostate value) { return base::operator()(value); } | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,10 @@ | |
|
||
#include "gtest/gtest.h" | ||
|
||
// Note: The following line generates an error with nvcc on [email protected] | ||
// Axom has a patch to workaround this error. | ||
using namespace std; | ||
|
||
//----------------------------------------------------------------------------- | ||
TEST(fmt_smoke, basic_use) | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the axom meeting on 1/28/2023, we discussed an alternate resolution of converting the
mcodes
parameter tosort_mcodes
from anaxom::Array
to anaxom::ArrayView
which would avoid the copy.Should I apply this suggestion instead of the
by-reference
capture?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's put in the by-reference change at this point, and later change to use an
ArrayView
.