Skylark (Sketching Library)  0.1
Classes | Namespaces | Defines | Enumerations | Functions
/var/lib/jenkins/jobs/Skylark/workspace/sketch/capi/sketchc.hpp File Reference
#include "mpi.h"
#include "../../config.h"
#include "../../utility/distributions.hpp"
#include "../sketch.hpp"
#include "../../base/context.hpp"
Include dependency graph for sketchc.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  skylark::sketch::c::sketch_transform_t

Namespaces

namespace  skylark
namespace  skylark::sketch
namespace  skylark::sketch::c

Defines

#define SL_COLUMNWISE   1
#define SL_ROWWISE   2

Enumerations

enum  skylark::sketch::c::transform_type_t {
  skylark::sketch::c::TRANSFORM_TYPE_ERROR, skylark::sketch::c::JLT, skylark::sketch::c::CT, skylark::sketch::c::FJLT,
  skylark::sketch::c::CWT, skylark::sketch::c::MMT, skylark::sketch::c::WZT, skylark::sketch::c::PPT,
  skylark::sketch::c::GaussianRFT, skylark::sketch::c::LaplacianRFT, skylark::sketch::c::FastGaussianRFT, skylark::sketch::c::ExpSemigroupRLT
}
enum  skylark::sketch::c::matrix_type_t {
  skylark::sketch::c::MATRIX_TYPE_ERROR, skylark::sketch::c::MATRIX, skylark::sketch::c::SHARED_MATRIX, skylark::sketch::c::ROOT_MATRIX,
  skylark::sketch::c::DIST_MATRIX, skylark::sketch::c::DIST_MATRIX_VC_STAR, skylark::sketch::c::DIST_MATRIX_VR_STAR, skylark::sketch::c::DIST_MATRIX_STAR_VC,
  skylark::sketch::c::DIST_MATRIX_STAR_VR, skylark::sketch::c::DIST_SPARSE_MATRIX, skylark::sketch::c::SPARSE_MATRIX
}

Functions

SKYLARK_EXTERN_API char * sl_supported_sketch_transforms ()
SKYLARK_EXTERN_API const char * sl_strerror (const int errorcode)
SKYLARK_EXTERN_API bool sl_has_elemental ()
SKYLARK_EXTERN_API bool sl_has_combblas ()
SKYLARK_EXTERN_API int sl_create_default_context (int seed, base::context_t **ctxt)
SKYLARK_EXTERN_API int sl_create_context (int seed, MPI_Comm cm, base::context_t **ctxt)
SKYLARK_EXTERN_API int sl_free_context (base::context_t *ctxt)
SKYLARK_EXTERN_API int sl_create_sketch_transform (base::context_t *ctxt, char *type, int n, int s, sketchc::sketch_transform_t **sketch,...)
SKYLARK_EXTERN_API int sl_deserialize_sketch_transform (const char *data, sketchc::sketch_transform_t **sketch)
SKYLARK_EXTERN_API int sl_serialize_sketch_transform (const sketchc::sketch_transform_t *sketch, char **data)
SKYLARK_EXTERN_API int sl_free_sketch_transform (sketchc::sketch_transform_t *S)
SKYLARK_EXTERN_API int sl_apply_sketch_transform (sketchc::sketch_transform_t *S, char *input_type, void *A, char *output_type, void *SA, int dim)
SKYLARK_EXTERN_API int sl_wrap_raw_matrix (double *data, int m, int n, void **A)
SKYLARK_EXTERN_API int sl_free_raw_matrix_wrap (void *A_)
SKYLARK_EXTERN_API int sl_wrap_raw_sp_matrix (int *indptr, int *ind, double *data, int nnz, int n_rows, int n_cols, void **A)
SKYLARK_EXTERN_API int sl_free_raw_sp_matrix_wrap (void *A_)
SKYLARK_EXTERN_API int sl_raw_sp_matrix_struct_updated (void *A_, bool *struct_updated)
SKYLARK_EXTERN_API int sl_raw_sp_matrix_reset_update_flag (void *A_)
SKYLARK_EXTERN_API int sl_raw_sp_matrix_nnz (void *A_, int *nnz)
SKYLARK_EXTERN_API int sl_raw_sp_matrix_data (void *A_, int32_t *indptr, int32_t *indices, double *values)

Define Documentation

#define SL_COLUMNWISE   1

Definition at line 68 of file sketchc.hpp.

#define SL_ROWWISE   2

Definition at line 69 of file sketchc.hpp.


Function Documentation

SKYLARK_EXTERN_API int sl_apply_sketch_transform ( sketchc::sketch_transform_t S,
char *  input_type,
void *  A,
char *  output_type,
void *  SA,
int  dim 
)
SKYLARK_EXTERN_API int sl_create_context ( int  seed,
MPI_Comm  cm,
base::context_t **  ctxt 
)

