21 int lm,
int ln,
int i,
int j,
int m,
int n)
24 PLASMA_desc *pdesc = &(desc.
desc);
28 pdesc->A21 = (lm - lm%mb)*(ln - ln%nb);
29 pdesc->A12 = ( lm%mb)*(ln - ln%nb) + pdesc->A21;
30 pdesc->A22 = (lm - lm%mb)*( ln%nb) + pdesc->A12;
42 pdesc->lmt = (lm%mb==0) ? (lm/mb) : (lm/mb+1);
43 pdesc->lnt = (ln%nb==0) ? (ln/nb) : (ln/nb+1);
50 pdesc->mt = (i+m-1)/mb - i/mb + 1;
51 pdesc->nt = (j+n-1)/nb - j/nb + 1;
65 PLASMA_desc *pdescB = &(descB.
desc);
77 pdescB->mt = (i+m-1)/mb - i/mb + 1;
78 pdescB->nt = (j+n-1)/nb - j/nb + 1;
90 if (desc->
desc.mat == NULL) {
91 magma_error(
"magma_desc_check",
"NULL matrix pointer");
94 if (desc->
desc.dtyp != PlasmaRealFloat &&
95 desc->
desc.dtyp != PlasmaRealDouble &&
96 desc->
desc.dtyp != PlasmaComplexFloat &&
97 desc->
desc.dtyp != PlasmaComplexDouble ) {
98 magma_error(
"magma_desc_check",
"invalid matrix type");
101 if (desc->
desc.mb <= 0 || desc->
desc.nb <= 0) {
102 magma_error(
"magma_desc_check",
"negative tile dimension");
106 magma_error(
"magma_desc_check",
"tile memory size smaller than the product of dimensions");
109 if (desc->
desc.lm <= 0 || desc->
desc.ln <= 0) {
110 magma_error(
"magma_desc_check",
"negative matrix dimension");
114 magma_error(
"magma_desc_check",
"beginning of the matrix out of scope");
118 magma_error(
"magma_desc_check",
"submatrix out of scope");
132 if ((desc->
desc.mat = malloc(size)) == NULL) {
133 magma_error(
"magma_desc_mat_alloc",
"malloc() failed");
150 if (desc->
desc.mat != NULL) {
151 free(desc->
desc.mat);
152 desc->
desc.mat = NULL;
212 int lm,
int ln,
int i,
int j,
int m,
int n)
219 magma_error(
"MAGMA_Desc_Create",
"MAGMA not initialized");
225 magma_error(
"MAGMA_Desc_Create",
"malloc() failed");
229 (**desc).desc.mat = mat;
236 magma_error(
"MAGMA_Desc_Create",
"invalid descriptor");
266 magma_error(
"MAGMA_Desc_Destroy",
"MAGMA not initialized");
270 magma_error(
"MAGMA_Desc_Destroy",
"attempting to destroy a NULL descriptor");