:orphan:
# MatCreateDenseHIP
Creates a matrix in `MATDENSEHIP` format using HIP. 
## Synopsis
```
PetscErrorCode MatCreateDenseHIP(MPI_Comm comm, PetscInt m, PetscInt n, PetscInt M, PetscInt N, PetscScalar *data, Mat *A)
```
Collective


## Input Parameters

- ***comm -*** MPI communicator
- ***m    -*** number of local rows (or `PETSC_DECIDE` to have calculated if `M` is given)
- ***n    -*** number of local columns (or `PETSC_DECIDE` to have calculated if `N` is given)
- ***M    -*** number of global rows (or `PETSC_DECIDE` to have calculated if `m` is given)
- ***N    -*** number of global columns (or `PETSC_DECIDE` to have calculated if `n` is given)
- ***data -*** optional location of GPU matrix data. Pass`NULL` to have PETSc to control matrix
memory allocation.



## Output Parameter

- ***A -*** the matrix





## See Also
 `MATDENSEHIP`, `MatCreate()`, `MatCreateDense()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/dense/mpi/cupm/hip/matmpidensehip.hip.cpp#MatCreateDenseHIP">src/mat/impls/dense/mpi/cupm/hip/matmpidensehip.hip.cpp</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/impls/dense/mpi/cupm/hip/matmpidensehip.hip.cpp)


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