Skip to content
Open
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
1 change: 1 addition & 0 deletions include/graphblas/banshee/coordinates.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#define _H_GRB_BANSHEE_COORDINATES

#include <stddef.h> //size_t
#include <cstdint.h> //size_t

#include <vector>

Expand Down
1 change: 1 addition & 0 deletions include/graphblas/base/io.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <type_traits>
#include <typeinfo>
#include <cstdint>

#ifndef _H_GRB_IO_BASE
#define _H_GRB_IO_BASE
Expand Down
1 change: 1 addition & 0 deletions include/graphblas/bsp1d/io.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include <memory>
#include <cstddef>
#include <cstdint>
#include <algorithm>
#include <iterator>

Expand Down
2 changes: 2 additions & 0 deletions include/graphblas/bsp1d/matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#ifndef _H_GRB_BSP1D_MATRIX
#define _H_GRB_BSP1D_MATRIX

#include <cstdint>

#include <graphblas/backends.hpp>
#include <graphblas/base/matrix.hpp>
#include <graphblas/rc.hpp>
Expand Down
1 change: 1 addition & 0 deletions include/graphblas/bsp1d/vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <map>
#include <sstream>
#include <vector>
#include <cstdint>

#include <lpf/core.h>

Expand Down
1 change: 1 addition & 0 deletions include/graphblas/hyperdags/blas1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <graphblas/hyperdags/init.hpp>

#include <array>
#include <cstdint>


