mattypes.h File Reference


Detailed Description

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.

See also:
Matrix Types

oski/scalinfo.h

Go to the source code of this file.

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.

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.


Define Documentation

#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.

Parameters:
[in] type String type name (e.g., "CSR").

#define OSKI_MATTYPE_METHOD type,
name   ) 
 

Value:

Retrieve the method for a particular matrix type.

Relies on the compile-time default scalar type macros, OSKI_IND_ID and OSKI_VAL_ID.

Parameters:
[in] type Matrix type name, as a string.
[in] name Method base name (not as a string constant).
Returns:
A function pointer of the appropriate type, or NULL on error.

#define OSKI_MATTYPEID_METHOD type_id,
name   ) 
 

Value:

Retrieve the method for a particular matrix type given the matrix type id.

Parameters:
[in] type_id Matrix type, by ID.
[in] name Method base name (not as a string constant).
Returns:
A function pointer of the appropriate type, or NULL on error.


Function Documentation

void oski_CloseMatTypeManager void   ) 
 

Shutdown the matrix type manager.

Returns:
Destroys the list of available matrix types.
Postcondition:
g_avail_mattypes == NULL.

void oski_InitMatTypeManager void   ) 
 

Initialize the matrix type manager.

Returns:
Initializes the list of available matrix types.
Todo:
Should call this routine during library initialization.

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.

Parameters:
[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.
Returns:
Returns an id number that uniquely identifies the given matrix type, specialized using particular integer index and non-zero value types, if the type has been registered in the system. Otherwise, returns INVALID_ID.
See also:
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.

Parameters:
[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).
Returns:
A unique positive integer identifying this type, or INVALID_ID on error.
See also:
oski_LookupMatTypeId
Postcondition:
This routine creates a new registration record and fills in all of its fields, including loading its main shared library module.


Generated on Wed Sep 19 16:41:22 2007 for BeBOP Optimized Sparse Kernel Interface Library by  doxygen 1.4.6