-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpartition.h
39 lines (30 loc) · 1.13 KB
/
partition.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef PARTITION_H
#define PARTITION_H
#include "utils.h"
/**
* Generate a partitioning that does not split 2x2 blocks.
*
* @param[in] n Dimension of the system
* @param[in] num_tiles Number of tiles.
* @param[in] tlsz Tile size.
* @param[out] p Array of size (num_tiles + 1). On exit, p[i] holds
* the start index of the i-th tile and p[i+1]-p[i]
* yields the size of a tile.
*/
void partition(
int n, int num_tiles, int tlsz, int *restrict p);
/**
* Apply partitioning to a matrix.
*
* @param[in] A The matrix in column major format to be partitioned.
* @param[in] ldA The leading dimension of A.
* @param[in] p Partitioning generated by partition().
* @param[out] A_tiles On entry, a num_blks-by-num_blks array of pointers. On
* exit, A_tiles[i][j] holds the base pointer to the
* tile (i,j) according to the partitioning.
*/
void partition_matrix(
const double *restrict A, int ldA,
const partitioning_t *restrict p,
double ***restrict const A_tiles);
#endif