BeBOP Optimized Sparse Kernel Interface Library
1.0.1h
|
00001 /* 00002 * file : spmv_tile_graph.h 00003 * desc : Defines auxiliary tile-graph data structure for 00004 * serial sparse tiling. 00005 */ 00006 00007 #if !defined(INC_SPMV_TILE_GRAPH_H) 00008 #define INC_SPMV_TILE_GRAPH_H 00009 00010 typedef struct tagTileGraph 00011 { 00012 int m; 00013 int n_iters; 00014 00015 int *nodes; 00016 } TileGraph; 00017 00018 #define NO_COLOR 0 00019 00020 #define TG_GET_VEC( G, r ) ((const int *)((G)->nodes + (r)*((G)->m))) 00021 #define TG_NODE( G, r, i ) ((G)->nodes[(r)*((G)->m) + (i)]) 00022 00023 /* 00024 * Partitions destination nodes into equal, consecutive subsets. 00025 */ 00026 extern TileGraph *tg_alloc (int m, int n_iters); 00027 extern void tg_free (TileGraph * G); 00028 extern void tg_color_init (TileGraph * G, int num_colors); 00029 extern void tg_color_tiles (TileGraph * G, 00030 int row_block_size, int col_block_size, 00031 const int *ptr, const int *ind); 00032 00033 /* 00034 * (index, color) tuples 00035 */ 00036 #define PAIR_NODE(s, i) ((s)[2*(i)]) 00037 #define PAIR_COLOR(s, i) ((s)[2*(i)+1]) 00038 00039 extern int *tg_sort_colors (int n, const int *colors); 00040 00041 #endif 00042 00043 /* 00044 * $Log: spmv_tile_graph.h,v $ 00045 * Revision 1.1.1.1 2005/06/29 22:07:52 rvuduc 00046 * Initial import 00047 * 00048 * 00049 * eof 00050 */