Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
4748021
Add new unit-test for eWiseApply(matrices)
byjtew May 24, 2023
0294312
Implement Monoid variant of BLAS3::eWiseApply
byjtew Jun 29, 2023
34130f3
Nonblocking implementation fix
byjtew Jun 29, 2023
535e89c
Fix eWiseApplyMatrixReference unit-test to handle Monoid variant
byjtew Jun 29, 2023
a7bf8df
Stackless implementation of the operator variant
byjtew Jul 3, 2023
5eb0b44
Convert vector to c-like array for monoid variant
byjtew Jul 3, 2023
c9c5ef3
Style fixes
byjtew Jul 12, 2023
8ee55c5
Non-square matrix CCS assignment bugfix
byjtew Jul 12, 2023
3a70d9b
Adapt changes in spy unit-test
byjtew Jul 13, 2023
89ebb16
Enable test for both variants
byjtew Jul 28, 2023
9f8a43e
Revert to stack implementation of the intersection variant
byjtew Jul 31, 2023
ef2b8da
omp bugfix
byjtew Jul 31, 2023
045242e
Replace local buffer with coordinates array
byjtew Aug 3, 2023
154c592
Bugfix for union variant
byjtew Aug 4, 2023
13a0ae3
Add support for descriptors::force_row_major
byjtew Aug 9, 2023
7eba1fe
Bugfix + improvement
byjtew Oct 31, 2023
b84c55d
New unit-test cases
byjtew Nov 1, 2023
4156581
Bugfix for union pattern
byjtew Nov 1, 2023
30f8a30
Parallel iteration of coordinates
byjtew Nov 1, 2023
4b2b27b
Void values bugfix for test
byjtew Nov 1, 2023
02330a8
Logic bugfix
byjtew Nov 2, 2023
585f485
Merge remote-tracking branch 'origin/develop' into 636-unexpected-beh…
byjtew Nov 2, 2023
95e8774
Clean blas3.hpp
byjtew Nov 2, 2023
f58de69
Refactor test to support bsp1d
byjtew Nov 28, 2023
d0cecde
Simplify bsp1d API
byjtew Nov 28, 2023
c524470
Syntax arrangements
byjtew Dec 4, 2023
5559540
Enabling and testing pattern inputs matrices
byjtew Dec 4, 2023
fb4e141
Redundancy removal in static assertions
byjtew Dec 4, 2023
aa0de94
Merge remote-tracking branch 'github/develop' into 636-unexpected-beh…
byjtew Dec 4, 2023
5eea235
temporary bugfix for parallel coordinates assignments
byjtew Dec 8, 2023
7872b79
Re-enable parallel Coordinates iteration
byjtew Jan 17, 2024
ef342a8
Fix potential bug when (A == B) is true. Thanks to @aleksamilisavljev…
byjtew Jan 24, 2024
2d63fdf
Increase test size in CI
byjtew Jan 24, 2024
4456d92
Merge remote-tracking branch 'github/develop' into 636-unexpected-beh…
byjtew Feb 1, 2024
098481f
Minor fix from the merge
byjtew Feb 1, 2024
40e62c2
Minor changes
byjtew Feb 2, 2024
b2965d9
Review fixes
byjtew Feb 25, 2024
35f3a9b
Coordinates assign bugfix
byjtew Feb 26, 2024
4eaaf91
Enabling little threadnig using two tasks
byjtew Feb 26, 2024
c346ed6
Merge branch 'develop' into 636-unexpected-behaviour-of-ewiseapply-ou…
byjtew Feb 28, 2024
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
59 changes: 35 additions & 24 deletions include/graphblas/bsp1d/blas3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,20 +131,21 @@ namespace grb {
const Matrix< InputType1, BSP1D, RIT2, CIT2, NIT2 > &A,
const Matrix< InputType2, BSP1D, RIT3, CIT3, NIT3 > &B,
const MulMonoid &mul,
const Phase phase = EXECUTE,
const Phase &phase = EXECUTE,
const typename std::enable_if<
!grb::is_object< OutputType >::value &&
!grb::is_object< InputType1 >::value &&
!grb::is_object< InputType2 >::value &&
grb::is_monoid< MulMonoid >::value,
void >::type * const = nullptr
!grb::is_object< OutputType >::value &&
!grb::is_object< InputType1 >::value &&
!grb::is_object< InputType2 >::value &&
grb::is_monoid< MulMonoid >::value, void
>::type * const = nullptr
) {
assert( phase != TRY );
RC local_rc = SUCCESS;
if( phase == RESIZE ) {
RC ret = eWiseApply< descr >(
internal::getLocal( C ),
internal::getLocal( A ), internal::getLocal( B ),
internal::getLocal( A ),
internal::getLocal( B ),
mul,
RESIZE
);
Expand All @@ -157,7 +158,8 @@ namespace grb {
assert( phase == EXECUTE );
local_rc = eWiseApply< descr >(
internal::getLocal( C ),
internal::getLocal( A ), internal::getLocal( B ),
internal::getLocal( A ),
internal::getLocal( B ),
mul,
EXECUTE
);
Expand All @@ -179,31 +181,40 @@ namespace grb {
const Matrix< InputType1, BSP1D, RIT2, CIT2, NIT2 > &A,
const Matrix< InputType2, BSP1D, RIT3, CIT3, NIT3 > &B,
const Operator &op,
const Phase phase = EXECUTE,
const Phase &phase = EXECUTE,
const typename std::enable_if<
!grb::is_object< OutputType >::value &&
!grb::is_object< InputType1 >::value &&
!grb::is_object< InputType2 >::value &&
grb::is_operator< Operator >::value,
void >::type * const = nullptr
!grb::is_object< OutputType >::value &&
!grb::is_object< InputType1 >::value &&
!grb::is_object< InputType2 >::value &&
grb::is_operator< Operator >::value, void
>::type * const = nullptr
) {
assert( phase != TRY );
RC ret = eWiseApply< descr >(
internal::getLocal( C ),
internal::getLocal( A ), internal::getLocal( B ),
op,
phase
);
RC local_rc = SUCCESS;
if( phase == RESIZE ) {
RC ret = eWiseApply< descr >(
internal::getLocal( C ),
internal::getLocal( A ),
internal::getLocal( B ),
op,
RESIZE
);
if( collectives<>::allreduce( ret, operators::any_or< RC >() ) != SUCCESS ) {
return PANIC;
} else {
return SUCCESS;
return ret;
}
} else {
assert( phase == EXECUTE );
local_rc = eWiseApply< descr >(
internal::getLocal( C ),
internal::getLocal( A ),
internal::getLocal( B ),
op,
EXECUTE
);
}
assert( phase == EXECUTE );
return internal::checkGlobalErrorStateOrClear( C, ret );
}
return internal::checkGlobalErrorStateOrClear( C, local_rc );

} // namespace grb

Expand Down
106 changes: 40 additions & 66 deletions include/graphblas/nonblocking/blas3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,56 +416,6 @@ namespace grb {
);
}

namespace internal {

template<
bool allow_void,
Descriptor descr,
class MulMonoid, class Operator,
typename OutputType, typename InputType1, typename InputType2,
typename RIT1, typename CIT1, typename NIT1,
typename RIT2, typename CIT2, typename NIT2,
typename RIT3, typename CIT3, typename NIT3
>
RC eWiseApply_matrix_generic(
Matrix< OutputType, nonblocking, RIT1, CIT1, NIT1 > &C,
const Matrix< InputType1, nonblocking, RIT2, CIT2, NIT2 > &A,
const Matrix< InputType2, nonblocking, RIT3, CIT3, NIT3 > &B,
const Operator &oper,
const MulMonoid &mulMonoid,
const Phase &phase,
const typename std::enable_if<
!grb::is_object< OutputType >::value &&
!grb::is_object< InputType1 >::value &&
!grb::is_object< InputType2 >::value &&
grb::is_operator< Operator >::value,
void >::type * const = nullptr
) {
if( internal::NONBLOCKING::warn_if_not_native &&
config::PIPELINE::warn_if_not_native
) {
std::cerr << "Warning: eWiseApply (nonblocking) currently delegates to a "
<< "blocking implementation.\n"
<< " Further similar such warnings will be suppressed.\n";
internal::NONBLOCKING::warn_if_not_native = false;
}

// nonblocking execution is not supported
// first, execute any computation that is not completed
le.execution();

// second, delegate to the reference backend
return eWiseApply_matrix_generic<
allow_void, descr,
MulMonoid, Operator
>(
getRefMatrix( C ), getRefMatrix( A ), getRefMatrix( B ),
oper, mulMonoid, phase
);
}

} // namespace internal

template<
Descriptor descr = descriptors::no_operation,
class MulMonoid,
Expand Down Expand Up @@ -507,11 +457,26 @@ namespace grb {
);

#ifdef _DEBUG
std::cout << "In grb::eWiseApply_matrix_generic (nonblocking, monoid)\n";
std::cout << "In grb::eWiseApply (nonblocking, monoid)\n";
#endif
if( internal::NONBLOCKING::warn_if_not_native && config::PIPELINE::warn_if_not_native ) {
std::cerr << "Warning: eWiseApply (nonblocking) currently delegates to a "
<< "blocking implementation.\n"
<< " Further similar such warnings will be suppressed.\n";
internal::NONBLOCKING::warn_if_not_native = false;
}

return internal::eWiseApply_matrix_generic< true, descr >(
C, A, B, mulmono.getOperator(), mulmono, phase
// nonblocking execution is not supported
// first, execute any computation that is not completed
internal::le.execution();

// second, delegate to the reference backend
return eWiseApply< descr >(
internal::getRefMatrix( C ),
internal::getRefMatrix( A ),
internal::getRefMatrix( B ),
mulmono,
phase
);
}

Expand All @@ -535,6 +500,17 @@ namespace grb {
grb::is_operator< Operator >::value,
void >::type * const = nullptr
) {
if( internal::NONBLOCKING::warn_if_not_native && config::PIPELINE::warn_if_not_native ) {
std::cerr << "Warning: eWiseApply (nonblocking) currently delegates to a "
<< "blocking implementation.\n"
<< " Further similar such warnings will be suppressed.\n";
internal::NONBLOCKING::warn_if_not_native = false;
}

#ifdef _DEBUG
std::cout << "In grb::eWiseApply (nonblocking, op)\n";
#endif

// static checks
NO_CAST_ASSERT( ( !( descr & descriptors::no_casting ) ||
std::is_same< typename Operator::D1, InputType1 >::value ),
Expand All @@ -554,20 +530,18 @@ namespace grb {
"called with an output matrix C that does not match the output domain "
"of the given multiplication operator"
);
static_assert( ( !(
std::is_same< InputType1, void >::value ||
std::is_same< InputType2, void >::value )
), "grb::eWiseApply (nonblocking, matrix <- matrix x matrix, operator): "
"the operator version of eWiseApply cannot be used if either of the "
"input matrices is a pattern matrix (of type void)"
);

typename grb::Monoid<
grb::operators::mul< double >,
grb::identities::one
> dummyMonoid;
return internal::eWiseApply_matrix_generic< false, descr >(
C, A, B, mulOp, dummyMonoid, phase
// nonblocking execution is not supported
// first, execute any computation that is not completed
internal::le.execution();

// second, delegate to the reference backend
return eWiseApply< descr >(
internal::getRefMatrix( C ),
internal::getRefMatrix( A ),
internal::getRefMatrix( B ),
mulOp,
phase
);
}

Expand Down
Loading