# PCGAMGSetCpuPinCoarseGrids
pin the coarse grids created in `PCGAMG` to run only on the CPU since the problems may be too small to run efficiently on the GPUs 
## Synopsis
```
#include "petscpc.h" 
#include "petscksp.h" 
PetscErrorCode PCGAMGSetCpuPinCoarseGrids(PC pc, PetscBool flg)
```
Collective


## Input Parameters

- ***pc -*** the preconditioner context
- ***flg -*** `PETSC_TRUE` to pin coarse grids to the CPU



## Options Database Key

- ***-pc_gamg_cpu_pin_coarse_grids -*** pin the coarse grids to the CPU





## See Also
 `PCGAMG`, `PCGAMGSetCoarseGridLayoutType()`, `PCGAMGSetUseParallelCoarseGridSolve()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/gamg/gamg.c.html#PCGAMGSetCpuPinCoarseGrids">src/ksp/pc/impls/gamg/gamg.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/gamg/gamg.c.html#PCGAMGSetCpuPinCoarseGrids_GAMG">PCGAMGSetCpuPinCoarseGrids_GAMG in src/ksp/pc/impls/gamg/gamg.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/pc/impls/gamg/gamg.c)


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