Allocates memory
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real_8), | DIMENSION(:, :), POINTER | :: | mem |
memory to allocate |
||
integer, | intent(in), | DIMENSION(2) | :: | sizes |
length of elements to allocate |
|
type(dbcsr_memtype_type), | intent(in) | :: | mem_type |
memory type |
SUBROUTINE mem_alloc_d_2d(mem, sizes, mem_type) !! Allocates memory REAL(kind=real_8), DIMENSION(:, :), POINTER :: mem !! memory to allocate INTEGER, DIMENSION(2), INTENT(IN) :: sizes !! length of elements to allocate TYPE(dbcsr_memtype_type), INTENT(IN) :: mem_type !! memory type CHARACTER(len=*), PARAMETER :: routineN = 'mem_alloc_d_2d' INTEGER :: error_handle ! --------------------------------------------------------------------------- IF (careful_mod) & CALL timeset(routineN, error_handle) IF (mem_type%acc_hostalloc) THEN DBCSR_ABORT("Accelerator hostalloc not supported for 2D arrays.") !CALL acc_hostmem_allocate(mem, n, mem_type%acc_stream) ELSE IF (mem_type%mpi) THEN DBCSR_ABORT("MPI allocate not supported for 2D arrays.") !CALL mp_allocate(mem, n) ELSE ALLOCATE (mem(sizes(1), sizes(2))) END IF IF (careful_mod) & CALL timestop(error_handle) END SUBROUTINE mem_alloc_d_2d