structhint.c File Reference

Implementation of structural tuning hint data structure. More...

#include <assert.h>
#include <oski/common.h>
#include <oski/structhint.h>

Functions

void oski_InitStructHint (oski_structhint_t *hint)
 Initialize a structural hint record.
void oski_ResetStructHintDiaglens (oski_structhint_t *hint)
 Clears the diagonal length block list, and resets the count of number of diagonal lengths to 0.
int oski_AllocStructHintDiaglens (oski_structhint_t *hint, int num_lens)
 Attempt to allocate space for some number of diagonal lengths.
void oski_ResetStructHintBlocksizes (oski_structhint_t *hint)
 Clears the dense block size list, and resets the count of number of block sizes to 0.
int oski_AllocStructHintBlocksizes (oski_structhint_t *hint, int num_sizes)
 Attempt to allocate space of 'num_sizes' block sizes.
void oski_ResetStructHint (oski_structhint_t *hint)
 Reset a structural hint record.


Detailed Description

Implementation of structural tuning hint data structure.


Function Documentation

int oski_AllocStructHintBlocksizes ( oski_structhint_t hint,
int  num_sizes 
)

Attempt to allocate space of 'num_sizes' block sizes.

Parameters:
[in,out] hint Hint to set.
[in] num_sizes Number of block sizes to set.
Even if the allocation fails, the block size count is set to 'num_sizes' and the previous block size list is lost (freed).

If num_sizes is 0, then no space is allocated.

Returns:
Returns 1 <==> no errors occurred.

References oski_structhint_t::block_size, oski_structhint_t::c_sizes, oski_structhint_t::num_sizes, oski_Malloc, oski_ResetStructHintBlocksizes(), and oski_structhint_t::r_sizes.

Referenced by oski_SetHint().

int oski_AllocStructHintDiaglens ( oski_structhint_t hint,
int  num_lens 
)

Attempt to allocate space for some number of diagonal lengths.

Parameters:
[in,out] hint Hint to which this routine applies.
[in] num_lens Number of diagonal lengths for which to allocate space.
Even if the allocation fails, the diagonal length size count is set to 'num_lens' and the previous diagonal length list is lost (freed).

If num_lens is 0, then no space is allocated.

Returns:
Returns 1 <==> the lists could be allocated.

References oski_structhint_t::d_lens, oski_structhint_t::diag_lens, oski_structhint_t::num_lens, oski_Malloc, and oski_ResetStructHintDiaglens().

Referenced by oski_SetHint().

void oski_InitStructHint ( oski_structhint_t hint  ) 

Initialize a structural hint record.

Parameters:
[in,out] hint Structural hint record.
Postcondition:
Initializes the fields of a structural hint record to default values.

References oski_structhint_t::block_size, oski_structhint_t::c_sizes, oski_structhint_t::d_lens, oski_structhint_t::diag_lens, oski_structhint_t::is_random, oski_structhint_t::is_symm, oski_structhint_t::is_unaligned, oski_structhint_t::num_lens, oski_structhint_t::num_sizes, and oski_structhint_t::r_sizes.

Referenced by oski_CreateMatStruct(), and oski_ResetStructHint().

void oski_ResetStructHint ( oski_structhint_t hint  ) 

Reset a structural hint record.

Parameters:
[in,out] hint Reinitializes a previously allocated and used structural hint record.
This routine reinitializes the fields of 'hint' to their default values, and frees any associated data stored with the 'hint' on call to this routine.

References oski_InitStructHint(), oski_ResetStructHintBlocksizes(), and oski_ResetStructHintDiaglens().

Referenced by oski_DestroyMatStruct().


Generated on Fri Apr 8 22:35:19 2011 for BeBOP Optimized Sparse Kernel Interface Library by  doxygen 1.5.9