Skip to content

Commit

Permalink
Revert to a clean state before merging the dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
byjtew committed Feb 9, 2024
1 parent 194a303 commit 8cf6dec
Show file tree
Hide file tree
Showing 7 changed files with 233 additions and 159 deletions.
18 changes: 4 additions & 14 deletions include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -219,30 +219,20 @@ install( DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/graphblas/interfaces/"

install( TARGETS algorithms EXPORT GraphBLASTargets )

# generate the spblas header with the library prefix
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/transition/spblas.h.in
${CMAKE_CURRENT_BINARY_DIR}/transition/spblas.h @ONLY
)

# this target lists the transition path headers
# these are plain C headers and do not have any dependences
add_library( transition_headers INTERFACE )
add_library( transition INTERFACE )

target_include_directories(
transition_headers INTERFACE
transition INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/transition/>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/transition/>
$<INSTALL_INTERFACE:transition/>
)

install( FILES ${CMAKE_CURRENT_BINARY_DIR}/transition/spblas.h
DESTINATION "${INCLUDE_INSTALL_DIR}/transition"
)

install( DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/transition/"
DESTINATION "${INCLUDE_INSTALL_DIR}/transition"
DESTINATION "${GRB_INCLUDE_INSTALL_DIR}/../transition/"
FILES_MATCHING REGEX "${HEADERS_REGEX}"
)

install( TARGETS transition_headers EXPORT GraphBLASTargets )
install( TARGETS transition EXPORT GraphBLASTargets )

5 changes: 0 additions & 5 deletions include/graphblas.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@
* -# generalised sparse linear algebra, \ref GraphBLAS;
* -# vertex-centric programming, \ref Pregel.
*
* Additionally, to ease integration with existing software, ALP defines
* so-called \ref TRANS libraries, which presently includes (partial)
* implementations of the \ref SPARSEBLAS and \ref SPBLAS (de-facto) standards,
* as well as an interface for numerical \ref TRANS_SOLVERS.
*
* Several other programming interfaces are under design at present.
*
* For authors who contributed to ALP, please see the NOTICE file.
Expand Down
74 changes: 2 additions & 72 deletions include/transition/blas_sparse.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,39 +21,6 @@
* This is the ALP implementation of a subset of the NIST Sparse BLAS standard.
* While the API is standardised, this header makes some implementation-specific
* extensions.
*
* @author A. N. Yzelman
* @date 2023
*/

/**
* \defgroup TRANS Transition path
*
* The transition path libraries enable integrating ALP with existing software.
* It operates by exposing several of its functionalities via established C
* interfaces and established data formats in order to facilitate the transition
* of legacy software to ALP. Ideally, users of transition interfaces need only
* re-compile and link their software; in some cases, trivial modifications
* might be required to migrate to transition interfaces, e.g., changing the
* prefix of called functions.
*
* The currently exposed interfaces are:
* - \ref SPARSEBLAS;
* - \ref SPBLAS; and
* - \ref TRANS_SOLVERS.
*
* All of these transition libraries show-case ALP's ability to quickly wrap
* around external APIs, thus simplifying integration of ALP-backed code with
* existing software. We do note, however, that the direct use of the native C++
* ALP API may lead to higher performance than the use of these transition path
* interfaces, and that in some cases the legacy interface itself is what makes
* achieving such higher performance impossible.
*
* The current transition path interfaces are at an *experimental prototype
* phase*; in particular, not all primitives in a given standard API are
* currently implemented. For \ref SPARSEBLAS in particular, additional support
* or coverage may freely be requested in GitHub issue #14. For other
* interfaces, feel free to open new issues or to contact the maintainers.
*/

