Documentation for module acc_devmem

Accelerator support

source: acc_devmem.F
Loading...

public Types:

acc_devmem_type
...

Generic procedures:

acc_devmem_dev2host
acc_devmem_host2dev

public Subroutines/Functions:

FUNCTION
LOGICAL
acc_devmem_allocated (this)
Returns a logical, which indicates if the given devmem is allocated.
Allocates a given devmem.
FUNCTION
LOGICAL
acc_devmem_cptr (this)
Returns C-pointer to data of given devmem.
Deallocates a given devmem.
Ensures that given devmem has at least the requested size.
Sets entries in given devmem to zero, asynchronously.
Allocates a given devmem.
FUNCTION
INTEGER
acc_devmem_size_in_bytes (this)
Returns size of given devmem in terms of item count (not bytes!)

public Types:

TYPE :: acc_devmem_type

...


INTEGER
:: size_in_bytes = -1 ...


Generic procedure acc_devmem_dev2host

Transfers cuda devmem to 1D fortran-array.

INTENT(in)
:: this × × × × × ×
INTEGER(int_4),
POINTER
:: hostmem(:) ×
INTEGER(int_8),
POINTER
:: hostmem(:) ×
REAL(real_4),
POINTER
:: hostmem(:) ×
REAL(real_8),
POINTER
:: hostmem(:) ×
COMPLEX(real_4),
POINTER
:: hostmem(:) ×
COMPLEX(real_8),
POINTER
:: hostmem(:) ×
INTENT(in)
:: stream × × × × × ×

Generic procedure acc_devmem_host2dev

...

INTENT(in)
:: this × × × × × × × × × × × ×
INTEGER(int_4),
POINTER
:: hostmem(:) ×
INTEGER(int_8),
POINTER
:: hostmem(:) ×
REAL(real_4),
POINTER
:: hostmem(:) ×
REAL(real_8),
POINTER
:: hostmem(:) ×
COMPLEX(real_4),
POINTER
:: hostmem(:) ×
COMPLEX(real_8),
POINTER
:: hostmem(:) ×
INTEGER(int_4),
POINTER
:: hostmem(:,:) ×
INTEGER(int_8),
POINTER
:: hostmem(:,:) ×
REAL(real_4),
POINTER
:: hostmem(:,:) ×
REAL(real_8),
POINTER
:: hostmem(:,:) ×
COMPLEX(real_4),
POINTER
:: hostmem(:,:) ×
COMPLEX(real_8),
POINTER
:: hostmem(:,:) ×
INTENT(in)
:: stream × × × × × × × × × × × ×

FUNCTIONacc_devmem_allocated(this)

Returns a logical, which indicates if the given devmem is allocated.

Return Value ::
LOGICAL
true if device memory is allocated, false otherwise
Arguments:
INTENT(in)
:: this device memory

SUBROUTINEacc_devmem_allocate_bytes(this, size_in_bytes)

Allocates a given devmem.

Arguments:
INTENT(inout)
:: this device memory
INTEGER,
INTENT(in)
:: size_in_bytes size in bytes

FUNCTIONacc_devmem_cptr(this)

Returns C-pointer to data of given devmem.

Return Value ::
LOGICAL
false (accelerator support is not enabled)
Arguments:
INTEGER,
INTENT(in)
:: this device memory

SUBROUTINEacc_devmem_deallocate(this)

Deallocates a given devmem.

Arguments:
INTENT(inout)
:: this device memory

SUBROUTINEacc_devmem_ensure_size_bytes(this, stream, requested_size_in_bytes, nocopy, zero_pad)

Ensures that given devmem has at least the requested size.

Arguments:
INTENT(inout)
:: this device memory
INTENT(in)
:: stream on which zeroing and memcopying is performed
INTEGER,
INTENT(in)
:: requested_size_in_bytes requested size in bytes
LOGICAL,
INTENT(in),
OPTIONAL
:: nocopy if after growin old content should NOT be copied over. Default: false.
LOGICAL,
INTENT(in),
OPTIONAL
:: zero_pad if after growing the new memory should be zeroed. Default: false.

SUBROUTINEacc_devmem_setzero_bytes(this, first_byte, last_byte, stream)

Sets entries in given devmem to zero, asynchronously.

Arguments:
INTENT(inout)
:: this device memory
INTEGER,
INTENT(in),
OPTIONAL
:: first_byte begin of region to zero, defaults to 1 if not given.
INTEGER,
INTENT(in),
OPTIONAL
:: last_byte end of region to zero, defaults to size if not given.
INTENT(in)
:: stream stream on which zeroing is performed.

SUBROUTINEacc_devmem_set_cptr(this, pointee, size_in_bytes, lb_in_bytes)

Allocates a given devmem.

Arguments:
INTENT(inout)
:: this device memory
INTENT(in)
:: pointee ...
INTEGER,
INTENT(in)
:: size_in_bytes size in bytes
INTEGER,
INTENT(in)
:: lb_in_bytes ...

FUNCTIONacc_devmem_size_in_bytes(this)

Returns size of given devmem in terms of item count (not bytes!)

Return Value ::
INTEGER
size of device memory (item count)
Arguments:
INTENT(in)
:: this device memory

SUBROUTINEdev2host_i4_1d(this, hostmem, stream)