namespace grb {
Expand Down
1 change: 1 addition & 0 deletions include/graphblas/hyperdags/blas2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <graphblas/hyperdags/init.hpp>

#include <array>
#include <cstdint>


namespace grb {
Expand Down
1 change: 1 addition & 0 deletions include/graphblas/hyperdags/blas3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <graphblas/hyperdags/init.hpp>

#include <array>
#include <cstdint>


namespace grb {
Expand Down
1 change: 1 addition & 0 deletions include/graphblas/hyperdags/hyperdags.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <ostream>
#include <iostream>
#include <type_traits>
#include <cstdint>

#include <assert.h>

Expand Down
1 change: 1 addition & 0 deletions include/graphblas/hyperdags/io.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <graphblas/config.hpp>

#include <array>
#include <cstdint>


namespace grb {
Expand Down
1 change: 1 addition & 0 deletions include/graphblas/nonblocking/coordinates.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

#include <stddef.h> //size_t
#include <assert.h>
#include <cstdint> // uintptr_t

#include <graphblas/rc.hpp>
#include <graphblas/backends.hpp>
Expand Down
2 changes: 2 additions & 0 deletions include/graphblas/nonblocking/io.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#ifndef _H_GRB_NONBLOCKING_IO
#define _H_GRB_NONBLOCKING_IO

#include <cstdint>

#include <graphblas/base/io.hpp>
#include <graphblas/reference/io.hpp>
#include "vector.hpp"
Expand Down
1 change: 1 addition & 0 deletions include/graphblas/nonblocking/matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <utility>
#include <iterator>
#include <cmath>
#include <cstdint>

#include <assert.h>

Expand Down
3 changes: 2 additions & 1 deletion include/graphblas/reference/coordinates.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
#include <stdexcept> // std::runtime_error

#include <assert.h>
#include <string.h> // memcpy
#include <string.h> //memcpy
#include <cstdint> // uintptr_t

#include <graphblas/backends.hpp>
#include <graphblas/base/coordinates.hpp>
Expand Down
1 change: 1 addition & 0 deletions include/graphblas/reference/init.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <new>
#include <cstdint> // for uintptr_t
#include <algorithm>
#include <cstdint>

#include <graphblas/base/init.hpp>
#include <graphblas/utils/DMapper.hpp>
Expand Down
1 change: 1 addition & 0 deletions include/graphblas/reference/io.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#define _H_GRB_REFERENCE_IO

#include <graphblas/base/io.hpp>
#include <cstdint>

#include <graphblas/utils/prefixsum.hpp>

Expand Down
2 changes: 2 additions & 0 deletions include/graphblas/reference/matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <sstream> //std::stringstream
#include <utility>
#include <iterator>
#include <cmath>
#include <cstdint>
#include <algorithm>
#include <stdexcept>
#include <functional>
Expand Down
1 change: 1 addition & 0 deletions include/graphblas/reference/vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#define _H_GRB_REFERENCE_VECTOR

#include <cstdlib>
#include <cstdint>
#include <functional>
#include <iterator>
#include <stdexcept>
Expand Down
14 changes: 9 additions & 5 deletions include/graphblas/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,10 @@ namespace grb {
ret = assigned;
} else {
// if based on value, if there is a value, cast it to bool
if( assigned ) {
if( !assigned ) {
return false;
}
else {
ret = static_cast< bool >( val[ offset ] );
}
// otherwise there is no value and false is assumed
Expand All @@ -354,7 +357,10 @@ namespace grb {
ret = assigned;
} else {
// if based on value, if there is a value, cast it to bool
if( assigned ) {
if( !assigned ) {
return false;
}
else {
ret = static_cast< bool >( real( val [ offset ] ) ) ||
static_cast< bool >( imag( val [ offset ] ) );
}
Expand All @@ -375,10 +381,8 @@ namespace grb {
const void * const,
const size_t
) {
// set default mask to false
bool ret = assigned;
// check whether we should return the inverted value
if( descriptor & descriptors::invert_mask ) {
if( ( descriptor & descriptors::invert_mask ) == descriptors::invert_mask ) {
return !ret;
} else {
return ret;
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/eWiseMul.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void grb_program( const size_t &n, RC &rc ) {
}, temp );
rc = rc ? rc : set( even_mask, temp, true );
rc = rc ? rc : set< descriptors::invert_mask >(
odd_mask, even_mask, true );
odd_mask, temp, true );
rc = rc ? rc : wait();
if( rc != SUCCESS ) {
std::cerr << "\t initialisation of masks FAILED\n";
Expand Down
14 changes: 9 additions & 5 deletions tests/unit/launcher/reduce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,12 @@ void grbProgram( const size_t &P, int &exit_status ) {
grb::Vector< bool > even_mask( n );
check = 0.0;
for( size_t i = 0; i < n; i += 2 ) {
check += xr[ i ];
const grb::RC setrc = grb::setElement( even_mask, true, i );
bool set_to = false;
if( i%4 == 0 ) {
check += xr[ i ];
set_to = true;
}
const grb::RC setrc = grb::setElement( even_mask, set_to, i );
#ifndef NDEBUG
assert( setrc == grb::SUCCESS );
#else
Expand All @@ -484,7 +488,7 @@ void grbProgram( const size_t &P, int &exit_status ) {
}

check = 0.0;
for( size_t i = 1; i < n; i += 2 ) {
for( size_t i = 2; i < n; i += 4 ) {
check += xr[ i ];
}

Expand Down Expand Up @@ -555,7 +559,7 @@ void grbProgram( const size_t &P, int &exit_status ) {
}

exit_status = expect_sparse_success< grb::descriptors::invert_mask >(
sparse, realm, grb::nnz(sparse), empty_mask );
sparse, realm, 0.0, empty_mask, grb::nnz(sparse) );
if( exit_status != 0 ) {
exit_status += 500;
return;
Expand Down Expand Up @@ -606,7 +610,7 @@ void grbProgram( const size_t &P, int &exit_status ) {
}

exit_status = expect_sparse_success< grb::descriptors::invert_mask >(
sparse, realm, grb::nnz(sparse), odd_mask );
sparse, realm, 0.0, odd_mask, grb::nnz(sparse) );
if( exit_status != 0 ) {
exit_status += 1100;
return;
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/pinnedVector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ void grbProgram( const struct input< T > &in, struct output< T > &out ) {
case LEAST_SPARSE_CLEARED:
{
Vector< bool > mask( n );
rc = grb::setElement( mask, true, n/2 );
rc = grb::set( mask, false );
rc = rc ? rc : grb::setElement( mask, true, n/2 );
rc = rc ? rc : grb::set<
grb::descriptors::invert_mask
>( nonempty, mask, in.element );
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,8 @@ void grb_program( const size_t &n, grb::RC &rc ) {

// test sparse inverted mask set
grb::Vector< bool > mask( n );
rc = grb::setElement( mask, true, n / 2 );
rc = grb::set( mask, false );
rc = rc ? rc : grb::setElement( mask, true, n / 2 );
if( rc == SUCCESS ) {
rc = grb::set( src, 1.5 );
rc = rc ? rc : grb::wait( src );
Expand Down
12 changes: 6 additions & 6 deletions tests/unit/setToIndex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,7 @@ void grb_program( const size_t &n, grb::RC &rc ) {
rc = grb::set< invert >( dst, one_mask, 3.14 );
rc = rc ? rc : grb::wait( dst );
if( !expect_success( rc ) ) { return; }
rc = expect_all_but_one( dst, half_size );
rc = expect_none( dst );
if( rc != grb::SUCCESS ) { return; }

std::cerr << "\b 20:";
Expand Down Expand Up @@ -1256,7 +1256,7 @@ void grb_program( const size_t &n, grb::RC &rc ) {
rc = grb::set< invert >( dst, one_mask, src );
rc = rc ? rc : grb::wait( dst );
if( !expect_success( rc ) ) { return; }
rc = expect_one( dst, 0, 0 );
rc = expect_none( dst );
if( rc != grb::SUCCESS ) { return; }

std::cerr << "\b 22:";
Expand All @@ -1277,7 +1277,7 @@ void grb_program( const size_t &n, grb::RC &rc ) {
rc = grb::set< invert >( dst, one_mask, src );
rc = rc ? rc : grb::wait( dst );
if( !expect_success( rc ) ) { return; }
rc = expect_all_but_one( dst, half_size );
rc = expect_none( dst );
if( rc != grb::SUCCESS ) { return; }

std::cerr << "\b 24:";
Expand All @@ -1298,7 +1298,7 @@ void grb_program( const size_t &n, grb::RC &rc ) {
rc = grb::set< invert >( dst, one_mask, 7.17 );
rc = rc ? rc : grb::wait( dst );
if( !expect_success( rc ) ) { return; }
rc = expect_all_but_one( dst, half_size );
rc = expect_none( dst );
if( rc != grb::SUCCESS ) { return; }

std::cerr << "\b 26:";
Expand Down Expand Up @@ -1365,7 +1365,7 @@ void grb_program( const size_t &n, grb::RC &rc ) {
rc = grb::set< invert >( dst, one_mask, src );
rc = rc ? rc : grb::wait( dst );
if( !expect_success( rc ) ) { return; }
rc = expect_one( dst, 0, 0 );
rc = expect_none( dst );
if( rc != grb::SUCCESS ) { return; }

std::cerr << "\b 28:";
Expand Down Expand Up @@ -1408,7 +1408,7 @@ void grb_program( const size_t &n, grb::RC &rc ) {
rc = grb::set< invert >( dst, one_mask, src );
rc = rc ? rc : grb::wait( dst );
if( !expect_success( rc ) ) { return; }
rc = expect_all_but_one( dst, half_size );
rc = expect_none( dst );
if( rc != grb::SUCCESS ) { return; }

std::cerr << "\b 30:";
Expand Down