#ifndef _H_ALP_SPARSEBLAS_NIST
Expand All @@ -65,41 +32,6 @@
extern "C" {
#endif

/**
* \defgroup SPARSEBLAS SparseBLAS
* \ingroup TRANS
*
* A SparseBLAS implementation enabled by ALP/GraphBLAS
*
* ALP provides a (presently partial) implementation of the Sparse BLAS standard
* as defined by the BLAS forum and in the following paper:
* - Duff, Iain S., Michael A. Heroux, and Roldan Pozo. "An overview of the
* sparse basic linear algebra subprograms: The new standard from the BLAS
* technical forum." ACM Transactions on Mathematical Software (TOMS) 28(2),
* 2002, pp. 239-267.
*
* We also provide a couple of extensions over this standard, in particular to
* add support for sparse vectors. Such extensions are prefixed by
* <tt>EXTBLAS_</tt> and <tt>extblas_</tt>, such as, for example,
* - #EXTBLAS_dusv_begin and
* - #extblas_sparse_vector.
* This prefix can be configured differently, please refer to the developer
* documentation if looking for this option.
*
* The functionalities defined by the standard of course retain the prefix
* defined by the standard: <tt>BLAS_</tt> and <tt>blas_</tt>, such as, e.g.,
* - #BLAS_duscr_begin and
* - #blas_sparse_matrix.
*
* The implementation of this standard is done by mapping back to the equivalent
* ALP/GraphBLAS primitives. By default, ALP builds both sequential and shared-
* memory parallel SparseBLAS libraries. It does so simply by compiling the same
* ALP-based SparseBLAS implementation with a sequential and a shared-memory ALP
* backend, respectively.
*
* @{
*/

/**
* The possible transposition types.
*
Expand Down Expand Up @@ -261,8 +193,8 @@ int BLAS_dusmm(
int EXTBLAS_dusmsv(
const enum blas_trans_type transa,
const double alpha, const blas_sparse_matrix A,
const EXTBLAS_TYPE( sparse_vector ) x,
EXTBLAS_TYPE( sparse_vector ) y
const extblas_sparse_vector x,
extblas_sparse_vector y
);

/**
Expand Down Expand Up @@ -397,8 +329,6 @@ int EXTBLAS_dusm_clear( blas_sparse_matrix A );
*/
int EXTBLAS_free();

/**@}*/ // ends the SparseBLAS doxygen group

#ifdef __cplusplus
} // end extern "C"
#endif
Expand Down
56 changes: 12 additions & 44 deletions include/transition/blas_sparse_vec.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,47 +21,17 @@
* This is an ALP-specific extension to the NIST Sparse BLAS standard, which
* the ALP libsparseblas transition path also introduces to the de-facto spblas
* standard.
*
* @author A. N. Yzelman
* @date 2023
*/

#ifndef _H_ALP_SPARSEBLAS_EXT_VEC
#define _H_ALP_SPARSEBLAS_EXT_VEC

/**
* \addtogroup SPARSEBLAS
* @{
*/

/**@{*/
/** \internal Helper macros for #EXTBLAS_FUN and #EXTBLAS_TYPE */
#define __SPBLAS_CONC( _a, _b ) _a ## _b
#define __SPBLAS_CONCAT( _a, _b ) __SPBLAS_CONC( _a, _b )
#define SPCONCAT( _a, _b ) __SPBLAS_CONCAT( _a, _b )
/**@}*/

