Actual source code: bvmat.h

      1: /*
      2:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      3:    SLEPc - Scalable Library for Eigenvalue Problem Computations
      4:    Copyright (c) 2002-, Universitat Politecnica de Valencia, Spain

      6:    This file is part of SLEPc.
      7:    SLEPc is distributed under a 2-clause BSD license (see LICENSE).
      8:    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      9: */

     11: #pragma once

     13: typedef struct {
     14:   Mat       A;
     15:   PetscBool mpi;    /* true if either VECMPI, VECMPICUDA, or VECMPIHIP */
     16: } BV_MAT;

     18: #if defined(PETSC_HAVE_CUDA)
     19: SLEPC_INTERN PetscErrorCode BVMult_Mat_CUDA(BV,PetscScalar,PetscScalar,BV,Mat);
     20: SLEPC_INTERN PetscErrorCode BVMultVec_Mat_CUDA(BV,PetscScalar,PetscScalar,Vec,PetscScalar*);
     21: SLEPC_INTERN PetscErrorCode BVMultInPlace_Mat_CUDA(BV,Mat,PetscInt,PetscInt);
     22: SLEPC_INTERN PetscErrorCode BVMultInPlaceHermitianTranspose_Mat_CUDA(BV,Mat,PetscInt,PetscInt);
     23: SLEPC_INTERN PetscErrorCode BVDot_Mat_CUDA(BV,BV,Mat);
     24: SLEPC_INTERN PetscErrorCode BVDotVec_Mat_CUDA(BV,Vec,PetscScalar*);
     25: SLEPC_INTERN PetscErrorCode BVDotVec_Local_Mat_CUDA(BV,Vec,PetscScalar*);
     26: SLEPC_INTERN PetscErrorCode BVScale_Mat_CUDA(BV,PetscInt,PetscScalar);
     27: SLEPC_INTERN PetscErrorCode BVNorm_Mat_CUDA(BV,PetscInt,NormType,PetscReal*);
     28: SLEPC_INTERN PetscErrorCode BVNorm_Local_Mat_CUDA(BV,PetscInt,NormType,PetscReal*);
     29: SLEPC_INTERN PetscErrorCode BVNormalize_Mat_CUDA(BV,PetscScalar*);
     30: SLEPC_INTERN PetscErrorCode BVMatMult_Mat_CUDA(BV,Mat,BV);
     31: SLEPC_INTERN PetscErrorCode BVCopy_Mat_CUDA(BV,BV);
     32: SLEPC_INTERN PetscErrorCode BVCopyColumn_Mat_CUDA(BV,PetscInt,PetscInt);
     33: SLEPC_INTERN PetscErrorCode BVResize_Mat_CUDA(BV,PetscInt,PetscBool);
     34: SLEPC_INTERN PetscErrorCode BVGetColumn_Mat_CUDA(BV,PetscInt,Vec*);
     35: SLEPC_INTERN PetscErrorCode BVRestoreColumn_Mat_CUDA(BV,PetscInt,Vec*);
     36: SLEPC_INTERN PetscErrorCode BVRestoreSplit_Mat_CUDA(BV,BV*,BV*);
     37: SLEPC_INTERN PetscErrorCode BVRestoreSplitRows_Mat_CUDA(BV,IS,IS,BV*,BV*);
     38: SLEPC_INTERN PetscErrorCode BVGetMat_Mat_CUDA(BV,Mat*);
     39: SLEPC_INTERN PetscErrorCode BVRestoreMat_Mat_CUDA(BV,Mat*);
     40: #endif

     42: #if defined(PETSC_HAVE_HIP)
     43: SLEPC_INTERN PetscErrorCode BVMult_Mat_HIP(BV,PetscScalar,PetscScalar,BV,Mat);
     44: SLEPC_INTERN PetscErrorCode BVMultVec_Mat_HIP(BV,PetscScalar,PetscScalar,Vec,PetscScalar*);
     45: SLEPC_INTERN PetscErrorCode BVMultInPlace_Mat_HIP(BV,Mat,PetscInt,PetscInt);
     46: SLEPC_INTERN PetscErrorCode BVMultInPlaceHermitianTranspose_Mat_HIP(BV,Mat,PetscInt,PetscInt);
     47: SLEPC_INTERN PetscErrorCode BVDot_Mat_HIP(BV,BV,Mat);
     48: SLEPC_INTERN PetscErrorCode BVDotVec_Mat_HIP(BV,Vec,PetscScalar*);
     49: SLEPC_INTERN PetscErrorCode BVDotVec_Local_Mat_HIP(BV,Vec,PetscScalar*);
     50: SLEPC_INTERN PetscErrorCode BVScale_Mat_HIP(BV,PetscInt,PetscScalar);
     51: SLEPC_INTERN PetscErrorCode BVNorm_Mat_HIP(BV,PetscInt,NormType,PetscReal*);
     52: SLEPC_INTERN PetscErrorCode BVNorm_Local_Mat_HIP(BV,PetscInt,NormType,PetscReal*);
     53: SLEPC_INTERN PetscErrorCode BVNormalize_Mat_HIP(BV,PetscScalar*);
     54: SLEPC_INTERN PetscErrorCode BVMatMult_Mat_HIP(BV,Mat,BV);
     55: SLEPC_INTERN PetscErrorCode BVCopy_Mat_HIP(BV,BV);
     56: SLEPC_INTERN PetscErrorCode BVCopyColumn_Mat_HIP(BV,PetscInt,PetscInt);
     57: SLEPC_INTERN PetscErrorCode BVResize_Mat_HIP(BV,PetscInt,PetscBool);
     58: SLEPC_INTERN PetscErrorCode BVGetColumn_Mat_HIP(BV,PetscInt,Vec*);
     59: SLEPC_INTERN PetscErrorCode BVRestoreColumn_Mat_HIP(BV,PetscInt,Vec*);
     60: SLEPC_INTERN PetscErrorCode BVRestoreSplit_Mat_HIP(BV,BV*,BV*);
     61: SLEPC_INTERN PetscErrorCode BVRestoreSplitRows_Mat_HIP(BV,IS,IS,BV*,BV*);
     62: SLEPC_INTERN PetscErrorCode BVGetMat_Mat_HIP(BV,Mat*);
     63: SLEPC_INTERN PetscErrorCode BVRestoreMat_Mat_HIP(BV,Mat*);
     64: #endif