#include <stdio.h>#include <stdlib.h>#include <math.h>#include "collection.h"

Go to the source code of this file.
Data Structures | |
| struct | linearRegister |
| Data structure used for representing a linearly accessible register. More... | |
| struct | Address2d |
| Data structure used for representing a 2D address. More... | |
| struct | BlockAccess |
| struct | PolymorphicRegister |
| Data structure used for representing a Polymorphic Register. More... | |
Macros | |
| #define | ERR -1 |
| The default error value. More... | |
Enumerations | |
| enum | scheme { RECTANGLE_ONLY, RECT_ROW, RECT_COL, ROW_COL, RECT_TRECT, UNDEFINED } |
| Enum containing all the available mapping scheme. More... | |
| enum | acc_type { RECTANGLE, TRANSP_RECTANGLE, ROW, COLUMN, MAIN_DIAG, SECONDARY_DIAG, DEFAULT } |
| Enum containing all the available access types. More... | |
Functions | |
| int | m_v (int index_i, int index_j, scheme s, int p, int q) |
| Given two input indices and a PRF mapping scheme, outputs the row of the corrispondent linear register where the data is stored. More... | |
| int | m_h (int index_i, int index_j, scheme s, int p, int q) |
| Given two input indices and a PRF mapping scheme, outputs the column of the corrispondent linear register where the data is stored. More... | |
| int | A_standard (int index_i, int index_j, int p, int q) |
| Given two input indices and a PRF mapping scheme, outputs the linear register index where the data is stored. More... | |
| int | A_custom (PolymorphicRegister *pR, int index_i, int index_j, int alpha, int beta, acc_type type) |
| PolymorphicRegister * | createPolymorphicRegister (int p, int q, int linRegSize) |
| Allocates memory required for a Polymorphic Register and returns a pointer to it. More... | |
| void | writeToPR (PolymorphicRegister *pR, int data, int index_i, int index_j) |
| Stores an integer at the given "logical" index in the Polymorphic Register given as argument. More... | |
| int | readFromPR (PolymorphicRegister *pR, int index_i, int index_j) |
| Reads an integer at the given "logical" index in the Polymorphic Register given as argument. More... | |
| int ** | parallelReadFromPR (PolymorphicRegister *pR, int z) |
| Reads an array of integer at the given depth in the Polymorphic Register given as argument. More... | |
| int ** | readBlock (PolymorphicRegister *pR, int index_i, int index_j, acc_type type) |
| Performs a block read on the PolymorphicRegister. More... | |
| int ** | readBlockCustom (PolymorphicRegister *pR, int index_i, int index_j, acc_type type) |
| int ** | computeConflicts (PolymorphicRegister *pR, int index_i, int index_j, acc_type type) |
| Computes the conflict matrix relative to a block read on the PolymorphicRegister. More... | |
| Address2d * | AGU (int index_i, int index_j, int p, int q, acc_type type) |
| Generates all the 2D logical addresses of the elements read in a block read. More... | |
| int | compareAddress (void *a, void *b) |
| t_list * | parallelAccessCoverage (PolymorphicRegister *pR, t_list *parallel_accesses) |
Variables | |
| int | N |
| Size of the horizontal dimension of the original matrix. More... | |
| int | M |
| Size of the vertical dimension of the original matrix. More... | |
| #define ERR -1 |
The default error value.
| enum acc_type |
| enum scheme |
Enum containing all the available mapping scheme.
suitable for mapping input matrix logical addresses into physical Polymorphic Register addresses;
| int A_standard | ( | int | index_i, |
| int | index_j, | ||
| int | p, | ||
| int | q | ||
| ) |
Given two input indices and a PRF mapping scheme, outputs the linear register index where the data is stored.
| index_i | index of the access. |
| index_j | index of the access. |
| p | size of the PRF on its first dimension. |
| q | size of the PRF on its second dimension. |
Generates all the 2D logical addresses of the elements read in a block read.
| index_i | index of the top-left element in the block read. |
| index_j | index of the top-left element in the block read. |
| p | size of the PRF on its first dimension. |
| q | size of the PRF on its second dimension. |
| type | access type specifying the shape of the block access. |
| int** computeConflicts | ( | PolymorphicRegister * | pR, |
| int | index_i, | ||
| int | index_j, | ||
| acc_type | type | ||
| ) |
Computes the conflict matrix relative to a block read on the PolymorphicRegister.
| pR | Pointer to the Polymorphic Register. |
| index_i | Logical index on the horizontal dimension of the top-left element in the accessed block. |
| index_j | Logical index on the vertical dimension of the top-left element in the accessed block. |
| type | Access Type defining the shape of the block access. |
| PolymorphicRegister* createPolymorphicRegister | ( | int | p, |
| int | q, | ||
| int | linRegSize | ||
| ) |
Allocates memory required for a Polymorphic Register and returns a pointer to it.
| p | size of the PRF on its first dimension. |
| q | size of the PRF on its second dimension. |
| linRegSize | size of each linear register in the PRF. |
| int m_h | ( | int | index_i, |
| int | index_j, | ||
| scheme | s, | ||
| int | p, | ||
| int | q | ||
| ) |
Given two input indices and a PRF mapping scheme, outputs the column of the corrispondent linear register where the data is stored.
| index_i | index of the access. |
| index_j | index of the access. |
| s | selected mapping scheme for the access. |
| p | size of the PRF on its first dimension. |
| q | size of the PRF on its second dimension. |
| int m_v | ( | int | index_i, |
| int | index_j, | ||
| scheme | s, | ||
| int | p, | ||
| int | q | ||
| ) |
Given two input indices and a PRF mapping scheme, outputs the row of the corrispondent linear register where the data is stored.
| index_i | index of the access. |
| index_j | index of the access. |
| s | selected mapping scheme for the access. |
| p | size of the PRF on its first dimension. |
| q | size of the PRF on its second dimension. |
| int** parallelReadFromPR | ( | PolymorphicRegister * | pR, |
| int | z | ||
| ) |
Reads an array of integer at the given depth in the Polymorphic Register given as argument.
| pR | Pointer to the Polymorphic Register. |
| z | Depth of the 2D array in the Polymorphic Register. |
| int** readBlock | ( | PolymorphicRegister * | pR, |
| int | index_i, | ||
| int | index_j, | ||
| acc_type | type | ||
| ) |
Performs a block read on the PolymorphicRegister.
| pR | Pointer to the Polymorphic Register. |
| index_i | Logical index on the horizontal dimension of the top-left element in the accessed block. |
| index_j | Logical index on the vertical dimension of the top-left element in the accessed block. |
| type | Access Type defining the shape of the block access. |
| int readFromPR | ( | PolymorphicRegister * | pR, |
| int | index_i, | ||
| int | index_j | ||
| ) |
Reads an integer at the given "logical" index in the Polymorphic Register given as argument.
| pR | Pointer to the Polymorphic Register. |
| index_i | Logical index on the first dimension. |
| index_j | Logical index on the second dimension. |
| void writeToPR | ( | PolymorphicRegister * | pR, |
| int | data, | ||
| int | index_i, | ||
| int | index_j | ||
| ) |
Stores an integer at the given "logical" index in the Polymorphic Register given as argument.
| pR | Pointer to the Polymorphic Register. |
| index_i | Logical index on the first dimension. |
| index_j | Logical index on the second dimension. |
| data | integer to store |
| int M |
Size of the vertical dimension of the original matrix.
| int N |
Size of the horizontal dimension of the original matrix.