BeBOP Optimized Sparse Kernel Interface Library  1.0.1h
Data Structures | Defines
structhint.h File Reference

Structural hint implementation. More...

#include <oski/common.h>

Go to the source code of this file.

Data Structures

struct  oski_structhint_t
 Structural hint record. More...

Defines

#define INC_OSKI_STRUCTHINT_H
 oski/structhint.h has been included.

Functions

void oski_InitStructHint (oski_structhint_t *hint)
 Initialize a structural hint record.
void oski_ResetStructHint (oski_structhint_t *hint)
 Reset 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.

Detailed Description

Structural hint implementation.

Structural hints are stored in records defined by the oski_structhint_t type, below, and stored with the matrix (see oski_matstruct_t).

Workload hints are stored as (simulated) traces with the matrix (see oski_matstruct_t).


Define Documentation

oski/structhint.h has been included.


Function Documentation

int oski_AllocStructHintBlocksizes ( oski_structhint_t hint,
int  num_sizes 
)

Attempt to allocate space of 'num_sizes' block sizes.

Parameters:
[in,out]hintHint to set.
[in]num_sizesNumber 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]hintHint to which this routine applies.
[in]num_lensNumber 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().

Initialize a structural hint record.

Parameters:
[in,out]hintStructural 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().

Reset a structural hint record.

Parameters:
[in,out]hintReinitializes 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().