:orphan:
# 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
src/ksp/pc/impls/gamg/gamg.c
## Implementations
PCGAMGSetCpuPinCoarseGrids_GAMG in src/ksp/pc/impls/gamg/gamg.c
---
[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](/manualpages/index.md)
[Index of all manual pages](/manualpages/singleindex.md)