#ifdef __cplusplus
extern "C" {
#endif

/**@{*/
/**
* \internal
*
* Allows renaming our non-standard functions with some other prefix.
*
* The default prefixes are <tt>EXTBLAS_</tt> for functions and
* <tt>extblas_</tt> for types.
*
* \endinternal
*/
#define EXTBLAS_FUN( name ) SPCONCAT( EXTBLAS_, name )
#define EXTBLAS_TYPE( name ) SPCONCAT( extblas_, name )
/**@}*/

/** A sparse vector. This is an implementation-specific extension. */
typedef void * EXTBLAS_TYPE( sparse_vector );
typedef void * extblas_sparse_vector;

/**
* Creates a handle to a new sparse vector that holds no entries.
Expand All @@ -72,7 +42,7 @@ typedef void * EXTBLAS_TYPE( sparse_vector );
*
* @returns An #extblas_sparse_vector that is under construction.
*/
EXTBLAS_TYPE( sparse_vector ) EXTBLAS_FUN( dusv_begin )( const int n );
extblas_sparse_vector EXTBLAS_dusv_begin( const int n );

/**
* Inserts a new nonzero entry into a sparse vector that is under construction.
Expand All @@ -90,8 +60,8 @@ EXTBLAS_TYPE( sparse_vector ) EXTBLAS_FUN( dusv_begin )( const int n );
*
* This is an implementation-specific extension.
*/
int EXTBLAS_FUN( dusv_insert_entry )(
EXTBLAS_TYPE( sparse_vector ) x,
int EXTBLAS_dusv_insert_entry(
extblas_sparse_vector x,
const double val,
const int index
);
Expand All @@ -108,7 +78,7 @@ int EXTBLAS_FUN( dusv_insert_entry )(
*
* This is an implementation-specific extension.
*/
int EXTBLAS_FUN( dusv_end )( EXTBLAS_TYPE( sparse_vector ) x );
int EXTBLAS_dusv_end( extblas_sparse_vector x );

/**
* Destroys the given sparse vector.
Expand All @@ -122,7 +92,7 @@ int EXTBLAS_FUN( dusv_end )( EXTBLAS_TYPE( sparse_vector ) x );
*
* This is an implementation-specific extension.
*/
int EXTBLAS_FUN( dusvds )( EXTBLAS_TYPE( sparse_vector ) x );
int EXTBLAS_dusvds( extblas_sparse_vector x );

/**
* Retrieves the number of nonzeroes in a given finalised sparse vector.
Expand All @@ -137,7 +107,7 @@ int EXTBLAS_FUN( dusvds )( EXTBLAS_TYPE( sparse_vector ) x );
*
* This is an implementation-specific extension.
*/
int EXTBLAS_FUN( dusv_nz )( const EXTBLAS_TYPE( sparse_vector ) x, int * nz );
int EXTBLAS_dusv_nz( const extblas_sparse_vector x, int * nz );

/**
* Opens a sparse vector for read-out.
Expand All @@ -154,7 +124,7 @@ int EXTBLAS_FUN( dusv_nz )( const EXTBLAS_TYPE( sparse_vector ) x, int * nz );
*
* This is an implementation-specific extension.
*/
int EXTBLAS_FUN( dusv_open )( const EXTBLAS_TYPE( sparse_vector ) x );
int EXTBLAS_dusv_open( const extblas_sparse_vector x );

/**
* Retrieves a sparse vector entry.
Expand Down Expand Up @@ -184,8 +154,8 @@ int EXTBLAS_FUN( dusv_open )( const EXTBLAS_TYPE( sparse_vector ) x );
*
* This is an implementation-specific extension.
*/
int EXTBLAS_FUN( dusv_get )(
const EXTBLAS_TYPE( sparse_vector ) x,
int EXTBLAS_dusv_get(
const extblas_sparse_vector x,
double * const val, int * const ind
);

Expand All @@ -200,7 +170,7 @@ int EXTBLAS_FUN( dusv_get )(
*
* This is an implementation-specific extension.
*/
int EXTBLAS_FUN( dusv_close )( const EXTBLAS_TYPE( sparse_vector ) x );
int EXTBLAS_dusv_close( const extblas_sparse_vector x );

/**
* Removes all entries from a finalised sparse vector.
Expand All @@ -213,9 +183,7 @@ int EXTBLAS_FUN( dusv_close )( const EXTBLAS_TYPE( sparse_vector ) x );
*
* This is an implementation-specific extension.
*/
int EXTBLAS_FUN( dusv_clear )( EXTBLAS_TYPE( sparse_vector ) x );

/**@}*/ // end doxygen grouping for SPARSEBLAS
int EXTBLAS_dusv_clear( extblas_sparse_vector x );

#ifdef __cplusplus
} // end extern "C"
Expand Down
Loading

0 comments on commit 8cf6dec

Please sign in to comment.