BeBOP Optimized Sparse Kernel Interface Library
1.0.1h
|
Matrix type management routines. More...
Go to the source code of this file.
Defines | |
#define | INC_OSKI_MATTYPES_H |
oski/mattypes.h has been included. | |
#define | OSKI_MATTYPE_ID(type) oski_LookupMatTypeId((const char *)(type), OSKI_IND_ID, OSKI_VAL_ID) |
Lookup the id of a matrix type, assuming the current compile-time default scalar types (OSKI_IND_ID and OSKI_VAL_ID). | |
Functions | |
void | oski_InitMatTypeManager (void) |
Initialize the matrix type manager. | |
void | oski_CloseMatTypeManager (void) |
Shutdown the matrix type manager. | |
oski_id_t | oski_RegisterMatType (const char *type_name, oski_id_t id_ind_type, oski_id_t id_val_type) |
Register a new matrix type, making it available to the entire library system. | |
oski_id_t | oski_LookupMatTypeId (const char *type_name, oski_id_t id_ind_type, oski_id_t id_val_type) |
Lookup the id of a matrix type. | |
Method lookup. | |
Routines to assist in finding methods within a module that following the BeBOP shared library naming scheme, and obtaining their function pointers. | |
#define | OSKI_MATTYPE_METHOD(type, name) |
Retrieve the method for a particular matrix type. | |
#define | OSKI_MATTYPEID_METHOD(type_id, name) |
Retrieve the method for a particular matrix type given the matrix type id. | |
void * | oski_LookupMatTypeMethod (const char *type_name, oski_id_t id_ind_type, oski_id_t id_val_type, const char *method_name) |
Lookup a method by raw matrix type information and method name. | |
void * | oski_LookupMatTypeIdMethod (oski_id_t id, const char *method_name) |
Lookup a method by matrix type ID and method name. |
Matrix type management routines.
The library maintains internal tables of modules containing actual kernel implementations instantiated for particular matrix types. This module defines an interface for registering new matrix types and retrieving function pointers to registered kernel implementations.
#define INC_OSKI_MATTYPES_H |
oski/mattypes.h has been included.
#define OSKI_MATTYPE_ID | ( | type | ) | oski_LookupMatTypeId((const char *)(type), OSKI_IND_ID, OSKI_VAL_ID) |
Lookup the id of a matrix type, assuming the current compile-time default scalar types (OSKI_IND_ID and OSKI_VAL_ID).
The implementation is just a wrapper around a call to oski_LookupMatTypeId with the default scalar types OSKI_IND_ID and OSKI_VAL_ID.
[in] | type | String type name (e.g., "CSR"). |
Referenced by oski_CreateLuaMatReprGeneric2IndexFromCSR(), oski_CreateLuaMatReprGenericFromCSR(), oski_CreateMatCSC_arr(), and oski_CreateMatCSR_arr().
#define OSKI_MATTYPE_METHOD | ( | type, | |
name | |||
) |
(OSKI_MAKENAME_FUNCPT(name))oski_LookupMatTypeMethod( \ type, OSKI_IND_ID, OSKI_VAL_ID, \ "oski_" MACRO_TO_STRING(name) \ )
Retrieve the method for a particular matrix type.
Relies on the compile-time default scalar type macros, OSKI_IND_ID and OSKI_VAL_ID.
[in] | type | Matrix type name, as a string. |
[in] | name | Method base name (not as a string constant). |
Referenced by CalcMatRepr1NormViaCSR(), CanBeExecuted(), ConvertCSRLeftoverRows(), DestroySubmatBCSR(), GetBCSREntryRaw(), MeasureStreamTimeCSR(), oski_ConditionallyExpandCSRToFull(), oski_ConvertMatReprToCSR(), oski_CopyMatRepr(), oski_CreateLuaMatReprGeneric2IndexFromCSR(), oski_CreateLuaMatReprGenericFromCSR(), oski_CreateMatCSC_arr(), oski_CreateMatCSR_arr(), oski_CreateMatReprFromCSR(), oski_DestroyMatRepr(), oski_MatReprMult(), oski_MatReprTrisolve(), oski_WrapCSC(), and SetBCSREntryRaw().
#define OSKI_MATTYPEID_METHOD | ( | type_id, | |
name | |||
) |
(OSKI_MAKENAME_FUNCPT(name))oski_LookupMatTypeIdMethod( \ type_id, "oski_" MACRO_TO_STRING(name) \ )
Retrieve the method for a particular matrix type given the matrix type id.
[in] | type_id | Matrix type, by ID. |
[in] | name | Method base name (not as a string constant). |
Referenced by CalcMatRepr1NormViaCSR(), CopyMatSpecific(), GetClique(), GetDiagValues(), GetMatEntry(), oski_CalcMat1Norm(), oski_DestroyMatStruct(), oski_FreeInputMatRepr(), oski_MatMult(), oski_MatMultAndMatTransMult(), oski_MatPowMult(), oski_MatTransMatMult(), oski_MatTrisolve(), oski_ReplaceTunedMatRepr(), SetClique(), SetDiagValues(), and SetMatEntry().
void oski_CloseMatTypeManager | ( | void | ) |
Shutdown the matrix type manager.
References oski_CloseMatTypeManager(), oski_GetNumMatTypes(), oski_PrintDebugMessage(), simplelist_Destroy(), and simplelist_GetElem().
Referenced by oski_Close(), and oski_CloseMatTypeManager().
void oski_InitMatTypeManager | ( | void | ) |
Initialize the matrix type manager.
References oski_InitMatTypeManager(), oski_PrintDebugMessage(), and simplelist_Create().
Referenced by oski_Init(), and oski_InitMatTypeManager().
oski_id_t oski_LookupMatTypeId | ( | const char * | type_name, |
oski_id_t | id_ind_type, | ||
oski_id_t | id_val_type | ||
) |
Lookup the id of a matrix type.
[in] | type_name | String identifier of the general matrix type being sought. |
[in] | id_ind_type | Integer index type. |
[in] | id_val_type | Non-zero value type. |
References tagBebop_mattype_t::id, tagBebop_mattype_t::id_index_type, tagBebop_mattype_t::id_value_type, INVALID_ID, tagBebop_mattype_t::name, oski_GetNumMatTypes(), oski_LookupMatTypeId(), and simplelist_GetElem().
Referenced by CheckArgs(), ConvertLuaMatToCSR(), oski_EstimateFillBCSR(), oski_HeurIsApplicable(), oski_LookupMatTypeId(), oski_LookupMatTypeMethod(), and oski_RegisterMatType().
oski_id_t oski_RegisterMatType | ( | const char * | type_name, |
oski_id_t | id_ind_type, | ||
oski_id_t | id_val_type | ||
) |
Register a new matrix type, making it available to the entire library system.
Register a new matrix type, making it available to the entire library system.
[in] | type_name | Short, unique string identifier. The name should match the regular expression, "[0-9a-zA-Z_]+". |
[in] | id_ind_type | Integer index type (see oski/scalinfo.h). |
[in] | id_val_type | Non-zero value type (see oski/scalinfo.h). |
References tagBebop_mattype_t::desc, tagBebop_mattype_t::id, tagBebop_mattype_t::id_index_type, tagBebop_mattype_t::id_value_type, INVALID_ID, tagBebop_mattype_t::modname, tagBebop_mattype_t::module, tagBebop_mattype_t::name, oski_DuplicateString(), oski_Free, oski_LoadModuleOptional(), oski_LookupMatTypeId(), oski_MakeModuleDesc(), oski_MakeModuleName(), oski_Malloc, oski_PrintDebugMessage(), oski_RegisterMatType(), and simplelist_Append().
Referenced by oski_LookupMatTypeMethod(), and oski_RegisterMatType().