Creating a Skylark context required for applying sketches.

Parameters:
seedfor the rng generator
cmMPI communicator used
Returns:
a Skylark context

Definition at line 201 of file capi.cpp.

References SKYLARK_BEGIN_TRY, SKYLARK_CATCH_AND_RETURN_ERROR_CODE, and SKYLARK_END_TRY.

SKYLARK_EXTERN_API int sl_create_default_context ( int  seed,
base::context_t **  ctxt 
)

Creating a default Skylark context required for applying sketches.

Parameters:
seedfor the rng generator
Returns:
a Skylark context

Support for skylark::base::context_t.

Definition at line 192 of file capi.cpp.

References SKYLARK_BEGIN_TRY, SKYLARK_CATCH_AND_RETURN_ERROR_CODE, and SKYLARK_END_TRY.

SKYLARK_EXTERN_API int sl_create_sketch_transform ( base::context_t ctxt,
char *  type_,
int  n,
int  s,
sketchc::sketch_transform_t **  sketch,
  ... 
)
SKYLARK_EXTERN_API int sl_deserialize_sketch_transform ( const char *  data,
sketchc::sketch_transform_t **  sketch 
)

Deserialize a sketch transformation.

Parameters:
datastring of serialized JSON structure
sketchthe deserialized sketch transformation

Definition at line 278 of file capi.cpp.

References skylark::sketch::sketch_transform_data_t::from_ptree(), and skylark::sketch::sketch_transform_data_t::get_type().

Here is the call graph for this function:

SKYLARK_EXTERN_API int sl_free_context ( base::context_t ctxt)

Free resources hold by a Skylark context.

Parameters:
ctxtSkylark context

Definition at line 210 of file capi.cpp.

References SKYLARK_BEGIN_TRY, SKYLARK_CATCH_AND_RETURN_ERROR_CODE, and SKYLARK_END_TRY.

SKYLARK_EXTERN_API int sl_free_raw_matrix_wrap ( void *  A_)

Definition at line 726 of file capi.cpp.

SKYLARK_EXTERN_API int sl_free_raw_sp_matrix_wrap ( void *  A_)

Definition at line 745 of file capi.cpp.

SKYLARK_EXTERN_API int sl_free_sketch_transform ( sketchc::sketch_transform_t S)
SKYLARK_EXTERN_API bool sl_has_combblas ( )

Definition at line 183 of file capi.cpp.

SKYLARK_EXTERN_API bool sl_has_elemental ( )

Provide mechanism to check for add-ons.

Returns:
a boolean if the add-on library is enabled

Definition at line 175 of file capi.cpp.

SKYLARK_EXTERN_API int sl_raw_sp_matrix_data ( void *  A_,
int32_t *  indptr,
int32_t *  indices,
double *  values 
)

Definition at line 766 of file capi.cpp.

SKYLARK_EXTERN_API int sl_raw_sp_matrix_nnz ( void *  A_,
int *  nnz 
)

Definition at line 761 of file capi.cpp.

SKYLARK_EXTERN_API int sl_raw_sp_matrix_reset_update_flag ( void *  A_)

Definition at line 756 of file capi.cpp.

SKYLARK_EXTERN_API int sl_raw_sp_matrix_struct_updated ( void *  A_,
bool *  struct_updated 
)

Definition at line 750 of file capi.cpp.

SKYLARK_EXTERN_API int sl_serialize_sketch_transform ( const sketchc::sketch_transform_t sketch,
char **  data 
)

Serializes a sketch transformation.

Parameters:
sketchthe sketch to be serialized
dataof the serialized JSON structure

Definition at line 294 of file capi.cpp.

References skylark::sketch::sketch_transform_data_t::to_ptree(), and skylark::sketch::c::sketch_transform_t::transform_obj.

Here is the call graph for this function:

SKYLARK_EXTERN_API const char* sl_strerror ( const int  errorcode)

Converting an error code to a human readable string describing the failure

Parameters:
errorcodethe error code to resolve
Returns:
a string containing the error message

Definition at line 171 of file capi.cpp.

References skylark_strerror().

Here is the call graph for this function:

SKYLARK_EXTERN_API char* sl_supported_sketch_transforms ( )
SKYLARK_EXTERN_API int sl_wrap_raw_matrix ( double *  data,
int  m,
int  n,
void **  A 
)

Definition at line 713 of file capi.cpp.

SKYLARK_EXTERN_API int sl_wrap_raw_sp_matrix ( int *  indptr,
int *  ind,
double *  data,
int  nnz,
int  n_rows,
int  n_cols,
void **  A 
)

Definition at line 736 of file capi.cpp.

References skylark::base::sparse_matrix_t< ValueType >::attach().

Here is the call graph for this function: