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

Lambda Compliance Macro Cleanup #246

Merged
merged 5 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/ygm/container/detail/base_async_contains.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct base_async_contains {
void async_contains(const std::tuple_element<0, for_all_args>::type& value,
Function fn, const FuncArgs&... args) {
YGM_CHECK_ASYNC_LAMBDA_COMPLIANCE(Function,
ygm::container::async_contains());
"ygm::container::async_contains()");

derived_type* derived_this = static_cast<derived_type*>(this);

Expand Down
4 changes: 2 additions & 2 deletions include/ygm/container/detail/base_async_insert_contains.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ struct base_async_insert_contains {
void async_insert_contains(
const std::tuple_element<0, for_all_args>::type& value, Function fn,
const FuncArgs&... args) {
YGM_CHECK_ASYNC_LAMBDA_COMPLIANCE(Function,
ygm::container::async_insert_contains());
YGM_CHECK_ASYNC_LAMBDA_COMPLIANCE(
Function, "ygm::container::async_insert_contains()");

derived_type* derived_this = static_cast<derived_type*>(this);

Expand Down
2 changes: 1 addition & 1 deletion include/ygm/container/detail/base_async_reduce.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct base_async_reduce {
const typename std::tuple_element<1, for_all_args>::type& value,
ReductionOp reducer) {
YGM_CHECK_ASYNC_LAMBDA_COMPLIANCE(ReductionOp,
ygm::container::async_reduce());
"ygm::container::async_reduce()");

derived_type* derived_this = static_cast<derived_type*>(this);

Expand Down
6 changes: 3 additions & 3 deletions include/ygm/container/detail/base_async_visit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct base_async_visit {
Visitor visitor, const VisitorArgs&... args)
requires DoubleItemTuple<for_all_args>
{
YGM_CHECK_ASYNC_LAMBDA_COMPLIANCE(Visitor, ygm::container::async_visit());
YGM_CHECK_ASYNC_LAMBDA_COMPLIANCE(Visitor, "ygm::container::async_visit()");

derived_type* derived_this = static_cast<derived_type*>(this);

Expand All @@ -44,7 +44,7 @@ struct base_async_visit {
requires DoubleItemTuple<for_all_args>
{
YGM_CHECK_ASYNC_LAMBDA_COMPLIANCE(
Visitor, ygm::container::async_visit_if_contains());
Visitor, "ygm::container::async_visit_if_contains()");

derived_type* derived_this = static_cast<derived_type*>(this);

Expand All @@ -68,7 +68,7 @@ struct base_async_visit {
requires DoubleItemTuple<for_all_args>
{
YGM_CHECK_ASYNC_LAMBDA_COMPLIANCE(
Visitor, ygm::container::async_visit_if_contains());
Visitor, "ygm::container::async_visit_if_contains()");

const derived_type* derived_this = static_cast<const derived_type*>(this);

Expand Down
6 changes: 3 additions & 3 deletions include/ygm/detail/comm.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ inline comm::~comm() {

template <typename AsyncFunction, typename... SendArgs>
inline void comm::async(int dest, AsyncFunction fn, const SendArgs &...args) {
YGM_CHECK_ASYNC_LAMBDA_COMPLIANCE(AsyncFunction, ygm::comm::async());
YGM_CHECK_ASYNC_LAMBDA_COMPLIANCE(AsyncFunction, "ygm::comm::async()");

YGM_ASSERT_RELEASE(dest < m_layout.size());
stats.async(dest);
Expand Down Expand Up @@ -184,7 +184,7 @@ inline void comm::async(int dest, AsyncFunction fn, const SendArgs &...args) {

template <typename AsyncFunction, typename... SendArgs>
inline void comm::async_bcast(AsyncFunction fn, const SendArgs &...args) {
YGM_CHECK_ASYNC_LAMBDA_COMPLIANCE(AsyncFunction, ygm::comm::async_bcast());
YGM_CHECK_ASYNC_LAMBDA_COMPLIANCE(AsyncFunction, "ygm::comm::async_bcast()");

check_if_production_halt_required();

Expand All @@ -200,7 +200,7 @@ inline void comm::async_bcast(AsyncFunction fn, const SendArgs &...args) {
template <typename AsyncFunction, typename... SendArgs>
inline void comm::async_mcast(const std::vector<int> &dests, AsyncFunction fn,
const SendArgs &...args) {
YGM_CHECK_ASYNC_LAMBDA_COMPLIANCE(AsyncFunction, ygm::comm::async_bcast());
YGM_CHECK_ASYNC_LAMBDA_COMPLIANCE(AsyncFunction, "ygm::comm::async_mcast()");

for (auto dest : dests) {
async(dest, fn, std::forward<const SendArgs>(args)...);
Expand Down
2 changes: 1 addition & 1 deletion include/ygm/detail/lambda_compliance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
static_assert( \
std::is_trivially_copyable<func>::value && \
std::is_standard_layout<func>::value, \
#location \
location \
" function object must be is_trivially_copyable & is_standard_layout.")