Home
last modified time | relevance | path

Searched refs:mtype (Results 1 – 25 of 91) sorted by relevance

1234

/petsc/src/sys/objects/
H A Dptype.c24 PetscErrorCode PetscDataTypeToMPIDataType(PetscDataType ptype, MPI_Datatype *mtype) in PetscDataTypeToMPIDataType() argument
27 if (ptype == PETSC_INT) *mtype = MPIU_INT; in PetscDataTypeToMPIDataType()
28 else if (ptype == PETSC_DOUBLE) *mtype = MPI_DOUBLE; in PetscDataTypeToMPIDataType()
31 else if (ptype == PETSC_COMPLEX) *mtype = MPI_C_COMPLEX; in PetscDataTypeToMPIDataType()
33 else if (ptype == PETSC_COMPLEX) *mtype = MPIU___COMPLEX128; in PetscDataTypeToMPIDataType()
35 else if (ptype == PETSC_COMPLEX) *mtype = MPI_C_DOUBLE_COMPLEX; in PetscDataTypeToMPIDataType()
38 else if (ptype == PETSC_LONG) *mtype = MPI_LONG; in PetscDataTypeToMPIDataType()
39 else if (ptype == PETSC_SHORT) *mtype = MPI_SHORT; in PetscDataTypeToMPIDataType()
40 else if (ptype == PETSC_ENUM) *mtype = MPI_INT; in PetscDataTypeToMPIDataType()
41 else if (ptype == PETSC_BOOL) *mtype = MPI_INT; in PetscDataTypeToMPIDataType()
[all …]
/petsc/src/sys/objects/device/util/
H A Dmemory.c38 enum cudaMemoryType mtype; in PetscGetMemType() local
42 mtype = attr.memoryType; in PetscGetMemType()
44 mtype = attr.type; in PetscGetMemType()
46 if (cerr == cudaSuccess && mtype == cudaMemoryTypeDevice) *type = PETSC_MEMTYPE_DEVICE; in PetscGetMemType()
55 enum hipMemoryType mtype; in PetscGetMemType() local
59 mtype = attr.type; in PetscGetMemType()
61 mtype = attr.memoryType; in PetscGetMemType()
63 if (cerr == hipSuccess && mtype == hipMemoryTypeDevice) *type = PETSC_MEMTYPE_DEVICE; in PetscGetMemType()
/petsc/src/sys/objects/device/interface/
H A Dmemory.cxx48 PetscMemType mtype = PETSC_MEMTYPE_HOST; // memtype of allocation member
66 …tes(PetscMemType mtype_, PetscObjectId id_, std::size_t size_) noexcept : mtype(mtype_), id(id_), … in PointerAttributes()
70 return (mtype == other.mtype) && (id == other.id) && (size == other.size); in operator ==()
190 …DeviceRegisterMemory_Private(const void *PETSC_RESTRICT ptr, PetscMemType mtype, std::size_t size,… in PetscDeviceRegisterMemory_Private() argument
201 const auto tmp = PointerAttributes(mtype, newid, size); in PetscDeviceRegisterMemory_Private()
207 …type %s, size %zu). Must register the larger region first", ptr, PetscMemTypeToString(mtype), size, in PetscDeviceRegisterMemory_Private()
208 entry.first, PetscMemTypeToString(attr.mtype), attr.size); in PetscDeviceRegisterMemory_Private()
216 std::forward_as_tuple(mtype, newid, size) in PetscDeviceRegisterMemory_Private()
224 …PetscCheck(PointerAttributes(mtype, old.id, size) == old, PETSC_COMM_SELF, PETSC_ERR_LIB, "Pointer… in PetscDeviceRegisterMemory_Private()
225 … PetscMemTypeToString(old.mtype), old.size, old.id, PetscMemTypeToString(mtype), size, old.id); in PetscDeviceRegisterMemory_Private()
[all …]
/petsc/src/sys/objects/device/tests/
H A Dex7.c20 static PetscErrorCode TestAllocate(PetscDeviceContext dctx, PetscRandom rand, PetscMemType mtype) in TestAllocate() argument
26 if (PetscMemTypeDevice(mtype)) { in TestAllocate()
35 PetscCall(PetscDeviceMalloc(dctx, mtype, n, &ptr)); in TestAllocate()
36 …lloc() return NULL pointer for %s allocation size %" PetscInt_FMT, PetscMemTypeToString(mtype), n); in TestAllocate()
38 if (PetscMemTypeHost(mtype)) { in TestAllocate()
51 PetscCall(PetscDeviceMalloc(dctx, mtype, 1, &char_ptr)); in TestAllocate()
52 PetscCall(PetscDeviceMalloc(dctx, mtype, 1, &short_ptr)); in TestAllocate()
53 PetscCall(PetscDeviceMalloc(dctx, mtype, 1, &int_ptr)); in TestAllocate()
54 PetscCall(PetscDeviceMalloc(dctx, mtype, 1, &double_ptr)); in TestAllocate()
55 PetscCall(PetscDeviceMalloc(dctx, mtype, 1, &long_int_ptr)); in TestAllocate()
[all …]
/petsc/src/vec/is/sf/tests/
H A Dex4k.kokkos.cxx43 PetscMemType mtype = PETSC_MEMTYPE_HOST; in main() local
68 if (isHost) mtype = PETSC_MEMTYPE_HOST; in main()
69 else if (isKokkos) mtype = PETSC_MEMTYPE_KOKKOS; in main()
73 if (mtype == PETSC_MEMTYPE_HOST) { in main()
113 if (mtype == PETSC_MEMTYPE_HOST) { in main()
137 … PetscCall(PetscSFBcastWithMemTypeBegin(sf[j], MPIU_SCALAR, mtype, rootdata, mtype, leafdata, op)); in main()
139 …PetscCall(PetscSFReduceWithMemTypeBegin(sf[j], MPIU_SCALAR, mtype, leafdata, mtype, rootdata, op)); in main()
148 …## PetscSF Ping-pong test on %s ##\n Message(Bytes) \t\tLatency(us)\n", mtype == PETSC_MEMTYPE_H… in main()
154 if (mtype == PETSC_MEMTYPE_HOST) { in main()
/petsc/src/vec/is/sf/impls/basic/cupm/hip/
H A Dsfcupm.hip.cxx33 PetscErrorCode PetscSFMalloc_HIP(PetscMemType mtype, size_t size, void **ptr) in PetscSFMalloc_HIP() argument
36 PetscCall(PetscSFHIP::Malloc(mtype, size, ptr)); in PetscSFMalloc_HIP()
40 PetscErrorCode PetscSFFree_HIP(PetscMemType mtype, void *ptr) in PetscSFFree_HIP() argument
43 PetscCall(PetscSFHIP::Free(mtype, ptr)); in PetscSFFree_HIP()
/petsc/src/vec/is/sf/impls/basic/cupm/cuda/
H A Dsfcupm.cu30 PetscErrorCode PetscSFMalloc_CUDA(PetscMemType mtype, size_t size, void **ptr) in PetscSFMalloc_CUDA() argument
33 PetscCall(PetscSFCuda::Malloc(mtype, size, ptr)); in PetscSFMalloc_CUDA()
37 PetscErrorCode PetscSFFree_CUDA(PetscMemType mtype, void *ptr) in PetscSFFree_CUDA() argument
40 PetscCall(PetscSFCuda::Free(mtype, ptr)); in PetscSFFree_CUDA()
/petsc/src/mat/tests/
H A Dex20.c11 char mtype[256]; in main() local
58 PetscCall(PetscStrncpy(mtype, MATSAME, sizeof(mtype))); in main()
59 PetscCall(PetscOptionsGetString(NULL, NULL, "-conv_mat_type", mtype, sizeof(mtype), NULL)); in main()
60 PetscCall(MatConvert(C, mtype, MAT_INITIAL_MATRIX, &A)); in main()
H A Dex134.c5 PetscErrorCode Assemble(MPI_Comm comm, PetscInt bs, MatType mtype) in Assemble() argument
25 PetscCall(MatSetType(A, mtype)); in Assemble()
33 PetscCall(PetscPrintf(comm, "Matrix %s(%" PetscInt_FMT ")\n", mtype, bs)); in Assemble()
40 PetscCall(PetscStrcmp(mtype, MATMPISBAIJ, &issbaij)); in Assemble()
H A Dex261.c52 MatType mtype; in InitializeMatrix() local
57 PetscCall(MatGetType(A, &mtype)); in InitializeMatrix()
58 PetscCall(PetscStrstr(mtype, "aij", &tmp)); in InitializeMatrix()
H A Dex2.c8 MatType mtype; in TransposeAXPY() local
11 PetscCall(MatGetType(mat, &mtype)); in TransposeAXPY()
21 PetscCall(MatConvert(E, mtype, MAT_INPLACE_MATRIX, &E)); in TransposeAXPY()
54 PetscCall(MatConvert(E, mtype, MAT_INPLACE_MATRIX, &E)); in TransposeAXPY()
68 PetscCall(MatConvert(E, mtype, MAT_INITIAL_MATRIX, &F)); in TransposeAXPY()
H A Dex57.c16 MatType mtype = MATSEQBAIJ; in main() local
34 PetscCall(MatSetType(A, mtype)); in main()
/petsc/src/ksp/ksp/tests/
H A Dex34.c13 char mtype[256]; in main() local
19 PetscCall(PetscOptionsGetString(NULL, NULL, "-mtype", mtype, sizeof(mtype), &flg)); in main()
23 PetscCall(MatConvert(Ad, flg ? mtype : MATAIJ, MAT_INITIAL_MATRIX, &A)); in main()
/petsc/src/sys/classes/draw/interface/
H A Ddmarker.c75 PetscErrorCode PetscDrawSetMarkerType(PetscDraw draw, PetscDrawMarkerType mtype) in PetscDrawSetMarkerType() argument
79 draw->markertype = mtype; in PetscDrawSetMarkerType()
96 PetscErrorCode PetscDrawGetMarkerType(PetscDraw draw, PetscDrawMarkerType *mtype) in PetscDrawGetMarkerType() argument
100 *mtype = draw->markertype; in PetscDrawGetMarkerType()
/petsc/src/vec/vec/impls/hypre/
H A Dvhyp.c87 PetscMemType mtype; in VecGetArrayForHYPRE() local
103 PetscCall(VecGetArrayReadAndMemType(v, (const PetscScalar **)ptr, &mtype)); in VecGetArrayForHYPRE()
104 …PetscCheck(PetscMemTypeDevice(mtype), comm, PETSC_ERR_ARG_WRONG, "HYPRE_MEMORY_DEVICE expects a de… in VecGetArrayForHYPRE()
113 PetscCall(VecGetArrayWriteAndMemType(v, (PetscScalar **)ptr, &mtype)); in VecGetArrayForHYPRE()
114 …PetscCheck(PetscMemTypeDevice(mtype), comm, PETSC_ERR_ARG_WRONG, "HYPRE_MEMORY_DEVICE expects a de… in VecGetArrayForHYPRE()
123 PetscCall(VecGetArrayAndMemType(v, (PetscScalar **)ptr, &mtype)); in VecGetArrayForHYPRE()
124 …PetscCheck(PetscMemTypeDevice(mtype), comm, PETSC_ERR_ARG_WRONG, "HYPRE_MEMORY_DEVICE expects a de… in VecGetArrayForHYPRE()
/petsc/src/binding/petsc4py/test/
H A Dtest_mat_fact.py5 def mkmat(n, mtype, opts): argument
8 A.setType(mtype)
15 def mksys_diag(n, mtype, opts): argument
16 A = mkmat(n, mtype, opts)
28 def mksys_poi2(n, mtype, opts): argument
29 A = mkmat(n, mtype, opts)
/petsc/include/petsc/private/
H A Dveccupmimpl.h102 PetscMemType mtype; variable
117 PetscCall(PetscCUPMGetMemType(vcu->array_d, &mtype));
118 …comm, "dptr is device mem? %s\n", PetscBools[static_cast<PetscBool>(PetscMemTypeDevice(mtype))]));
571 template <PetscMemType mtype, PetscMemoryAccessMode access, bool force>
574 constexpr auto hostmem = PetscMemTypeHost(mtype); in GetArray()
580 static_assert((mtype == PETSC_MEMTYPE_HOST) || (mtype == PETSC_MEMTYPE_DEVICE), ""); in GetArray()
623 template <PetscMemType mtype, PetscMemoryAccessMode access, bool force>
630 PetscCall(D::template GetArray<mtype, access, force>(v, a, dctx)); in GetArray()
636 template <PetscMemType mtype, PetscMemoryAccessMode access>
640 static_assert((mtype == PETSC_MEMTYPE_HOST) || (mtype == PETSC_MEMTYPE_DEVICE), ""); in RestoreArray()
[all …]
H A Dcupmobject.hpp361 …cErrorCode CUPMObject<T>::CheckPointerMatchesMemType_(const void *ptr, PetscMemType mtype) noexcept in CheckPointerMatchesMemType_() argument
368 if (mtype == PETSC_MEMTYPE_HOST) { in CheckPointerMatchesMemType_()
369 …clared as %s does not match actual memtype %s", ptr, PetscMemTypeToString(mtype), PetscMemTypeToSt… in CheckPointerMatchesMemType_()
370 } else if (mtype == PETSC_MEMTYPE_DEVICE) { in CheckPointerMatchesMemType_()
373 …clared as %s does not match actual memtype %s", ptr, PetscMemTypeToString(mtype), PetscMemTypeToSt… in CheckPointerMatchesMemType_()
375 …k(mtype == ptr_mtype, PETSC_COMM_SELF, PETSC_ERR_POINTER, "Pointer %p declared as %s does not matc… in CheckPointerMatchesMemType_()
H A Dsfimpl.h201 #define PetscSFMalloc(sf, mtype, sz, ptr) ((*(sf)->ops->Malloc)(mtype, sz, ptr)) argument
203 …#define PetscSFFree(sf, mtype, ptr) ((PetscErrorCode)((ptr) && ((*(sf)->ops->Free)(mtype, ptr) || … argument
206 #define PetscSFMalloc(sf, mtype, sz, ptr) PetscMalloc(sz, ptr) argument
207 #define PetscSFFree(sf, mtype, ptr) PetscFree(ptr) argument
/petsc/include/
H A Dpetscdevice.h144 #define PetscDeviceMalloc(dctx, mtype, n, ptr) PetscDeviceAllocate_Private((dctx), PETSC_FALSE, (mt… argument
178 #define PetscDeviceCalloc(dctx, mtype, n, ptr) PetscDeviceAllocate_Private((dctx), PETSC_TRUE, (mty… argument
/petsc/src/mat/impls/aij/seq/mkl_pardiso/
H A Dmkl_pardiso.c41 void pardiso_64init(void *pt, INT_TYPE *mtype, INT_TYPE iparm[]) in pardiso_64init() argument
45 PetscCallVoid(PetscBLASIntCast(*mtype, &mtype_copy)); in pardiso_64init()
72 INT_TYPE phase, maxfct, mnum, mtype, n, nrhs, msglvl, err; member
311 if (mpardiso->mtype == 2) PetscCall(MatSetOption(F->schur, MAT_SPD, PETSC_TRUE)); in MatFactorSetSchurIS_MKL_PARDISO()
334 …->pt, &mat_mkl_pardiso->maxfct, &mat_mkl_pardiso->mnum, &mat_mkl_pardiso->mtype, &mat_mkl_pardiso-… in MatDestroy_MKL_PARDISO()
398 …->pt, &mat_mkl_pardiso->maxfct, &mat_mkl_pardiso->mnum, &mat_mkl_pardiso->mtype, &mat_mkl_pardiso-… in MatSolve_MKL_PARDISO()
403 …->pt, &mat_mkl_pardiso->maxfct, &mat_mkl_pardiso->mnum, &mat_mkl_pardiso->mtype, &mat_mkl_pardiso-… in MatSolve_MKL_PARDISO()
430 …->pt, &mat_mkl_pardiso->maxfct, &mat_mkl_pardiso->mnum, &mat_mkl_pardiso->mtype, &mat_mkl_pardiso-… in MatSolve_MKL_PARDISO()
456 …->pt, &mat_mkl_pardiso->maxfct, &mat_mkl_pardiso->mnum, &mat_mkl_pardiso->mtype, &mat_mkl_pardiso-… in MatForwardSolve_MKL_PARDISO()
481 …->pt, &mat_mkl_pardiso->maxfct, &mat_mkl_pardiso->mnum, &mat_mkl_pardiso->mtype, &mat_mkl_pardiso-… in MatBackwardSolve_MKL_PARDISO()
[all …]
/petsc/src/dm/impls/plex/
H A Dplexegads.c488 int Nb, oclass, mtype, *senses, peri; in DMSnapToGeomModel_EGADS_Internal() local
501 PetscCall(EGlite_getTopology(model, &geom, &oclass, &mtype, NULL, &Nb, &bodies, &senses)); in DMSnapToGeomModel_EGADS_Internal()
503 PetscCall(EG_getTopology(model, &geom, &oclass, &mtype, NULL, &Nb, &bodies, &senses)); in DMSnapToGeomModel_EGADS_Internal()
618 int oclass, mtype, *senses, *shsenses, *fsenses, *lsenses, *esenses; in DMPlexGeomPrintModel_Internal() local
624 PetscCall(EGlite_getTopology(model, &geom, &oclass, &mtype, NULL, &Nb, &bodies, &senses)); in DMPlexGeomPrintModel_Internal()
626 PetscCall(EG_getTopology(model, &geom, &oclass, &mtype, NULL, &Nb, &bodies, &senses)); in DMPlexGeomPrintModel_Internal()
694 PetscCall(EGlite_getTopology(body, &geom, &oclass, &mtype, NULL, &Nsh, &shobjs, &shsenses)); in DMPlexGeomPrintModel_Internal()
696 PetscCall(EG_getTopology(body, &geom, &oclass, &mtype, NULL, &Nsh, &shobjs, &shsenses)); in DMPlexGeomPrintModel_Internal()
712 PetscCall(EGlite_getTopology(shell, &geom, &oclass, &mtype, NULL, &Nf, &fobjs, &fsenses)); in DMPlexGeomPrintModel_Internal()
714 PetscCall(EG_getTopology(shell, &geom, &oclass, &mtype, NULL, &Nf, &fobjs, &fsenses)); in DMPlexGeomPrintModel_Internal()
[all …]
/petsc/src/sys/objects/device/impls/cupm/
H A Dcupmcontext.hpp188 static PetscErrorCode check_memtype_(PetscMemType mtype, const char mess[]) noexcept in check_memtype_() argument
191 …PetscCheck(PetscMemTypeHost(mtype) || (mtype == PETSC_MEMTYPE_DEVICE) || (mtype == PETSC_MEMTYPE_C… in check_memtype_()
485 …ntext<T>::memAlloc(PetscDeviceContext dctx, PetscBool clear, PetscMemType mtype, std::size_t n, st… in memAlloc() argument
491 PetscCall(check_memtype_(mtype, "allocating")); in memAlloc()
492 if (PetscMemTypeHost(mtype)) { in memAlloc()
502 inline PetscErrorCode DeviceContext<T>::memFree(PetscDeviceContext dctx, PetscMemType mtype, void *… in memFree() argument
508 PetscCall(check_memtype_(mtype, "freeing")); in memFree()
510 if (PetscMemTypeHost(mtype)) { in memFree()
558 inline PetscErrorCode DeviceContext<T>::memSet(PetscDeviceContext dctx, PetscMemType mtype, void *p… in memSet() argument
562 PetscCall(check_memtype_(mtype, "zeroing")); in memSet()
/petsc/src/mat/impls/aij/mpi/mkl_cpardiso/
H A Dmkl_cpardiso.c91 INT_TYPE phase, maxfct, mnum, mtype, n, nrhs, msglvl, err; member
359 …t, &mat_mkl_cpardiso->maxfct, &mat_mkl_cpardiso->mnum, &mat_mkl_cpardiso->mtype, &mat_mkl_cpardiso… in MatDestroy_MKL_CPARDISO()
389 …t, &mat_mkl_cpardiso->maxfct, &mat_mkl_cpardiso->mnum, &mat_mkl_cpardiso->mtype, &mat_mkl_cpardiso… in MatSolve_MKL_CPARDISO()
412 …t, &mat_mkl_cpardiso->maxfct, &mat_mkl_cpardiso->mnum, &mat_mkl_cpardiso->mtype, &mat_mkl_cpardiso… in MatForwardSolve_MKL_CPARDISO()
435 …t, &mat_mkl_cpardiso->maxfct, &mat_mkl_cpardiso->mnum, &mat_mkl_cpardiso->mtype, &mat_mkl_cpardiso… in MatBackwardSolve_MKL_CPARDISO()
473 …t, &mat_mkl_cpardiso->maxfct, &mat_mkl_cpardiso->mnum, &mat_mkl_cpardiso->mtype, &mat_mkl_cpardiso… in MatMatSolve_MKL_CPARDISO()
495 …t, &mat_mkl_cpardiso->maxfct, &mat_mkl_cpardiso->mnum, &mat_mkl_cpardiso->mtype, &mat_mkl_cpardiso… in MatFactorNumeric_MKL_CPARDISO()
525 …"-mat_mkl_cpardiso_69", "Defines the matrix type", "None", mat_mkl_cpardiso->mtype, &icntl, &flg)); in MatSetFromOptions_MKL_CPARDISO()
526 if (flg) mat_mkl_cpardiso->mtype = icntl; in MatSetFromOptions_MKL_CPARDISO()
610 mat_mkl_cpardiso->mtype = PetscDefined(USE_COMPLEX) ? 13 : 11; in PetscInitialize_MKL_CPARDISO()
[all …]
/petsc/src/mat/impls/dense/mpi/cupm/
H A Dmatmpidensecupm.hpp56 template <PetscMemType mtype, PetscMemoryAccessMode mode>
59 return GetArray<mtype, mode>(m, p); in GetArrayC_()
62 template <PetscMemType mtype, PetscMemoryAccessMode mode>
65 return RestoreArray<mtype, mode>(m, p); in RestoreArrayC_()
275 inline PetscErrorCode MatDense_MPI_CUPM<T>::Convert_MPIDenseCUPM_MPIDense(Mat M, MatType mtype, Mat… in Convert_MPIDenseCUPM_MPIDense() argument
278 PetscCall(Convert_Dispatch_</* to host */ true>(M, mtype, reuse, newmat)); in Convert_MPIDenseCUPM_MPIDense()
283 inline PetscErrorCode MatDense_MPI_CUPM<T>::Convert_MPIDense_MPIDenseCUPM(Mat M, MatType mtype, Mat… in Convert_MPIDense_MPIDenseCUPM() argument
286 PetscCall(Convert_Dispatch_</* to host */ false>(M, mtype, reuse, newmat)); in Convert_MPIDense_MPIDenseCUPM()

1234