Skip to main content
Ctrl+K
PETSc v3.26.1-554-gc8d5ad6b3782 documentation - Home
  • Overview
  • Install
  • Tutorials
  • User-Guide
  • C/Fortran API
  • petsc4py API
  • FAQ
  • Community
  • Developers
  • Misc.
  • GitLab
  • Overview
  • Install
  • Tutorials
  • User-Guide
  • C/Fortran API
  • petsc4py API
  • FAQ
  • Community
  • Developers
  • Misc.
  • GitLab
  • PetscDeviceType

PetscDeviceType#

Kind of accelerator device backend

Synopsis#

#include <petscdevicetypes.h> 
typedef enum {
  PETSC_DEVICE_HOST,
  PETSC_DEVICE_CUDA,
  PETSC_DEVICE_HIP,
  PETSC_DEVICE_SYCL,
  PETSC_DEVICE_MAX
} PetscDeviceType;

Values#

  • PETSC_DEVICE_HOST - Host, no accelerator backend found

  • PETSC_DEVICE_CUDA - CUDA enabled GPU

  • PETSC_DEVICE_HIP - ROCM/HIP enabled GPU

  • PETSC_DEVICE_SYCL - SYCL enabled device

  • PETSC_DEVICE_MAX - Always 1 greater than the largest valid PetscDeviceType, invalid type, do not use

Note#

One can also use the PETSC_DEVICE_DEFAULT() routine to get the current default PetscDeviceType.

See Also#

PetscDevice, PetscDeviceInitType, PetscDeviceCreate(), PETSC_DEVICE_DEFAULT()

Level#

beginner

Location#

include/petscdevicetypes.h

Examples#

src/sys/objects/device/tests/ex11.cxx
src/sys/objects/device/tests/ex13.cxx
src/sys/objects/device/tests/ex4.c
src/sys/objects/device/tests/ex7.c
src/sys/objects/device/tests/ex9.c
src/mat/tutorials/ex7.c
src/mat/tests/ex254.c
src/mat/tests/ex324.c
src/vec/is/sf/tests/ex26.c
src/vec/vec/tests/ex65.c


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

On this page
  • Synopsis
  • Values
  • Note
  • See Also
  • Level
  • Location
  • Examples
Edit on GitLab
Show Source

© Copyright 1991-2026, UChicago Argonne, LLC and the PETSc Development Team.

Created using Sphinx 7.3.7.

Built with the PyData Sphinx Theme 0.15.1.

Last updated on 2026-11-28T03:39:59-0600 (v3.26.1-554-gc8d5ad6b3782).