Skip to content

Commit

Permalink
Merge pull request #43 from mwiesenberger/hotfix_dot
Browse files Browse the repository at this point in the history
HOTFIX recursive and mpi dot product
  • Loading branch information
mwiesenberger authored May 21, 2019
2 parents 59224ae + 0f045bf commit b0f4c6a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions inc/dg/backend/blas1_dispatch_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ inline std::vector<int64_t> doDot_superacc( const Vector1& x1, const Vector2& x2
std::vector<int64_t> temp = doDot_superacc( do_get_vector_element(x1,i,get_tensor_category<Vector1>()), do_get_vector_element(x2,i,get_tensor_category<Vector2>()));
int imin = exblas::IMIN, imax = exblas::IMAX;
exblas::cpu::Normalize( &(temp[0]), imin, imax);
for( int k=exblas::IMIN; k<exblas::IMAX; k++)
for( int k=exblas::IMIN; k<=exblas::IMAX; k++)
acc[k] += temp[k];
if( i%128 == 0)
if( (i+1)%128 == 0)
{
imin = exblas::IMIN, imax = exblas::IMAX;
exblas::cpu::Normalize( &(acc[0]), imin, imax);
Expand Down
2 changes: 1 addition & 1 deletion inc/dg/backend/blas2_dispatch_mpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ inline std::vector<int64_t> doDot_superacc( const Vector1& x, const Matrix& m, c
exblas::cpu::Normalize( &(acc[0][0]), imin, imax);
imin = exblas::IMIN, imax = exblas::IMAX;
exblas::cpu::Normalize( &(acc[i][0]), imin, imax);
for( int k=exblas::IMIN; k<exblas::IMAX; k++)
for( int k=exblas::IMIN; k<=exblas::IMAX; k++)
acc[0][k] += acc[i][k];
}
return acc[0];
Expand Down
2 changes: 1 addition & 1 deletion inc/dg/backend/blas2_dispatch_scalar.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ inline std::vector<int64_t> doDot_superacc( const Vector1& x, const Matrix& m, c
exblas::cpu::Normalize( &(acc[0][0]), imin, imax);
imin = exblas::IMIN, imax = exblas::IMAX;
exblas::cpu::Normalize( &(acc[i][0]), imin, imax);
for( int k=exblas::IMIN; k<exblas::IMAX; k++)
for( int k=exblas::IMIN; k<=exblas::IMAX; k++)
acc[0][k] += acc[i][k];
}
return acc[0];
Expand Down
2 changes: 1 addition & 1 deletion inc/dg/backend/blas2_dispatch_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ inline std::vector<int64_t> doDot_superacc( const Vector1& x, const Matrix& m, c
exblas::cpu::Normalize( &(acc[0][0]), imin, imax);
imin = exblas::IMIN, imax = exblas::IMAX;
exblas::cpu::Normalize( &(acc[i][0]), imin, imax);
for( int k=exblas::IMIN; k<exblas::IMAX; k++)
for( int k=exblas::IMIN; k<=exblas::IMAX; k++)
acc[0][k] += acc[i][k];
}
return acc[0];
Expand Down
4 changes: 2 additions & 2 deletions inc/dg/backend/blas2_dispatch_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ inline std::vector<int64_t> doDot_superacc( const Vector1& x, const Matrix& m, c
std::vector<int64_t> temp = doDot_superacc( do_get_vector_element(x,i,get_tensor_category<Vector1>()), m[i], do_get_vector_element(y,i,get_tensor_category<Vector2>()));
int imin = exblas::IMIN, imax = exblas::IMAX;
exblas::cpu::Normalize( &(temp[0]), imin, imax);
for( int k=exblas::IMIN; k<exblas::IMAX; k++)
for( int k=exblas::IMIN; k<=exblas::IMAX; k++)
acc[k] += temp[k];
if( i%128 == 0)
if( (i+1)%128 == 0)
{
imin = exblas::IMIN, imax = exblas::IMAX;
exblas::cpu::Normalize( &(acc[0]), imin, imax);
Expand Down

0 comments on commit b0f4c6a

Please sign in to comment.