From dc62b04eee55835e3023bf465796ba064fcc595b Mon Sep 17 00:00:00 2001 From: Eduard Valeyev Date: Thu, 23 Sep 2021 09:07:47 -0400 Subject: [PATCH 1/2] make header guards in bug.h distinct from those in MPQC --- src/TiledArray/util/bug.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/TiledArray/util/bug.h b/src/TiledArray/util/bug.h index ed8ab7bf1a..46158bf1f0 100644 --- a/src/TiledArray/util/bug.h +++ b/src/TiledArray/util/bug.h @@ -25,8 +25,8 @@ // The U.S. Government is granted a limited license as per AL 91-7. // -#ifndef MPQC4_SRC_MPQC_UTIL_MISC_BUG_H_ -#define MPQC4_SRC_MPQC_UTIL_MISC_BUG_H_ +#ifndef TILEDARRAY_UTIL_BUG_H_ +#define TILEDARRAY_UTIL_BUG_H_ #include #include @@ -381,7 +381,7 @@ void launch_lldb_xterm(); } // namespace TiledArray -#endif // MPQC4_SRC_MPQC_UTIL_MISC_BUG_H_ +#endif // TILEDARRAY_UTIL_BUG_H_ // Local Variables: // mode: c++ From 4c59087020892a8ec7f3214dde18b63fed93687d Mon Sep 17 00:00:00 2001 From: Eduard Valeyev Date: Thu, 23 Sep 2021 09:08:35 -0400 Subject: [PATCH 2/2] foreach works with ShapeReductionMethod::Union and void-returning op --- src/TiledArray/conversions/foreach.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/TiledArray/conversions/foreach.h b/src/TiledArray/conversions/foreach.h index f54d8b4682..d62772e553 100644 --- a/src/TiledArray/conversions/foreach.h +++ b/src/TiledArray/conversions/foreach.h @@ -30,6 +30,8 @@ #include #include +#include + /// Forward declarations namespace Eigen { template @@ -277,8 +279,8 @@ inline std:: tiles.reserve(arg.pmap()->size()); // Construct a tensor to hold updated tile norms for the result shape. - TiledArray::Tensor - tile_norms(arg.trange().tiles_range(), 0); + TiledArray::Tensor tile_norms( + arg.trange().tiles_range(), 0); // Construct the task function used to construct the result tiles. madness::AtomicInt counter; @@ -324,12 +326,10 @@ inline std:: detail::get_sparse_tile(index, args)...); ++task_count; tiles.emplace_back(index, std::move(result_tile)); - if (op_returns_void) // if Op does not evaluate norms, use the (scaled) - // norms of the first arg need max reduction here, - // hence c++17, until then just assert false - TA_ASSERT(false && - "ShapeReductionMethod::Union not supported with " - "void-returning Op"); + if (op_returns_void) // if Op does not evaluate norms, find max + // (scaled) norms of all args + tile_norms[index] = + std::max({arg_shape_data[index], args.shape().data()[index]...}); } break; default: