Skip to content

Commit a7c1db0

Browse files
author
Albert-Jan Yzelman
committed
Issue #303: framework for reference_dense added
1 parent 4d0f43b commit a7c1db0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+979
-152
lines changed

cmake/AddGRBInstall.cmake

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,21 @@ endif()
112112
# paths may have spaces, hence wrap them inside single quotes ''
113113

114114
# shared memory backends
115-
if ( WITH_REFERENCE_BACKEND )
115+
if( WITH_REFERENCE_BACKEND )
116116
addBackendWrapperGenOptions( "reference"
117117
COMPILE_DEFINITIONS "${REFERENCE_SELECTION_DEFS}"
118118
LINK_FLAGS "'${SHMEM_BACKEND_INSTALL_DIR}/lib${BACKEND_LIBRARY_OUTPUT_NAME}.a'"
119119
"'${ALP_UTILS_INSTALL_DIR}/lib${ALP_UTILS_LIBRARY_OUTPUT_NAME}.a'" "${NUMA_LFLAG}"
120120
)
121121
endif()
122122

123+
if( WITH_DENSE_BACKEND )
124+
addBackendWrapperGenOptions( "reference_dense"
125+
COMPILE_DEFINITIONS "${DENSE_SELECTION_DEFS}"
126+
LINK_FLAGS "${SHMEM_BACKEND_INSTALL_DIR}/lib${BACKEND_LIBRARY_OUTPUT_NAME}.a"
127+
)
128+
endif()
129+
123130
if( WITH_OMP_BACKEND )
124131
addBackendWrapperGenOptions( "reference_omp"
125132
COMPILE_DEFINITIONS "${REFERENCE_OMP_SELECTION_DEFS}"

cmake/AddGRBVars.cmake

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ set( REFERENCE_BACKEND_DEFAULT_NAME "backend_reference" )
3131
set( REFERENCE_OMP_BACKEND_DEFAULT_NAME "backend_reference_omp" )
3232
set( BSP1D_BACKEND_DEFAULT_NAME "backend_bsp1d" )
3333
set( HYBRID_BACKEND_DEFAULT_NAME "backend_hybrid" )
34+
set( DENSE_BACKEND_DEFAULT_NAME "backend_reference_dense" )
3435

3536

3637
### COMPILER DEFINITIONS FOR HEADERS INCLUSION AND FOR BACKEND SELECTION
@@ -39,6 +40,7 @@ set( HYBRID_BACKEND_DEFAULT_NAME "backend_hybrid" )
3940
set( REFERENCE_INCLUDE_DEFS "_GRB_WITH_REFERENCE" )
4041
set( REFERENCE_OMP_INCLUDE_DEFS "_GRB_WITH_OMP" )
4142
set( LPF_INCLUDE_DEFS "_GRB_WITH_LPF" )
43+
set( DENSE_INCLUDE_DEFS "_GRB_WITH_DENSEREF" )
4244

4345
# compiler definitions to select a backend
4446
set( REFERENCE_SELECTION_DEFS "_GRB_BACKEND=reference" )
@@ -52,12 +54,13 @@ set( HYBRID_SELECTION_DEFS
5254
"_GRB_BSP1D_BACKEND=reference_omp"
5355
"_GRB_COORDINATES_BACKEND=reference_omp"
5456
)
57+
set( DENSE_SELECTION_DEFS "_GRB_BACKEND=reference_dense" )
5558

5659
# definition to set if not depending on libnuma
5760
set( NO_NUMA_DEF "_GRB_NO_LIBNUMA" )
5861

5962
### **ALL** BACKENDS, EVEN IF NOT ENABLED BY USER
60-
set( ALL_BACKENDS "reference" "reference_omp" "bsp1d" "hybrid" )
63+
set( ALL_BACKENDS "reference" "reference_omp" "bsp1d" "hybrid" "reference_dense" )
6164

6265

6366
# list of user-enabled backends, for tests and wrapper scripts (do not change!)
@@ -67,14 +70,18 @@ set( AVAILABLE_BACKENDS "" )
6770
# backends that are enabled by the user: append as in the following
6871

6972
# shared memory backends
70-
if ( WITH_REFERENCE_BACKEND )
73+
if( WITH_REFERENCE_BACKEND )
7174
list( APPEND AVAILABLE_BACKENDS "reference" )
7275
endif()
7376

7477
if( WITH_OMP_BACKEND )
7578
list( APPEND AVAILABLE_BACKENDS "reference_omp" )
7679
endif()
7780

81+
if( WITH_DENSE_BACKEND )
82+
list( APPEND AVAILABLE_BACKENDS "reference_dense" )
83+
endif()
84+
7885
# distributed memory backends
7986
if( WITH_BSP1D_BACKEND )
8087
list( APPEND AVAILABLE_BACKENDS "bsp1d" )
@@ -85,3 +92,4 @@ if( WITH_HYBRID_BACKEND )
8592
endif()
8693

8794
# add your own here!
95+

configure

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ print_help() {
7171
the location where LPF is installed"
7272
echo " --with-banshee=<path/> - path to the the tools to compile the banshee backend"
7373
echo " --with-snitch=<path/> - path to the tools for Snitch support within the banshee backend"
74+
echo " --without-dense - to compile without support for dense algebraic programming"
7475
echo " --no-reference - disables the reference and reference_omp backends"
7576
echo " --debug-build - build the project with debug options (tests will run much slower!)"
7677
echo " --generator=<value> - set the generator for CMake (otherwise use CMake's default)"
@@ -88,6 +89,7 @@ the location where LPF is installed"
8889
reference=yes
8990
banshee=no
9091
lpf=no
92+
dense=yes
9193
show=no
9294
FLAGS=$''
9395
LPF_INSTALL_PATH=
@@ -138,6 +140,9 @@ or assume default paths (--with-lpf)"
138140
SNITCH_PATH="${arg#--with-snitch=}"
139141
banshee=yes
140142
;;
143+
--without-dense)
144+
dense=no
145+
;;
141146
--no-reference)
142147
reference=no
143148
;;
@@ -251,6 +256,9 @@ if [[ "${reference}" == "yes" || "${lpf}" == "yes" ]];then
251256
if [[ "${reference}" == "no" ]]; then
252257
CMAKE_OPTS+=" -DWITH_REFERENCE_BACKEND=OFF -DWITH_OMP_BACKEND=OFF"
253258
fi
259+
if [[ "${dense}" == "no" ]]; then
260+
CMAKE_OPTS+=" -DWITH_DENSE_BACKEND=OFF"
261+
fi
254262
if [[ "${lpf}" == "yes" ]]; then
255263
CMAKE_OPTS+=" -DLPF_INSTALL_PATH='${ABSOLUTE_LPF_INSTALL_PATH}'"
256264
fi

include/CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,17 @@ if( WITH_REFERENCE_BACKEND_HEADERS )
116116
install( TARGETS backend_reference_headers EXPORT GraphBLASTargets )
117117
endif()
118118

119+
if( WITH_DENSE_BACKEND )
120+
add_library( backend_reference_dense_headers INTERFACE )
121+
target_link_libraries( backend_reference_dense_headers INTERFACE backend_headers_nodefs )
122+
install( DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/graphblas/denseref"
123+
DESTINATION "${GRB_INCLUDE_INSTALL_DIR}"
124+
FILES_MATCHING REGEX "${HEADERS_REGEX}"
125+
)
126+
install( TARGETS backend_reference_dense_headers EXPORT GraphBLASTargets )
127+
target_link_libraries( all_headers INTERFACE backend_reference_dense_headers )
128+
endif()
129+
119130
if( WITH_REFERENCE_BACKEND OR WITH_OMP_BACKEND )
120131
install( DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/graphblas/reference/"
121132
DESTINATION "${GRB_INCLUDE_INSTALL_DIR}/reference"
@@ -186,4 +197,6 @@ install( DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/graphblas/algorithms/"
186197
FILES_MATCHING REGEX "${HEADERS_REGEX}"
187198
)
188199

200+
target_link_libraries( all_headers INTERFACE algorithms )
201+
189202
install( TARGETS algorithms EXPORT GraphBLASTargets )

include/graphblas/backends.hpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,17 @@ namespace grb {
151151
*
152152
* Collaboration with ETH Zurich (ongoing).
153153
*/
154-
banshee_ssr
154+
banshee_ssr,
155+
156+
/**
157+
* The ALP/Dense backend. This is no longer a proper GraphBLAS implementation, as it assumes
158+
* all containers are dense. No ``missing'' entries in containers are allowed.
159+
*/
160+
reference_dense
155161

156162
};
157163

158164
} // namespace grb
159165

