Skip to content

Commit 70cf34d

Browse files
committed
evaluation tracing includes size of TA tensors, bumps TA tag to pull in ValeevGroup/tiledarray#516
1 parent 5f7cf15 commit 70cf34d

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

INSTALL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ While in the SeQuant source directory:
1717
* [libPerm](https://github.com/Krzmbrzl/libPerm), tag 8e4afd1461baffa5d829c8fed059f5a172a3b060, *if not found, SeQuant will download and build libPerm*
1818
* optional:
1919
* for building coupled-cluster evaluation tests:
20-
* [TiledArray](https://github.com/ValeevGroup/tiledarray.git), tag 3f6629db047417e814b75ad5069b7f4ce26428e7
20+
* [TiledArray](https://github.com/ValeevGroup/tiledarray.git), tag 4a646d0c96cd0283eb34185aaf5f5b6fcc302bb2
2121
* for building `stcc*` test programs
2222
* [Eigen](http://eigen.tuxfamily.org/), version 3
2323

SeQuant/domain/eval/eval_result.hpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,9 @@ class EvalResult {
522522
return const_cast<EvalResult&>(*this).get<T>();
523523
}
524524

525+
/// @return the size of the object in bytes
526+
[[nodiscard]] virtual std::size_t size_in_bytes() const = 0;
527+
525528
protected:
526529
template <typename T,
527530
typename = std::enable_if_t<!std::is_convertible_v<T, EvalResult>>>
@@ -614,6 +617,8 @@ class EvalScalar final : public EvalResult {
614617
[[nodiscard]] id_t type_id() const noexcept override {
615618
return id_for_type<EvalScalar<T>>();
616619
}
620+
621+
[[nodiscard]] std::size_t size_in_bytes() const final { return sizeof(T); }
617622
};
618623

619624
///
@@ -743,6 +748,14 @@ class EvalTensorTA final : public EvalResult {
743748
return eval_result<this_type>(
744749
particle_antisymmetrize_ta(get<ArrayT>(), bra_rank));
745750
}
751+
752+
private:
753+
[[nodiscard]] std::size_t size_in_bytes() const final {
754+
auto& v = get<ArrayT>();
755+
auto local_size = TA::size_of<TA::MemorySpace::Host>(v);
756+
v.world().gop.sum(local_size);
757+
return local_size;
758+
}
746759
};
747760

748761
template <typename ArrayT,
@@ -882,6 +895,14 @@ class EvalTensorOfTensorTA final : public EvalResult {
882895
// not implemented yet
883896
return nullptr;
884897
}
898+
899+
private:
900+
[[nodiscard]] std::size_t size_in_bytes() const final {
901+
auto& v = get<ArrayT>();
902+
auto local_size = TA::size_of<TA::MemorySpace::Host>(v);
903+
v.world().gop.sum(local_size);
904+
return local_size;
905+
}
885906
};
886907

887908
///
@@ -975,6 +996,11 @@ class EvalTensorBTAS final : public EvalResult {
975996
return eval_result<EvalTensorBTAS<T>>(
976997
particle_antisymmetrize_btas(get<T>(), bra_rank));
977998
}
999+
1000+
private:
1001+
[[nodiscard]] std::size_t size_in_bytes() const final {
1002+
abort(); // not yet implemented
1003+
}
9781004
};
9791005

9801006
} // namespace sequant

external/versions.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ set(SEQUANT_TRACKED_VGCMAKEKIT_TAG 4f40440dcbda2a5a005fd15f27c582a5587ee779)
66
set(SEQUANT_TRACKED_RANGEV3_TAG 0.12.0)
77
set(SEQUANT_TRACKED_RANGEV3_PREVIOUS_TAG d800a032132512a54c291ce55a2a43e0460591c7)
88

9-
set(SEQUANT_TRACKED_TILEDARRAY_TAG fb5d5b80427cc937238a757ccec0cb313090528d)
10-
set(SEQUANT_TRACKED_TILEDARRAY_PREVIOUS_TAG c10f8d5cade2e6040d28958f04189d6ae578c00a)
9+
set(SEQUANT_TRACKED_TILEDARRAY_TAG 4a646d0c96cd0283eb34185aaf5f5b6fcc302bb2)
10+
set(SEQUANT_TRACKED_TILEDARRAY_PREVIOUS_TAG fb5d5b80427cc937238a757ccec0cb313090528d)
1111

1212
set(SEQUANT_TRACKED_LIBPERM_TAG 8e4afd1461baffa5d829c8fed059f5a172a3b060)
1313
set(SEQUANT_TRACKED_LIBPERM_PREVIOUS_TAG 8e4afd1461baffa5d829c8fed059f5a172a3b060)

0 commit comments

Comments
 (0)