fclAllocHost Interface

public interface fclAllocHost

Generic interface for allocating host arrays using 'pinned' (non-paged) memory. This is required for asynchronous transfers.

Currently implements interfaces for 1D and 2D int32, float and double arrays.

Example: Allocate a 1D integer array with 100 elements

integer, pointer :: hostArray(:)

call fclAllocHost(cmdq,hostArray,100)

NB: cmdq is optional, if omitted then the default command queue is used


Contents


Subroutines

public module subroutine fclAllocHostPtr_1(cmdq, hostPtr, nBytes)

Allocate a 'pinned' (non-paged) host array

Arguments

Type IntentOptional Attributes Name
type(fclCommandQ), intent(in) :: cmdq

Command Q with which to associate the allocated device memory

type(c_ptr), intent(out) :: hostPtr

c pointer to allocated host memory

integer(kind=c_int64_t), intent(in) :: nBytes

Desired array size in bytes

public module subroutine fclAllocHostPtr_2(hostPtr, nBytes)

Allocate a 'pinned' (non-paged) host array on default cmdq

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(out) :: hostPtr

c pointer to allocated host memory

integer(kind=c_int64_t), intent(in) :: nBytes

Desired array size in bytes

public module subroutine fclAllocHostInt32D1_1(cmdq, hostPtr, dim)

Allocate a 1D 'pinned' host array for 32bit integers

Arguments

Type IntentOptional Attributes Name
type(fclCommandQ), intent(in) :: cmdq

Command Q with which to associate the allocated device memory

integer(kind=c_int32_t), intent(inout), pointer :: hostPtr(:)

Host array pointer to allocate

integer, intent(in) :: dim

Size of array to allocate

public module subroutine fclAllocHostInt32D1_2(hostPtr, dim)

Allocate a 1D 'pinned' host array for 32bit integers on default cmdq

Arguments

Type IntentOptional Attributes Name
integer(kind=c_int32_t), intent(inout), pointer :: hostPtr(:)

Host array pointer to allocate

integer, intent(in) :: dim

Size of array to allocate

public module subroutine fclAllocHostFloatD1_1(cmdq, hostPtr, dim)

Allocate a 1D 'pinned' host array for 32bit reals

Arguments

Type IntentOptional Attributes Name
type(fclCommandQ), intent(in) :: cmdq

Command Q with which to associate the allocated device memory

real(kind=c_Float), intent(inout), pointer :: hostPtr(:)

Host array pointer to allocate

integer, intent(in) :: dim

Size of array to allocate

public module subroutine fclAllocHostFloatD1_2(hostPtr, dim)

Allocate a 1D 'pinned' host array for 32bit reals on default cmdq

Arguments

Type IntentOptional Attributes Name
real(kind=c_Float), intent(inout), pointer :: hostPtr(:)

Host array pointer to allocate

integer, intent(in) :: dim

Size of array to allocate

public module subroutine fclAllocHostDoubleD1_1(cmdq, hostPtr, dim)

Allocate a 1D 'pinned' host array for 64bit reals

Arguments

Type IntentOptional Attributes Name
type(fclCommandQ), intent(in) :: cmdq

Command Q with which to associate the allocated device memory

real(kind=c_Double), intent(inout), pointer :: hostPtr(:)

Host array pointer to allocate

integer, intent(in) :: dim

Size of array to allocate

public module subroutine fclAllocHostDoubleD1_2(hostPtr, dim)

Allocate a 1D 'pinned' host array for 64bit reals on default cmdq

Arguments

Type IntentOptional Attributes Name
real(kind=c_Double), intent(inout), pointer :: hostPtr(:)

Host array pointer to allocate

integer, intent(in) :: dim

Size of array to allocate