# VecBindToCPU
marks a vector to temporarily stay on the CPU and perform computations on the CPU 
## Synopsis
```
#include "petscvec.h"   
PetscErrorCode VecBindToCPU(Vec v, PetscBool flg)
```
Logically collective on Vec


## Input Parameters

- ***v -*** the vector
- ***flg -*** bind to the CPU if value of PETSC_TRUE




## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/interface/vector.c.html#VecBindToCPU">src/vec/vec/interface/vector.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/impls/mpi/mpicuda/mpicuda.cu.html#VecBindToCPU_MPICUDA">VecBindToCPU_MPICUDA in src/vec/vec/impls/mpi/mpicuda/mpicuda.cu</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/impls/mpi/mpihip/mpihip.hip.c.html#VecBindToCPU_MPIHIP">VecBindToCPU_MPIHIP in src/vec/vec/impls/mpi/mpihip/mpihip.hip.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/impls/mpi/mpiviennacl/mpiviennacl.cxx.html#VecBindToCPU_MPIViennaCL">VecBindToCPU_MPIViennaCL in src/vec/vec/impls/mpi/mpiviennacl/mpiviennacl.cxx</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/impls/seq/seqcuda/veccuda.c.html#VecBindToCPU_SeqCUDA">VecBindToCPU_SeqCUDA in src/vec/vec/impls/seq/seqcuda/veccuda.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/impls/seq/seqhip/vechip.hip.c.html#VecBindToCPU_SeqHIP">VecBindToCPU_SeqHIP in src/vec/vec/impls/seq/seqhip/vechip.hip.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/impls/seq/seqviennacl/vecviennacl.cxx.html#VecBindToCPU_SeqAIJViennaCL">VecBindToCPU_SeqAIJViennaCL in src/vec/vec/impls/seq/seqviennacl/vecviennacl.cxx</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/vec/vec/interface/vector.c)


[Index of all Vec routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
