Skip to main content
`Ctrl`+`K`

# VecCreateMPIHIPWithArray

Creates a parallel, array-style vector using HIP, where the user provides the device array space to store the vector values.

## Synopsis

    #include <petscvec.h>
    PetscErrorCode VecCreateMPIHIPWithArray(MPI_Comm comm, PetscInt bs, PetscInt n, PetscInt N, const PetscScalar gpuarray[], Vec *v)

Collective

## Input Parameters

- comm - the MPI communicator to use

- bs - block size, same meaning as `VecSetBlockSize()`

- n - local vector length, cannot be `PETSC_DECIDE`

- N - global vector length (or `PETSC_DECIDE` to have calculated)

- gpuarray - the user provided GPU array to store the vector values

## Output Parameter

- v - the vector

## Notes

See `VecCreateSeqHIPWithArray()` for further discussion, this routine shares identical semantics.

## See Also

`VecCreateMPIHIP()`, `VecCreateSeqHIPWithArray()`, `VecCreateMPIWithArray()`, `VecCreateSeqWithArray()`, `VecCreate()`, `VecDuplicate()`, `VecDuplicateVecs()`, `VecCreateGhost()`, `VecCreateMPI()`, `VecCreateGhostWithArray()`, `VecPlaceArray()`

## Level

intermediate

## Location

src/vec/vec/impls/mpi/cupm/hip/vecmpicupm.hip.cxx

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