160166
#endif
167+

include/graphblas/base/collectives.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ namespace grb {
108108
static RC allreduce( IOType & inout, const Operator op = Operator() ) {
109109
(void)inout;
110110
(void)op;
111-
return PANIC;
111+
return UNSUPPORTED;
112112
}
113113

114114
/**
@@ -175,7 +175,7 @@ namespace grb {
175175
(void)inout;
176176
(void)op;
177177
(void)root;
178-
return PANIC;
178+
return UNSUPPORTED;
179179
}
180180

181181
/**
@@ -233,7 +233,7 @@ namespace grb {
233233
static RC broadcast( IOType &inout, const size_t root = 0 ) {
234234
(void)inout;
235235
(void)root;
236-
return PANIC;
236+
return UNSUPPORTED;
237237
}
238238

239239
/**
@@ -247,11 +247,12 @@ namespace grb {
247247
(void)inout;
248248
(void)size;
249249
(void)root;
250-
return PANIC;
250+
return UNSUPPORTED;
251251
}
252252

253253
}; // end class ``collectives''
254254

255255
} // end namespace grb
256256

257257
#endif // end _H_GRB_COLL_BASE
258+

include/graphblas/benchmark.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@
2828

2929
// include specialisations
3030
#ifdef _GRB_WITH_REFERENCE
31-
#include "graphblas/reference/benchmark.hpp"
31+
#include "graphblas/reference/benchmark.hpp"
32+
#include "graphblas/denseref/benchmark.hpp"
3233
#endif
3334
#ifdef _GRB_WITH_BANSHEE
34-
#include "graphblas/banshee/benchmark.hpp"
35+
#include "graphblas/banshee/benchmark.hpp"
3536
#endif
3637
#ifdef _GRB_WITH_LPF
37-
#include "graphblas/bsp1d/benchmark.hpp"
38+
#include "graphblas/bsp1d/benchmark.hpp"
3839
#endif
3940

4041
#ifdef _GRB_BACKEND
@@ -45,3 +46,4 @@ namespace grb {
4546
#endif
4647

4748
#endif // end ``_H_GRB_BENCH''
49+

include/graphblas/blas1.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
#ifdef _GRB_WITH_REFERENCE
3434
#include <graphblas/reference/blas1.hpp>
35+
#include <graphblas/denseref/blas1.hpp>
3536
#endif
3637
#ifdef _GRB_WITH_BANSHEE
3738
#include <graphblas/banshee/blas1.hpp>

include/graphblas/blas2.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@
3131

3232
// now include all specialisations contained in the backend directories:
3333
#ifdef _GRB_WITH_REFERENCE
34-
#include <graphblas/reference/blas2.hpp>
34+
#include <graphblas/reference/blas2.hpp>
35+
#include <graphblas/denseref/blas3.hpp>
3536
#endif
3637
#ifdef _GRB_WITH_BANSHEE
37-
#include <graphblas/banshee/blas2.hpp>
38+
#include <graphblas/banshee/blas2.hpp>
3839
#endif
3940
#ifdef _GRB_WITH_LPF
40-
#include <graphblas/bsp1d/blas2.hpp>
41+
#include <graphblas/bsp1d/blas2.hpp>
4142
#endif
4243

4344
#endif // end ``_H_GRB_BLAS2''
45+

include/graphblas/blas3.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@
2828

2929
// now include all specialisations contained in the backend directories:
3030
#ifdef _GRB_WITH_REFERENCE
31-
#include <graphblas/reference/blas3.hpp>
31+
#include <graphblas/reference/blas3.hpp>
32+
#include <graphblas/denseref/blas3.hpp>
3233
#endif
3334
#ifdef _GRB_WITH_LPF
34-
#include <graphblas/bsp1d/blas3.hpp>
35+
#include <graphblas/bsp1d/blas3.hpp>
3536
#endif
3637

3738
#endif // end _H_GRB_BLAS3
39+

0 commit comments

Comments
 (0)