Skip to main content
`Ctrl`+`K`

# MatBindToCPU

marks a matrix to temporarily stay on the CPU and perform computations on the CPU

## Synopsis

    #include "petscmat.h"
    PetscErrorCode MatBindToCPU(Mat A, PetscBool flg)

Logically Collective

## Input Parameters

- A - the matrix

- flg - bind to the CPU if value of `PETSC_TRUE`

## Note

`MATAIJKOKKOS` has yet to implement CPU binding. If Kokkos is configured without GPU support, we deem a `MATAIJKOKKOS` matrix as bound to the CPU. Different from `MATAIJVIENNACL` with a CPU backend, `MATAIJKOKKOS` always use its own operation implementations (in constrast to CPU-bound `MATAIJVIENNACL`, which uses `MATAIJ`’s CPU operations).

## See Also

Matrices, `Mat`, `MatBoundToCPU()`

## Level

intermediate

## Location

src/mat/utils/gcreate.c

## Implementations

MatBindToCPU_MPIAIJ() in src/mat/impls/aij/mpi/mpiaij.c
MatBindToCPU_SeqAIJKokkos() in src/mat/impls/aij/seq/kokkos/aijkok.kokkos.cxx
MatBindToCPU_SeqAIJCUSPARSE() in src/mat/impls/aij/seq/seqcusparse/aijcusparse.cu
MatBindToCPU_SeqAIJHIPSPARSE() in src/mat/impls/aij/seq/seqhipsparse/aijhipsparse.hip.cxx
MatBindToCPU_SeqAIJViennaCL() in src/mat/impls/aij/seq/seqviennacl/aijviennacl.cxx
MatBindToCPU_H2OPUS() in src/mat/impls/h2opus/cuda/math2opus.cu
MatBindToCPU_HYPRE() in src/mat/impls/hypre/mhypre.c

Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages