Lines Matching refs:sliceheight

120   if (!b->sliceheight) { /* not set yet */  in MatSeqSELLSetPreallocation_SeqSELL()
122 b->sliceheight = 16; in MatSeqSELLSetPreallocation_SeqSELL()
124 b->sliceheight = 8; in MatSeqSELLSetPreallocation_SeqSELL()
127 totalslices = PetscCeilInt(B->rmap->n, b->sliceheight); in MatSeqSELLSetPreallocation_SeqSELL()
130 …if (B->rmap->n % b->sliceheight) PetscCall(PetscInfo(B, "Padding rows to the SEQSELL matrix becaus… in MatSeqSELLSetPreallocation_SeqSELL()
141 while (b->sliceheight * maxallocrow % DEVICE_MEM_ALIGN) maxallocrow++; in MatSeqSELLSetPreallocation_SeqSELL()
143 for (i = 0; i <= totalslices; i++) b->sliidx[i] = b->sliceheight * i * maxallocrow; in MatSeqSELLSetPreallocation_SeqSELL()
146 PetscInt mul = DEVICE_MEM_ALIGN / b->sliceheight; in MatSeqSELLSetPreallocation_SeqSELL()
152 …for (j = 0; j < b->sliceheight; j++) b->sliidx[i] = PetscMax(b->sliidx[i], rlen[b->sliceheight * (… in MatSeqSELLSetPreallocation_SeqSELL()
160 PetscCall(PetscIntSumError(b->sliidx[i - 1], b->sliceheight * b->sliidx[i], &b->sliidx[i])); in MatSeqSELLSetPreallocation_SeqSELL()
164 …for (j = b->sliceheight * (totalslices - 1); j < B->rmap->n; j++) b->sliidx[totalslices] = PetscMa… in MatSeqSELLSetPreallocation_SeqSELL()
172 b->sliidx[totalslices] = b->sliidx[totalslices - 1] + b->sliceheight * b->sliidx[totalslices]; in MatSeqSELLSetPreallocation_SeqSELL()
181 PetscCall(PetscCalloc1(b->sliceheight * totalslices, &b->rlen)); in MatSeqSELLSetPreallocation_SeqSELL()
212 shift = a->sliidx[row / a->sliceheight] + (row % a->sliceheight); in MatGetRow_SeqSELL()
216 for (j = 0; j < a->rlen[row]; j++) a->getrowcols[j] = a->colidx[shift + a->sliceheight * j]; in MatGetRow_SeqSELL()
221 for (j = 0; j < a->rlen[row]; j++) a->getrowvals[j] = a->val[shift + a->sliceheight * j]; in MatGetRow_SeqSELL()
346 PetscInt k, sliceheight = a->sliceheight; in MatMult_SeqSELL() local
358sliceheight == 8, PETSC_COMM_SELF, PETSC_ERR_SUP, "The kernel requires a slice height of 8, but th… in MatMult_SeqSELL()
425sliceheight == 8, PETSC_COMM_SELF, PETSC_ERR_SUP, "The kernel requires a slice height of 8, but th… in MatMult_SeqSELL()
462sliceheight == 8, PETSC_COMM_SELF, PETSC_ERR_SUP, "The kernel requires a slice height of 8, but th… in MatMult_SeqSELL()
513 PetscCall(PetscMalloc1(sliceheight, &sum)); in MatMult_SeqSELL()
515 for (j = 0; j < sliceheight; j++) { in MatMult_SeqSELL()
517 …for (k = a->sliidx[i] + j; k < a->sliidx[i + 1]; k += sliceheight) sum[j] += aval[k] * x[acolidx[k… in MatMult_SeqSELL()
519 if (i == totalslices - 1 && (A->rmap->n % sliceheight)) { /* if last slice has padding rows */ in MatMult_SeqSELL()
520 for (j = 0; j < (A->rmap->n % sliceheight); j++) y[sliceheight * i + j] = sum[j]; in MatMult_SeqSELL()
522 for (j = 0; j < sliceheight; j++) y[sliceheight * i + j] = sum[j]; in MatMult_SeqSELL()
556 PetscInt k, sliceheight = a->sliceheight; in MatMultAdd_SeqSELL() local
572sliceheight == 8, PETSC_COMM_SELF, PETSC_ERR_SUP, "The kernel requires a slice height of 8, but th… in MatMultAdd_SeqSELL()
643sliceheight == 8, PETSC_COMM_SELF, PETSC_ERR_SUP, "The kernel requires a slice height of 8, but th… in MatMultAdd_SeqSELL()
692 PetscCall(PetscMalloc1(sliceheight, &sum)); in MatMultAdd_SeqSELL()
694 for (j = 0; j < sliceheight; j++) { in MatMultAdd_SeqSELL()
696 …for (k = a->sliidx[i] + j; k < a->sliidx[i + 1]; k += sliceheight) sum[j] += aval[k] * x[acolidx[k… in MatMultAdd_SeqSELL()
698 if (i == totalslices - 1 && (A->rmap->n % sliceheight)) { in MatMultAdd_SeqSELL()
699 …for (j = 0; j < (A->rmap->n % sliceheight); j++) z[sliceheight * i + j] = y[sliceheight * i + j] +… in MatMultAdd_SeqSELL()
701 for (j = 0; j < sliceheight; j++) z[sliceheight * i + j] = y[sliceheight * i + j] + sum[j]; in MatMultAdd_SeqSELL()
720 …Int i, j, r, row, nnz_in_row, totalslices = a->totalslices, sliceheight = a->sliceheight; in MatMultTransposeAdd_SeqSELL() local
737 if (i == totalslices - 1 && (A->rmap->n % sliceheight)) { in MatMultTransposeAdd_SeqSELL()
738 for (r = 0; r < (A->rmap->n % sliceheight); ++r) { in MatMultTransposeAdd_SeqSELL()
739 row = sliceheight * i + r; in MatMultTransposeAdd_SeqSELL()
741 …for (j = 0; j < nnz_in_row; ++j) y[acolidx[sliceheight * j + r]] += aval[sliceheight * j + r] * x[… in MatMultTransposeAdd_SeqSELL()
745 for (r = 0; r < sliceheight; ++r) in MatMultTransposeAdd_SeqSELL()
746 …(j = a->sliidx[i] + r; j < a->sliidx[i + 1]; j += sliceheight) y[acolidx[j]] += aval[j] * x[sliceh… in MatMultTransposeAdd_SeqSELL()
788 … shift = a->sliidx[i / a->sliceheight] + i % a->sliceheight; /* starting index of the row i */ in MatGetDiagonalMarkers_SeqSELL()
790 if (a->colidx[shift + a->sliceheight * j] == i) { in MatGetDiagonalMarkers_SeqSELL()
791 a->diag[i] = shift + a->sliceheight * j; in MatGetDiagonalMarkers_SeqSELL()
809 … shift = a->sliidx[i / a->sliceheight] + i % a->sliceheight; /* starting index of the row i */ in MatGetDiagonalMarkers_SeqSELL()
812 if (a->colidx[shift + a->sliceheight * j] == i) { in MatGetDiagonalMarkers_SeqSELL()
813 a->diag[i] = shift + a->sliceheight * j; in MatGetDiagonalMarkers_SeqSELL()
983 shift = a->sliidx[i / a->sliceheight] + i % a->sliceheight; /* starting index of the row i */ in MatGetDiagonal_SeqSELL()
986 if (a->colidx[shift + a->sliceheight * j] == i) { in MatGetDiagonal_SeqSELL()
987 x[i] = a->val[shift + a->sliceheight * j]; in MatGetDiagonal_SeqSELL()
1010 …if (i == a->totalslices - 1 && (A->rmap->n % a->sliceheight)) { /* if last slice has padding rows … in MatDiagonalScale_SeqSELL()
1011 … for (j = a->sliidx[i], row = 0; j < a->sliidx[i + 1]; j++, row = (row + 1) % a->sliceheight) { in MatDiagonalScale_SeqSELL()
1012 if (row < (A->rmap->n % a->sliceheight)) a->val[j] *= l[a->sliceheight * i + row]; in MatDiagonalScale_SeqSELL()
1015 …w = 0; j < a->sliidx[i + 1]; j++, row = (row + 1) % a->sliceheight) a->val[j] *= l[a->sliceheight in MatDiagonalScale_SeqSELL()
1026 …if (i == a->totalslices - 1 && (A->rmap->n % a->sliceheight)) { /* if last slice has padding rows … in MatDiagonalScale_SeqSELL()
1027 … for (j = a->sliidx[i], row = 0; j < a->sliidx[i + 1]; j++, row = ((row + 1) % a->sliceheight)) { in MatDiagonalScale_SeqSELL()
1028 if (row < (A->rmap->n % a->sliceheight)) a->val[j] *= r[a->colidx[j]]; in MatDiagonalScale_SeqSELL()
1055 … shift = a->sliidx[row / a->sliceheight] + (row % a->sliceheight); /* starting index of the row */ in MatGetValues_SeqSELL()
1066 if (*(cp + a->sliceheight * t) > col) high = t; in MatGetValues_SeqSELL()
1070 if (*(cp + a->sliceheight * i) > col) break; in MatGetValues_SeqSELL()
1071 if (*(cp + a->sliceheight * i) == col) { in MatGetValues_SeqSELL()
1072 *v++ = *(vp + a->sliceheight * i); in MatGetValues_SeqSELL()
1108 shift = a->sliidx[i / a->sliceheight] + i % a->sliceheight; in MatView_SeqSELL_ASCII()
1111 …ft + a->sliceheight * j] + 1, (double)PetscRealPart(a->val[shift + a->sliceheight * j]), (double)P… in MatView_SeqSELL_ASCII()
1113 …FMT " %18.16e\n", i + 1, a->colidx[shift + a->sliceheight * j] + 1, (double)a->val[shift + a->sli… in MatView_SeqSELL_ASCII()
1135 shift = a->sliidx[i / a->sliceheight] + i % a->sliceheight; in MatView_SeqSELL_ASCII()
1138 …if (PetscImaginaryPart(a->val[shift + a->sliceheight * j]) > 0.0 && PetscRealPart(a->val[shift + a… in MatView_SeqSELL_ASCII()
1139 …hift + a->sliceheight * j], (double)PetscRealPart(a->val[shift + a->sliceheight * j]), (double)Pet… in MatView_SeqSELL_ASCII()
1140 …if (PetscImaginaryPart(a->val[shift + a->sliceheight * j]) < 0.0 && PetscRealPart(a->val[shift + a… in MatView_SeqSELL_ASCII()
1141 …ift + a->sliceheight * j], (double)PetscRealPart(a->val[shift + a->sliceheight * j]), (double)-Pet… in MatView_SeqSELL_ASCII()
1142 } else if (PetscRealPart(a->val[shift + a->sliceheight * j]) != 0.0) { in MatView_SeqSELL_ASCII()
1143 …tscInt_FMT ", %g) ", a->colidx[shift + a->sliceheight * j], (double)PetscRealPart(a->val[shift + a… in MatView_SeqSELL_ASCII()
1146sliceheight * j] != 0.0) PetscCall(PetscViewerASCIIPrintf(viewer, " (%" PetscInt_FMT ", %g) ", a->… in MatView_SeqSELL_ASCII()
1168 shift = a->sliidx[i / a->sliceheight] + i % a->sliceheight; in MatView_SeqSELL_ASCII()
1170 if (jcnt < a->rlen[i] && j == a->colidx[shift + a->sliceheight * j]) { in MatView_SeqSELL_ASCII()
1199 shift = a->sliidx[i / a->sliceheight] + i % a->sliceheight; in MatView_SeqSELL_ASCII()
1202 …+ a->sliceheight * j] + fshift, (double)PetscRealPart(a->val[shift + a->sliceheight * j]), (double… in MatView_SeqSELL_ASCII()
1204 …T " %g\n", i + fshift, a->colidx[shift + a->sliceheight * j] + fshift, (double)a->val[shift + a->s… in MatView_SeqSELL_ASCII()
1213 for (j = a->sliidx[i], row = 0; j < a->sliidx[i + 1]; j++, row = (row + 1) % a->sliceheight) { in MatView_SeqSELL_ASCII()
1216 …Printf(viewer, " %" PetscInt_FMT " %" PetscInt_FMT " %g + %g i\n", a->sliceheight * i + row, a->c… in MatView_SeqSELL_ASCII()
1218 …Printf(viewer, " %" PetscInt_FMT " %" PetscInt_FMT " %g - %g i\n", a->sliceheight * i + row, a->c… in MatView_SeqSELL_ASCII()
1220 …erASCIIPrintf(viewer, " %" PetscInt_FMT " %" PetscInt_FMT " %g\n", a->sliceheight * i + row, a->c… in MatView_SeqSELL_ASCII()
1223 …erASCIIPrintf(viewer, " %" PetscInt_FMT " %" PetscInt_FMT " %g\n", a->sliceheight * i + row, a->c… in MatView_SeqSELL_ASCII()
1231 shift = a->sliidx[i / a->sliceheight] + i % a->sliceheight; in MatView_SeqSELL_ASCII()
1234 for (j = shift; j < a->diag[i]; j += a->sliceheight) { in MatView_SeqSELL_ASCII()
1236 if (PetscImaginaryPart(a->val[shift + a->sliceheight * j]) > 0.0) { in MatView_SeqSELL_ASCII()
1238 } else if (PetscImaginaryPart(a->val[shift + a->sliceheight * j]) < 0.0) { in MatView_SeqSELL_ASCII()
1262 for (j = a->diag[i] + 1; j < shift + a->sliceheight * a->rlen[i]; j += a->sliceheight) { in MatView_SeqSELL_ASCII()
1279 shift = a->sliidx[i / a->sliceheight] + i % a->sliceheight; in MatView_SeqSELL_ASCII()
1284 …hift + a->sliceheight * j], (double)PetscRealPart(a->val[shift + a->sliceheight * j]), (double)Pet… in MatView_SeqSELL_ASCII()
1286 …ift + a->sliceheight * j], (double)PetscRealPart(a->val[shift + a->sliceheight * j]), (double)-Pet… in MatView_SeqSELL_ASCII()
1288 …tscInt_FMT ", %g) ", a->colidx[shift + a->sliceheight * j], (double)PetscRealPart(a->val[shift + a… in MatView_SeqSELL_ASCII()
1291 … (%" PetscInt_FMT ", %g) ", a->colidx[shift + a->sliceheight * j], (double)a->val[shift + a->slice… in MatView_SeqSELL_ASCII()
1326 shift = a->sliidx[i / a->sliceheight] + i % a->sliceheight; /* starting index of the row i */ in MatView_SeqSELL_Draw_Zoom()
1330 x_l = a->colidx[shift + a->sliceheight * j]; in MatView_SeqSELL_Draw_Zoom()
1332 if (PetscRealPart(a->val[shift + a->sliceheight * j]) >= 0.) continue; in MatView_SeqSELL_Draw_Zoom()
1338 shift = a->sliidx[i / a->sliceheight] + i % a->sliceheight; in MatView_SeqSELL_Draw_Zoom()
1342 x_l = a->colidx[shift + a->sliceheight * j]; in MatView_SeqSELL_Draw_Zoom()
1344 if (a->val[shift + a->sliceheight * j] != 0.) continue; in MatView_SeqSELL_Draw_Zoom()
1350 shift = a->sliidx[i / a->sliceheight] + i % a->sliceheight; in MatView_SeqSELL_Draw_Zoom()
1354 x_l = a->colidx[shift + a->sliceheight * j]; in MatView_SeqSELL_Draw_Zoom()
1356 if (PetscRealPart(a->val[shift + a->sliceheight * j]) <= 0.) continue; in MatView_SeqSELL_Draw_Zoom()
1376 shift = a->sliidx[i / a->sliceheight] + i % a->sliceheight; in MatView_SeqSELL_Draw_Zoom()
1380 x_l = a->colidx[shift + a->sliceheight * j]; in MatView_SeqSELL_Draw_Zoom()
1457 …for (row_in_slice = 0; row_in_slice < a->sliceheight; ++row_in_slice) { /* loop over rows in the s… in MatAssemblyEnd_SeqSELL()
1458 row = a->sliceheight * i + row_in_slice; in MatAssemblyEnd_SeqSELL()
1467 …lastcol = cp[a->sliceheight * (nrow - 1) + row_in_slice]; /* use the index from the last nonzero a… in MatAssemblyEnd_SeqSELL()
1469 for (j = 1; j < a->sliceheight; j++) { in MatAssemblyEnd_SeqSELL()
1470 if (a->rlen[a->sliceheight * i + j]) { in MatAssemblyEnd_SeqSELL()
1479 for (k = nrow; k < (a->sliidx[i + 1] - shift) / a->sliceheight; ++k) { in MatAssemblyEnd_SeqSELL()
1480 cp[a->sliceheight * k + row_in_slice] = lastcol; in MatAssemblyEnd_SeqSELL()
1481 vp[a->sliceheight * k + row_in_slice] = (MatScalar)0; in MatAssemblyEnd_SeqSELL()
1541 PetscInt mul = DEVICE_MEM_ALIGN / a->sliceheight; in MatSetValues_SeqSELL()
1549 shift = a->sliidx[row / a->sliceheight] + row % a->sliceheight; /* starting index of the row */ in MatSetValues_SeqSELL()
1573 if (*(cp + a->sliceheight * t) > col) high = t; in MatSetValues_SeqSELL()
1577 if (*(cp + a->sliceheight * i) > col) break; in MatSetValues_SeqSELL()
1578 if (*(cp + a->sliceheight * i) == col) { in MatSetValues_SeqSELL()
1579 if (is == ADD_VALUES) *(vp + a->sliceheight * i) += value; in MatSetValues_SeqSELL()
1580 else *(vp + a->sliceheight * i) = value; in MatSetValues_SeqSELL()
1592 …eqXSELLReallocateSELL(A, A->rmap->n, 1, nrow, a->sliidx, a->sliceheight, row / a->sliceheight, row… in MatSetValues_SeqSELL()
1595 …eqXSELLReallocateSELL(A, A->rmap->n, 1, nrow, a->sliidx, a->sliceheight, row / a->sliceheight, row… in MatSetValues_SeqSELL()
1599 *(cp + a->sliceheight * (ii + 1)) = *(cp + a->sliceheight * ii); in MatSetValues_SeqSELL()
1600 *(vp + a->sliceheight * (ii + 1)) = *(vp + a->sliceheight * ii); in MatSetValues_SeqSELL()
1603 *(cp + a->sliceheight * i) = col; in MatSetValues_SeqSELL()
1604 *(vp + a->sliceheight * i) = value; in MatSetValues_SeqSELL()
1715 … shift = a->sliidx[i / a->sliceheight] + i % a->sliceheight; /* starting index of the row i */ in MatSOR_SeqSELL()
1717 n = (diag[i] - shift) / a->sliceheight; in MatSOR_SeqSELL()
1718 …for (j = 0; j < n; j++) sum -= a->val[shift + a->sliceheight * j] * x[a->colidx[shift + a->slicehe… in MatSOR_SeqSELL()
1727 … shift = a->sliidx[i / a->sliceheight] + i % a->sliceheight; /* starting index of the row i */ in MatSOR_SeqSELL()
1729 n = a->rlen[i] - (diag[i] - shift) / a->sliceheight - 1; in MatSOR_SeqSELL()
1730 … (j = 1; j <= n; j++) sum -= a->val[diag[i] + a->sliceheight * j] * x[a->colidx[diag[i] + a->slice… in MatSOR_SeqSELL()
1745 … shift = a->sliidx[i / a->sliceheight] + i % a->sliceheight; /* starting index of the row i */ in MatSOR_SeqSELL()
1747 n = (diag[i] - shift) / a->sliceheight; in MatSOR_SeqSELL()
1748 …for (j = 0; j < n; j++) sum -= a->val[shift + a->sliceheight * j] * x[a->colidx[shift + a->slicehe… in MatSOR_SeqSELL()
1751 n = a->rlen[i] - (diag[i] - shift) / a->sliceheight - 1; in MatSOR_SeqSELL()
1752 … (j = 1; j <= n; j++) sum -= a->val[diag[i] + a->sliceheight * j] * x[a->colidx[diag[i] + a->slice… in MatSOR_SeqSELL()
1760 … shift = a->sliidx[i / a->sliceheight] + i % a->sliceheight; /* starting index of the row i */ in MatSOR_SeqSELL()
1765 …for (j = 0; j < n; j++) sum -= a->val[shift + a->sliceheight * j] * x[a->colidx[shift + a->slicehe… in MatSOR_SeqSELL()
1768 n = a->rlen[i] - (diag[i] - shift) / a->sliceheight - 1; in MatSOR_SeqSELL()
1769 … (j = 1; j <= n; j++) sum -= a->val[diag[i] + a->sliceheight * j] * x[a->colidx[diag[i] + a->slice… in MatSOR_SeqSELL()
1977 current_slicewidth = (a->sliidx[i + 1] - a->sliidx[i]) / a->sliceheight; in MatSeqSELLGetMaxSliceWidth_SeqSELL()
1989 …if (a->totalslices) *slicewidth = (PetscReal)a->sliidx[a->totalslices] / a->sliceheight / a->total… in MatSeqSELLGetAvgSliceWidth_SeqSELL()
2008 static PetscErrorCode MatSeqSELLSetSliceHeight_SeqSELL(Mat A, PetscInt sliceheight) in MatSeqSELLSetSliceHeight_SeqSELL() argument
2014sliceheight <= 0 || a->sliceheight == sliceheight, PETSC_COMM_SELF, PETSC_ERR_SUP, "Cannot change … in MatSeqSELLSetSliceHeight_SeqSELL()
2015 a->sliceheight = sliceheight; in MatSeqSELLSetSliceHeight_SeqSELL()
2017sliceheight) % PetscMin(DEVICE_MEM_ALIGN, sliceheight) == 0, PETSC_COMM_SELF, PETSC_ERR_SUP, "The … in MatSeqSELLSetSliceHeight_SeqSELL()
2106 PetscErrorCode MatSeqSELLSetSliceHeight(Mat A, PetscInt sliceheight) in MatSeqSELLSetSliceHeight() argument
2109 PetscUseMethod(A, "MatSeqSELLSetSliceHeight_C", (Mat, PetscInt), (A, sliceheight)); in MatSeqSELLSetSliceHeight()
2174 b->sliceheight = 0; in MatCreate_SeqSELL()
2237 c->sliceheight = a->sliceheight; in MatDuplicateNoCreate_SeqSELL()
2238 PetscCall(PetscMalloc1(c->sliceheight * totalslices, &c->rlen)); in MatDuplicateNoCreate_SeqSELL()