Lines Matching refs:a
200 Mat_H2OPUS *a = (Mat_H2OPUS *)A->data; in MatDestroy_H2OPUS() local
204 h2opusDestroyDistributedHandle(a->handle); in MatDestroy_H2OPUS()
206 h2opusDestroyHandle(a->handle); in MatDestroy_H2OPUS()
208 delete a->dist_hmatrix; in MatDestroy_H2OPUS()
209 delete a->hmatrix; in MatDestroy_H2OPUS()
210 PetscCall(PetscSFDestroy(&a->sf)); in MatDestroy_H2OPUS()
211 PetscCall(PetscLayoutDestroy(&a->h2opus_rmap)); in MatDestroy_H2OPUS()
212 PetscCall(PetscLayoutDestroy(&a->h2opus_cmap)); in MatDestroy_H2OPUS()
213 PetscCall(ISDestroy(&a->h2opus_indexmap)); in MatDestroy_H2OPUS()
214 delete a->xx; in MatDestroy_H2OPUS()
215 delete a->yy; in MatDestroy_H2OPUS()
216 delete a->hmatrix_gpu; in MatDestroy_H2OPUS()
217 delete a->dist_hmatrix_gpu; in MatDestroy_H2OPUS()
219 delete a->xx_gpu; in MatDestroy_H2OPUS()
220 delete a->yy_gpu; in MatDestroy_H2OPUS()
222 delete a->sampler; in MatDestroy_H2OPUS()
223 delete a->ptcloud; in MatDestroy_H2OPUS()
224 delete a->kernel; in MatDestroy_H2OPUS()
236 Mat_H2OPUS *a = (Mat_H2OPUS *)A->data; in MatH2OpusSetNativeMult() local
244 if (a->h2opus_rmap) { /* need to swap layouts for vector creation */ in MatH2OpusSetNativeMult()
245 if ((!a->nativemult && nm) || (a->nativemult && !nm)) { in MatH2OpusSetNativeMult()
248 A->rmap = a->h2opus_rmap; in MatH2OpusSetNativeMult()
249 a->h2opus_rmap = t; in MatH2OpusSetNativeMult()
251 A->cmap = a->h2opus_cmap; in MatH2OpusSetNativeMult()
252 a->h2opus_cmap = t; in MatH2OpusSetNativeMult()
255 a->nativemult = nm; in MatH2OpusSetNativeMult()
262 Mat_H2OPUS *a = (Mat_H2OPUS *)A->data; in MatH2OpusGetNativeMult() local
270 *nm = a->nativemult; in MatH2OpusGetNativeMult()
278 Mat_H2OPUS *a = NULL; in MatNorm_H2OPUS() local
284 a = (Mat_H2OPUS *)A->data; in MatNorm_H2OPUS()
286 nmax = a->norm_max_samples; in MatNorm_H2OPUS()
287 mult = a->nativemult; in MatNorm_H2OPUS()
293 if (a) PetscCall(MatH2OpusSetNativeMult(A, mult)); in MatNorm_H2OPUS()
693 Mat_H2OPUS *a = (Mat_H2OPUS *)A->data; in MatScale_H2OPUS() local
696 a->s *= s; in MatScale_H2OPUS()
702 Mat_H2OPUS *a = (Mat_H2OPUS *)A->data; in MatSetFromOptions_H2OPUS() local
706 …ptionsInt("-mat_h2opus_leafsize", "Leaf size of cluster tree", NULL, a->leafsize, &a->leafsize, NU… in MatSetFromOptions_H2OPUS()
707 …cOptionsReal("-mat_h2opus_eta", "Admissibility condition tolerance", NULL, a->eta, &a->eta, NULL)); in MatSetFromOptions_H2OPUS()
708 …order for off-diagonal sampling when constructed from kernel", NULL, a->basisord, &a->basisord, NU… in MatSetFromOptions_H2OPUS()
709 …h2opus_maxrank", "Maximum rank when constructed from matvecs", NULL, a->max_rank, &a->max_rank, NU… in MatSetFromOptions_H2OPUS()
710 …r of samples to be taken concurrently when constructing from matvecs", NULL, a->bs, &a->bs, NULL)); in MatSetFromOptions_H2OPUS()
711 …, "Maximum number of samples to be when estimating norms", NULL, a->norm_max_samples, &a->norm_max… in MatSetFromOptions_H2OPUS()
712 …h2opus_rtol", "Relative tolerance for construction from sampling", NULL, a->rtol, &a->rtol, NULL)); in MatSetFromOptions_H2OPUS()
713 …when constructing from sampling during MatAssemblyEnd()", NULL, a->check_construction, &a->check_c… in MatSetFromOptions_H2OPUS()
714 …opus_hara_verbose", "Verbose output from hara construction", NULL, a->hara_verbose, &a->hara_verbo… in MatSetFromOptions_H2OPUS()
715 …PetscCall(PetscOptionsBool("-mat_h2opus_resize", "Resize after compression", NULL, a->resize, &a->… in MatSetFromOptions_H2OPUS()
724 Mat_H2OPUS *a = (Mat_H2OPUS *)A->data; in MatH2OpusInferCoordinates_Private() local
730 if (a->ptcloud) PetscFunctionReturn(PETSC_SUCCESS); in MatH2OpusInferCoordinates_Private()
732 if (!c && a->sampler) { in MatH2OpusInferCoordinates_Private()
733 Mat S = a->sampler->GetSamplingMat(); in MatH2OpusInferCoordinates_Private()
752 Mat_H2OPUS *a = (Mat_H2OPUS *)A->data; in MatSetUpMultiply_H2OPUS() local
759 if (a->multsetup) PetscFunctionReturn(PETSC_SUCCESS); in MatSetUpMultiply_H2OPUS()
760 if (a->sf) { /* MatDuplicate_H2OPUS takes reference to the SF */ in MatSetUpMultiply_H2OPUS()
761 PetscCall(PetscSFGetGraph(a->sf, NULL, &n, NULL, NULL)); in MatSetUpMultiply_H2OPUS()
763 a->xx_gpu = new thrust::device_vector<PetscScalar>(n); in MatSetUpMultiply_H2OPUS()
764 a->yy_gpu = new thrust::device_vector<PetscScalar>(n); in MatSetUpMultiply_H2OPUS()
765 a->xxs_gpu = 1; in MatSetUpMultiply_H2OPUS()
766 a->yys_gpu = 1; in MatSetUpMultiply_H2OPUS()
768 a->xx = new thrust::host_vector<PetscScalar>(n); in MatSetUpMultiply_H2OPUS()
769 a->yy = new thrust::host_vector<PetscScalar>(n); in MatSetUpMultiply_H2OPUS()
770 a->xxs = 1; in MatSetUpMultiply_H2OPUS()
771 a->yys = 1; in MatSetUpMultiply_H2OPUS()
776 if (!a->h2opus_indexmap) { in MatSetUpMultiply_H2OPUS()
778 …PetscCheck(a->dist_hmatrix, PetscObjectComm((PetscObject)A), PETSC_ERR_PLIB, "Missing distributed … in MatSetUpMultiply_H2OPUS()
780 iidx = MatH2OpusGetThrustPointer(a->dist_hmatrix->basis_tree.basis_branch.index_map); in MatSetUpMultiply_H2OPUS()
781 n = a->dist_hmatrix->basis_tree.basis_branch.index_map.size(); in MatSetUpMultiply_H2OPUS()
784 iidx = MatH2OpusGetThrustPointer(a->hmatrix->u_basis_tree.index_map); in MatSetUpMultiply_H2OPUS()
785 n = a->hmatrix->u_basis_tree.index_map.size(); in MatSetUpMultiply_H2OPUS()
801 a->h2opus_indexmap = is; in MatSetUpMultiply_H2OPUS()
803 PetscCall(ISGetLocalSize(a->h2opus_indexmap, &n)); in MatSetUpMultiply_H2OPUS()
804 PetscCall(ISGetIndices(a->h2opus_indexmap, (const PetscInt **)&idx)); in MatSetUpMultiply_H2OPUS()
807 if (rid) PetscCall(ISIdentity(a->h2opus_indexmap, &rid)); in MatSetUpMultiply_H2OPUS()
810 PetscCall(PetscLayoutCreate(comm, &a->h2opus_rmap)); in MatSetUpMultiply_H2OPUS()
811 PetscCall(PetscLayoutSetLocalSize(a->h2opus_rmap, n)); in MatSetUpMultiply_H2OPUS()
812 PetscCall(PetscLayoutSetUp(a->h2opus_rmap)); in MatSetUpMultiply_H2OPUS()
813 PetscCall(PetscLayoutReference(a->h2opus_rmap, &a->h2opus_cmap)); in MatSetUpMultiply_H2OPUS()
815 PetscCall(PetscSFCreate(comm, &a->sf)); in MatSetUpMultiply_H2OPUS()
816 PetscCall(PetscSFSetGraphLayout(a->sf, A->rmap, n, NULL, PETSC_OWN_POINTER, idx)); in MatSetUpMultiply_H2OPUS()
817 PetscCall(PetscSFSetUp(a->sf)); in MatSetUpMultiply_H2OPUS()
818 PetscCall(PetscSFViewFromOptions(a->sf, (PetscObject)A, "-mat_h2opus_sf_view")); in MatSetUpMultiply_H2OPUS()
820 a->xx_gpu = new thrust::device_vector<PetscScalar>(n); in MatSetUpMultiply_H2OPUS()
821 a->yy_gpu = new thrust::device_vector<PetscScalar>(n); in MatSetUpMultiply_H2OPUS()
822 a->xxs_gpu = 1; in MatSetUpMultiply_H2OPUS()
823 a->yys_gpu = 1; in MatSetUpMultiply_H2OPUS()
825 a->xx = new thrust::host_vector<PetscScalar>(n); in MatSetUpMultiply_H2OPUS()
826 a->yy = new thrust::host_vector<PetscScalar>(n); in MatSetUpMultiply_H2OPUS()
827 a->xxs = 1; in MatSetUpMultiply_H2OPUS()
828 a->yys = 1; in MatSetUpMultiply_H2OPUS()
830 PetscCall(ISRestoreIndices(a->h2opus_indexmap, (const PetscInt **)&idx)); in MatSetUpMultiply_H2OPUS()
832 a->multsetup = PETSC_TRUE; in MatSetUpMultiply_H2OPUS()
838 Mat_H2OPUS *a = (Mat_H2OPUS *)A->data; in MatAssemblyEnd_H2OPUS() local
840 h2opusHandle_t handle = a->handle->handle; in MatAssemblyEnd_H2OPUS()
842 h2opusHandle_t handle = a->handle; in MatAssemblyEnd_H2OPUS()
856 a->leafsize = PetscMin(a->leafsize, PetscMin(A->rmap->N, A->cmap->N)); in MatAssemblyEnd_H2OPUS()
860 delete a->hmatrix; in MatAssemblyEnd_H2OPUS()
861 delete a->dist_hmatrix; in MatAssemblyEnd_H2OPUS()
863 delete a->hmatrix_gpu; in MatAssemblyEnd_H2OPUS()
864 delete a->dist_hmatrix_gpu; in MatAssemblyEnd_H2OPUS()
866 a->orthogonal = PETSC_FALSE; in MatAssemblyEnd_H2OPUS()
869 H2OpusBoxCenterAdmissibility adm(a->eta); in MatAssemblyEnd_H2OPUS()
874 a->dist_hmatrix = new DistributedHMatrix(A->rmap->n /* ,A->symmetric */); in MatAssemblyEnd_H2OPUS()
876 a->dist_hmatrix = NULL; in MatAssemblyEnd_H2OPUS()
878 } else a->hmatrix = new HMatrix(A->rmap->n, A->symmetric == PETSC_BOOL3_TRUE); in MatAssemblyEnd_H2OPUS()
880 PetscCheck(a->ptcloud, PETSC_COMM_SELF, PETSC_ERR_PLIB, "Missing pointcloud"); in MatAssemblyEnd_H2OPUS()
881 if (a->kernel) { in MatAssemblyEnd_H2OPUS()
882 …BoxEntryGen<PetscScalar, H2OPUS_HWTYPE_CPU, PetscFunctionGenerator<PetscScalar>> entry_gen(*a->ker… in MatAssemblyEnd_H2OPUS()
884 …PetscCheck(a->dist_hmatrix, PetscObjectComm((PetscObject)A), PETSC_ERR_PLIB, "Missing distributed … in MatAssemblyEnd_H2OPUS()
886 …buildDistributedHMatrix(*a->dist_hmatrix, a->ptcloud, adm, entry_gen, a->leafsize, a->basisord, a-… in MatAssemblyEnd_H2OPUS()
889 buildHMatrix(*a->hmatrix, a->ptcloud, adm, entry_gen, a->leafsize, a->basisord); in MatAssemblyEnd_H2OPUS()
894 buildHMatrixStructure(*a->hmatrix, a->ptcloud, a->leafsize, adm); in MatAssemblyEnd_H2OPUS()
902 …PetscCheck(a->dist_hmatrix, PetscObjectComm((PetscObject)A), PETSC_ERR_PLIB, "Missing distributed … in MatAssemblyEnd_H2OPUS()
904 a->dist_hmatrix_gpu = new DistributedHMatrix_GPU(*a->dist_hmatrix); in MatAssemblyEnd_H2OPUS()
907 a->hmatrix_gpu = new HMatrix_GPU(*a->hmatrix); in MatAssemblyEnd_H2OPUS()
912 if (!kernel && a->sampler && a->sampler->GetSamplingMat()) { in MatAssemblyEnd_H2OPUS()
916 …cObject)A)->options, ((PetscObject)A)->prefix, "-mat_h2opus_hara_verbose", &a->hara_verbose, NULL)… in MatAssemblyEnd_H2OPUS()
917 verbose = a->hara_verbose; in MatAssemblyEnd_H2OPUS()
918 …PetscCall(MatApproximateNorm_Private(a->sampler->GetSamplingMat(), NORM_2, a->norm_max_samples, &A… in MatAssemblyEnd_H2OPUS()
919 …a->hara_verbose) PetscCall(PetscPrintf(PETSC_COMM_SELF, "Sampling uses max rank %d, tol %g (%g*%g)… in MatAssemblyEnd_H2OPUS()
920 …if (a->sf && !a->nativemult) a->sampler->SetIndexMap(a->hmatrix->u_basis_tree.index_map.size(), a-… in MatAssemblyEnd_H2OPUS()
921 a->sampler->SetStream(handle->getMainStream()); in MatAssemblyEnd_H2OPUS()
923 a->sampler->SetGPUSampling(false); in MatAssemblyEnd_H2OPUS()
924 …hara(a->sampler, *a->hmatrix, a->max_rank, 10 /* TODO */, a->rtol * Anorm, a->bs, handle, verbose); in MatAssemblyEnd_H2OPUS()
927 a->sampler->SetGPUSampling(true); in MatAssemblyEnd_H2OPUS()
928 …hara(a->sampler, *a->hmatrix_gpu, a->max_rank, 10 /* TODO */, a->rtol * Anorm, a->bs, handle, verb… in MatAssemblyEnd_H2OPUS()
936 delete a->hmatrix; in MatAssemblyEnd_H2OPUS()
937 delete a->dist_hmatrix; in MatAssemblyEnd_H2OPUS()
938 a->hmatrix = NULL; in MatAssemblyEnd_H2OPUS()
939 a->dist_hmatrix = NULL; in MatAssemblyEnd_H2OPUS()
945 if (!a->s) a->s = 1.0; in MatAssemblyEnd_H2OPUS()
949 PetscBool check = a->check_construction; in MatAssemblyEnd_H2OPUS()
960 Ae = a->sampler->GetSamplingMat(); in MatAssemblyEnd_H2OPUS()
999 a->sampler->SetSamplingMat(NULL); in MatAssemblyEnd_H2OPUS()
1007 Mat_H2OPUS *a = (Mat_H2OPUS *)A->data; in MatZeroEntries_H2OPUS() local
1012 a->hmatrix->clearData(); in MatZeroEntries_H2OPUS()
1014 if (a->hmatrix_gpu) a->hmatrix_gpu->clearData(); in MatZeroEntries_H2OPUS()
1022 Mat_H2OPUS *a, *b = (Mat_H2OPUS *)B->data; in MatDuplicate_H2OPUS() local
1032 a = (Mat_H2OPUS *)A->data; in MatDuplicate_H2OPUS()
1034 a->eta = b->eta; in MatDuplicate_H2OPUS()
1035 a->leafsize = b->leafsize; in MatDuplicate_H2OPUS()
1036 a->basisord = b->basisord; in MatDuplicate_H2OPUS()
1037 a->max_rank = b->max_rank; in MatDuplicate_H2OPUS()
1038 a->bs = b->bs; in MatDuplicate_H2OPUS()
1039 a->rtol = b->rtol; in MatDuplicate_H2OPUS()
1040 a->norm_max_samples = b->norm_max_samples; in MatDuplicate_H2OPUS()
1041 if (op == MAT_COPY_VALUES) a->s = b->s; in MatDuplicate_H2OPUS()
1043 a->ptcloud = new PetscPointCloud<PetscReal>(*b->ptcloud); in MatDuplicate_H2OPUS()
1044 …if (op == MAT_COPY_VALUES && b->kernel) a->kernel = new PetscFunctionGenerator<PetscScalar>(*b->ke… in MatDuplicate_H2OPUS()
1047 if (b->dist_hmatrix) a->dist_hmatrix = new DistributedHMatrix(*b->dist_hmatrix); in MatDuplicate_H2OPUS()
1049 if (b->dist_hmatrix_gpu) a->dist_hmatrix_gpu = new DistributedHMatrix_GPU(*b->dist_hmatrix_gpu); in MatDuplicate_H2OPUS()
1053 a->hmatrix = new HMatrix(*b->hmatrix); in MatDuplicate_H2OPUS()
1054 if (op == MAT_DO_NOT_COPY_VALUES) a->hmatrix->clearData(); in MatDuplicate_H2OPUS()
1058 a->hmatrix_gpu = new HMatrix_GPU(*b->hmatrix_gpu); in MatDuplicate_H2OPUS()
1059 if (op == MAT_DO_NOT_COPY_VALUES) a->hmatrix_gpu->clearData(); in MatDuplicate_H2OPUS()
1064 a->sf = b->sf; in MatDuplicate_H2OPUS()
1068 a->h2opus_indexmap = b->h2opus_indexmap; in MatDuplicate_H2OPUS()
1075 a->orthogonal = b->orthogonal; in MatDuplicate_H2OPUS()
1212 Mat_H2OPUS *a = (Mat_H2OPUS *)A->data; in MatBindToCPU_H2OPUS() local
1218 …PetscCheck(a->dist_hmatrix_gpu, PetscObjectComm((PetscObject)A), PETSC_ERR_PLIB, "Missing GPU matr… in MatBindToCPU_H2OPUS()
1220 if (!a->dist_hmatrix) a->dist_hmatrix = new DistributedHMatrix(*a->dist_hmatrix_gpu); in MatBindToCPU_H2OPUS()
1221 else *a->dist_hmatrix = *a->dist_hmatrix_gpu; in MatBindToCPU_H2OPUS()
1224 … PetscCheck(a->hmatrix_gpu, PetscObjectComm((PetscObject)A), PETSC_ERR_PLIB, "Missing GPU matrix"); in MatBindToCPU_H2OPUS()
1225 if (!a->hmatrix) a->hmatrix = new HMatrix(*a->hmatrix_gpu); in MatBindToCPU_H2OPUS()
1226 else *a->hmatrix = *a->hmatrix_gpu; in MatBindToCPU_H2OPUS()
1228 delete a->hmatrix_gpu; in MatBindToCPU_H2OPUS()
1229 delete a->dist_hmatrix_gpu; in MatBindToCPU_H2OPUS()
1230 a->hmatrix_gpu = NULL; in MatBindToCPU_H2OPUS()
1231 a->dist_hmatrix_gpu = NULL; in MatBindToCPU_H2OPUS()
1235 …PetscCheck(a->dist_hmatrix, PetscObjectComm((PetscObject)A), PETSC_ERR_PLIB, "Missing CPU matrix"); in MatBindToCPU_H2OPUS()
1237 if (!a->dist_hmatrix_gpu) a->dist_hmatrix_gpu = new DistributedHMatrix_GPU(*a->dist_hmatrix); in MatBindToCPU_H2OPUS()
1238 else *a->dist_hmatrix_gpu = *a->dist_hmatrix; in MatBindToCPU_H2OPUS()
1241 PetscCheck(a->hmatrix, PetscObjectComm((PetscObject)A), PETSC_ERR_PLIB, "Missing CPU matrix"); in MatBindToCPU_H2OPUS()
1242 if (!a->hmatrix_gpu) a->hmatrix_gpu = new HMatrix_GPU(*a->hmatrix); in MatBindToCPU_H2OPUS()
1243 else *a->hmatrix_gpu = *a->hmatrix; in MatBindToCPU_H2OPUS()
1245 delete a->hmatrix; in MatBindToCPU_H2OPUS()
1246 delete a->dist_hmatrix; in MatBindToCPU_H2OPUS()
1247 a->hmatrix = NULL; in MatBindToCPU_H2OPUS()
1248 a->dist_hmatrix = NULL; in MatBindToCPU_H2OPUS()
1280 Mat_H2OPUS *a; in MatCreate_H2OPUS() local
1287 PetscCall(PetscNew(&a)); in MatCreate_H2OPUS()
1288 A->data = (void *)a; in MatCreate_H2OPUS()
1290 a->eta = 0.9; in MatCreate_H2OPUS()
1291 a->leafsize = 32; in MatCreate_H2OPUS()
1292 a->basisord = 4; in MatCreate_H2OPUS()
1293 a->max_rank = 64; in MatCreate_H2OPUS()
1294 a->bs = 32; in MatCreate_H2OPUS()
1295 a->rtol = 1.e-4; in MatCreate_H2OPUS()
1296 a->s = 1.0; in MatCreate_H2OPUS()
1297 a->norm_max_samples = 10; in MatCreate_H2OPUS()
1298 a->resize = PETSC_TRUE; /* reallocate after compression */ in MatCreate_H2OPUS()
1300 h2opusCreateDistributedHandleComm(&a->handle, PetscObjectComm((PetscObject)A)); in MatCreate_H2OPUS()
1302 h2opusCreateHandle(&a->handle); in MatCreate_H2OPUS()
1348 Mat_H2OPUS *a = (Mat_H2OPUS *)A->data; in MatH2OpusOrthogonalize() local
1357 if (a->orthogonal) PetscFunctionReturn(PETSC_SUCCESS); in MatH2OpusOrthogonalize()
1366 …PetscCheck(a->dist_hmatrix, PetscObjectComm((PetscObject)A), PETSC_ERR_PLIB, "Missing CPU matrix"); in MatH2OpusOrthogonalize()
1368 distributed_horthog(*a->dist_hmatrix, a->handle); in MatH2OpusOrthogonalize()
1373 …PetscCheck(a->dist_hmatrix_gpu, PetscObjectComm((PetscObject)A), PETSC_ERR_PLIB, "Missing GPU matr… in MatH2OpusOrthogonalize()
1376 distributed_horthog(*a->dist_hmatrix_gpu, a->handle); in MatH2OpusOrthogonalize()
1383 h2opusHandle_t handle = a->handle->handle; in MatH2OpusOrthogonalize()
1385 h2opusHandle_t handle = a->handle; in MatH2OpusOrthogonalize()
1388 PetscCheck(a->hmatrix, PetscObjectComm((PetscObject)A), PETSC_ERR_PLIB, "Missing CPU matrix"); in MatH2OpusOrthogonalize()
1389 horthog(*a->hmatrix, handle); in MatH2OpusOrthogonalize()
1393 … PetscCheck(a->hmatrix_gpu, PetscObjectComm((PetscObject)A), PETSC_ERR_PLIB, "Missing GPU matrix"); in MatH2OpusOrthogonalize()
1395 horthog(*a->hmatrix_gpu, handle); in MatH2OpusOrthogonalize()
1400 a->orthogonal = PETSC_TRUE; in MatH2OpusOrthogonalize()
1432 Mat_H2OPUS *a = (Mat_H2OPUS *)A->data; in MatH2OpusCompress() local
1451 …PetscCheck(a->dist_hmatrix, PetscObjectComm((PetscObject)A), PETSC_ERR_PLIB, "Missing CPU matrix"); in MatH2OpusCompress()
1453 distributed_hcompress(*a->dist_hmatrix, tol, a->handle); in MatH2OpusCompress()
1454 if (a->resize) { in MatH2OpusCompress()
1455 DistributedHMatrix *dist_hmatrix = new DistributedHMatrix(*a->dist_hmatrix); in MatH2OpusCompress()
1456 delete a->dist_hmatrix; in MatH2OpusCompress()
1457 a->dist_hmatrix = dist_hmatrix; in MatH2OpusCompress()
1463 …PetscCheck(a->dist_hmatrix_gpu, PetscObjectComm((PetscObject)A), PETSC_ERR_PLIB, "Missing GPU matr… in MatH2OpusCompress()
1466 distributed_hcompress(*a->dist_hmatrix_gpu, tol, a->handle); in MatH2OpusCompress()
1468 if (a->resize) { in MatH2OpusCompress()
1469 DistributedHMatrix_GPU *dist_hmatrix_gpu = new DistributedHMatrix_GPU(*a->dist_hmatrix_gpu); in MatH2OpusCompress()
1470 delete a->dist_hmatrix_gpu; in MatH2OpusCompress()
1471 a->dist_hmatrix_gpu = dist_hmatrix_gpu; in MatH2OpusCompress()
1479 h2opusHandle_t handle = a->handle->handle; in MatH2OpusCompress()
1481 h2opusHandle_t handle = a->handle; in MatH2OpusCompress()
1484 PetscCheck(a->hmatrix, PetscObjectComm((PetscObject)A), PETSC_ERR_PLIB, "Missing CPU matrix"); in MatH2OpusCompress()
1485 hcompress(*a->hmatrix, tol, handle); in MatH2OpusCompress()
1487 if (a->resize) { in MatH2OpusCompress()
1488 HMatrix *hmatrix = new HMatrix(*a->hmatrix); in MatH2OpusCompress()
1489 delete a->hmatrix; in MatH2OpusCompress()
1490 a->hmatrix = hmatrix; in MatH2OpusCompress()
1495 … PetscCheck(a->hmatrix_gpu, PetscObjectComm((PetscObject)A), PETSC_ERR_PLIB, "Missing GPU matrix"); in MatH2OpusCompress()
1497 hcompress(*a->hmatrix_gpu, tol, handle); in MatH2OpusCompress()
1500 if (a->resize) { in MatH2OpusCompress()
1501 HMatrix_GPU *hmatrix_gpu = new HMatrix_GPU(*a->hmatrix_gpu); in MatH2OpusCompress()
1502 delete a->hmatrix_gpu; in MatH2OpusCompress()
1503 a->hmatrix_gpu = hmatrix_gpu; in MatH2OpusCompress()
1553 Mat_H2OPUS *a = (Mat_H2OPUS *)A->data; in MatH2OpusSetSamplingMat() local
1555 if (!a->sampler) a->sampler = new PetscMatrixSampler(); in MatH2OpusSetSamplingMat()
1556 a->sampler->SetSamplingMat(B); in MatH2OpusSetSamplingMat()
1557 if (bs > 0) a->bs = bs; in MatH2OpusSetSamplingMat()
1558 if (tol > 0.) a->rtol = tol; in MatH2OpusSetSamplingMat()
1559 delete a->kernel; in MatH2OpusSetSamplingMat()
1723 Mat_H2OPUS *a = (Mat_H2OPUS *)A->data; in MatH2OpusGetIndexMap() local
1732 *indexmap = a->h2opus_indexmap; in MatH2OpusGetIndexMap()
1754 Mat_H2OPUS *a = (Mat_H2OPUS *)A->data; in MatH2OpusMapVec() local
1767 nm = a->nativemult; in MatH2OpusMapVec()
1771 if (!a->sf) { /* same ordering */ in MatH2OpusMapVec()
1778 PetscCall(PetscSFReduceBegin(a->sf, MPIU_SCALAR, xin, xout, MPI_REPLACE)); in MatH2OpusMapVec()
1779 PetscCall(PetscSFReduceEnd(a->sf, MPIU_SCALAR, xin, xout, MPI_REPLACE)); in MatH2OpusMapVec()
1781 PetscCall(PetscSFBcastBegin(a->sf, MPIU_SCALAR, xin, xout, MPI_REPLACE)); in MatH2OpusMapVec()
1782 PetscCall(PetscSFBcastEnd(a->sf, MPIU_SCALAR, xin, xout, MPI_REPLACE)); in MatH2OpusMapVec()
1830 Mat_H2OPUS *a = (Mat_H2OPUS *)A->data; in MatH2OpusLowRankUpdate() local
1835 h2opusHandle_t handle = a->handle->handle; in MatH2OpusLowRankUpdate()
1837 h2opusHandle_t handle = a->handle; in MatH2OpusLowRankUpdate()
1839 PetscBool usesf = (PetscBool)(a->sf && !a->nativemult); in MatH2OpusLowRankUpdate()
1855 PetscCall(MatDenseGetH2OpusStridedSF(U, a->sf, &usf)); in MatH2OpusLowRankUpdate()
1856 PetscCall(MatDenseGetH2OpusStridedSF(V, a->sf, &vsf)); in MatH2OpusLowRankUpdate()
1858 PetscCall(PetscSFGetGraph(a->sf, NULL, &n, NULL, NULL)); in MatH2OpusLowRankUpdate()
1863 PetscCheck(a->hmatrix, PetscObjectComm((PetscObject)A), PETSC_ERR_PLIB, "Missing CPU matrix"); in MatH2OpusLowRankUpdate()
1867 vv = MatH2OpusGetThrustPointer(*a->yy); in MatH2OpusLowRankUpdate()
1871 uu = MatH2OpusGetThrustPointer(*a->xx); in MatH2OpusLowRankUpdate()
1879 hlru_global(*a->hmatrix, uu, ldu, vv, ldv, U->cmap->N, s, handle); in MatH2OpusLowRankUpdate()
1886 … PetscCheck(a->hmatrix_gpu, PetscObjectComm((PetscObject)A), PETSC_ERR_PLIB, "Missing GPU matrix"); in MatH2OpusLowRankUpdate()
1894 vv = MatH2OpusGetThrustPointer(*a->yy_gpu); in MatH2OpusLowRankUpdate()
1898 uu = MatH2OpusGetThrustPointer(*a->xx_gpu); in MatH2OpusLowRankUpdate()
1909 hlru_global(*a->hmatrix_gpu, uu, ldu, vv, ldv, U->cmap->N, s, handle); in MatH2OpusLowRankUpdate()
1918 a->orthogonal = PETSC_FALSE; in MatH2OpusLowRankUpdate()