1 // =============================================================================
2 // === GPUQREngine/Include/GPUQREngine_SparseMeta.hpp ==========================
3 // =============================================================================
4 //
5 // The SparseMeta class further wraps metadata required to perform a sparse
6 // factorization. SparseMeta sits within the Front class.
7 //
8 // =============================================================================
9 
10 #ifndef GPUQRENGINE_SPARSEMETA_HPP
11 #define GPUQRENGINE_SPARSEMETA_HPP
12 
13 #include "GPUQREngine_SEntry.hpp"
14 
15 // Using int instead of Int or Long since we need to know the exact
16 // sizes on the CPU and GPU.
17 
18 /* Has more stuff to support sparse multifrontal factorization */
19 class SparseMeta
20 {
21 public:
22     int fp;               // # of pivotal columns in the front
23     int nc;               // # of remaining children for the front
24     bool isStaged;        // T/F indicating whether this front's
25                           // parent is in a future stage
26     bool pushOnly;        // Related to isStaged, pushOnly signals
27                           // whether the front should only push its
28                           // data to its parent
29     bool isSparse;        // T/F indicating sparsiy
30 
31     /* Metadata for S Assembly */
32     int lastSIndex;
33     SEntry *cpuS;         // Packed S - pointer into scheduler's cpuS
34     SEntry *gpuS;         // Packed S - pointer into scheduler's gpuS
35     int Scount;           // # S entries to ship to GPU.
36 
37     /* Metadata for Pack Assembly */
38     int cm;               // # rows of the contribution block
39     int cn;               // # cols of the contribution block
40     int csize;            // total size of the contribution block
41                           //   (rows*cols)
42     int pn;               // # of columns in the parent
43     int pc;               // the p start for the contribution block
44     int lastCiStart;      // Last contribution block row where we added a task
45     int lastCjStart;      // Last contribution block col where we added a task
46     int *gpuRjmap;        // The gpu location of the Rjmap
47     int *gpuRimap;        // The gpu location of the Rimap
48     double *gpuC;         // location of the front's contribution block
49     double *gpuP;         // The location of the front's parent
50 
SparseMeta()51     SparseMeta()
52     {
53         fp = 0;
54         nc = 0;
55         isStaged = false;
56         pushOnly = false;
57         isSparse = false;
58 
59         lastSIndex = 0;
60         cpuS = NULL;
61         gpuS = NULL;
62         Scount = 0;
63 
64         cm = 0;
65         cn = 0;
66         csize = 0;
67         pn = 0;
68         pc = 0;
69         lastCiStart = 0;
70         lastCjStart = 0;
71         gpuRjmap = NULL;
72         gpuRimap = NULL;
73         gpuC = NULL;
74         gpuP = NULL;
75     }
76 
~SparseMeta()77     ~SparseMeta()
78     {
79     }
80 };
81 
82 #endif
83