Transfers cuda devmem to 1D fortran-array.

Arguments:
INTENT(in)
:: this device memory
INTEGER(int_4),
POINTER
:: hostmem(:) host memory
INTENT(in)
:: stream stream

SUBROUTINEdev2host_i8_1d(this, hostmem, stream)

Transfers cuda devmem to 1D fortran-array.

Arguments:
INTENT(in)
:: this device memory
INTEGER(int_8),
POINTER
:: hostmem(:) host memory
INTENT(in)
:: stream stream

SUBROUTINEdev2host_r4_1d(this, hostmem, stream)

Transfers cuda devmem to 1D fortran-array.

Arguments:
INTENT(in)
:: this device memory
REAL(real_4),
POINTER
:: hostmem(:) host memory
INTENT(in)
:: stream stream

SUBROUTINEdev2host_r8_1d(this, hostmem, stream)

Transfers cuda devmem to 1D fortran-array.

Arguments:
INTENT(in)
:: this device memory
REAL(real_8),
POINTER
:: hostmem(:) host memory
INTENT(in)
:: stream stream

SUBROUTINEdev2host_c4_1d(this, hostmem, stream)

Transfers cuda devmem to 1D fortran-array.

Arguments:
INTENT(in)
:: this device memory
COMPLEX(real_4),
POINTER
:: hostmem(:) host memory
INTENT(in)
:: stream stream

SUBROUTINEdev2host_c8_1d(this, hostmem, stream)

Transfers cuda devmem to 1D fortran-array.

Arguments:
INTENT(in)
:: this device memory
COMPLEX(real_8),
POINTER
:: hostmem(:) host memory
INTENT(in)
:: stream stream

SUBROUTINEhost2dev_i4_1d(this, hostmem, stream)

Helper-routine performing actuall host2dev transfers.

Arguments:
INTENT(in)
:: this device memory
INTEGER(int_4),
POINTER
:: hostmem(:) ...
INTENT(in)
:: stream stream used for memory transfer

SUBROUTINEhost2dev_i8_1d(this, hostmem, stream)

Transfers 1D fortran-array from host to cuda devmem.

Arguments:
INTENT(in)
:: this device memory
INTEGER(int_8),
POINTER
:: hostmem(:) host memory
INTENT(in)
:: stream stream

SUBROUTINEhost2dev_r4_1d(this, hostmem, stream)

Transfers 1D fortran-array from host to cuda devmem.

Arguments:
INTENT(in)
:: this device memory
REAL(real_4),
POINTER
:: hostmem(:) host memory
INTENT(in)
:: stream stream

SUBROUTINEhost2dev_r8_1d(this, hostmem, stream)

Transfers 1D fortran-array from host to cuda devmem.

Arguments:
INTENT(in)
:: this device memory
REAL(real_8),
POINTER
:: hostmem(:) host memory
INTENT(in)
:: stream stream

SUBROUTINEhost2dev_c4_1d(this, hostmem, stream)

Transfers 1D fortran-array from host to cuda devmem.

Arguments:
INTENT(in)
:: this device memory
COMPLEX(real_4),
POINTER
:: hostmem(:) host memory
INTENT(in)
:: stream stream

SUBROUTINEhost2dev_c8_1d(this, hostmem, stream)

Transfers 1D fortran-array from host to cuda devmem.

Arguments:
INTENT(in)
:: this device memory
COMPLEX(real_8),
POINTER
:: hostmem(:) host memory
INTENT(in)
:: stream stream

SUBROUTINEhost2dev_i4_2d(this, hostmem, stream)

Transfers 2D fortran-array from host to cuda devmem.

Arguments:
INTENT(in)
:: this device memory
INTEGER(int_4),
POINTER
:: hostmem(:,:) host memory
INTENT(in)
:: stream stream

SUBROUTINEhost2dev_i8_2d(this, hostmem, stream)

Transfers 2D fortran-array from host to cuda devmem.

Arguments:
INTENT(in)
:: this device memory
INTEGER(int_8),
POINTER
:: hostmem(:,:) host memory
INTENT(in)
:: stream stream

SUBROUTINEhost2dev_r4_2d(this, hostmem, stream)

Transfers 2D fortran-array from host to cuda devmem.

Arguments:
INTENT(in)
:: this device memory
REAL(real_4),
POINTER
:: hostmem(:,:) host memory
INTENT(in)
:: stream stream

SUBROUTINEhost2dev_r8_2d(this, hostmem, stream)

Transfers 2D fortran-array from host to cuda devmem.

Arguments:
INTENT(in)
:: this device memory
REAL(real_8),
POINTER
:: hostmem(:,:) host memory
INTENT(in)
:: stream stream

SUBROUTINEhost2dev_c4_2d(this, hostmem, stream)

Transfers 2D fortran-array from host to cuda devmem.

Arguments:
INTENT(in)
:: this device memory
COMPLEX(real_4),
POINTER
:: hostmem(:,:) host memory
INTENT(in)
:: stream stream

SUBROUTINEhost2dev_c8_2d(this, hostmem, stream)

Transfers 2D fortran-array from host to cuda devmem.

Arguments:
INTENT(in)
:: this device memory
COMPLEX(real_8),
POINTER
:: hostmem(:,:) host memory
INTENT(in)
:: stream stream