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.
This is a blocking command. Execution waits on host until map is complete
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
Allocate a 'pinned' (non-paged) host array
Type | Intent | Optional | 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 |
Allocate a 'pinned' (non-paged) host array on default cmdq
Type | Intent | Optional | 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 |
Allocate a 1D 'pinned' host array for 32bit integers
Type | Intent | Optional | 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 |
Allocate a 1D 'pinned' host array for 32bit integers on default cmdq
Type | Intent | Optional | 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 |
Allocate a 1D 'pinned' host array for 32bit reals
Type | Intent | Optional | 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 |
Allocate a 1D 'pinned' host array for 32bit reals on default cmdq
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=c_Float), | intent(inout), | pointer | :: | hostPtr(:) |
Host array pointer to allocate |
|
integer, | intent(in) | :: | dim |
Size of array to allocate |
Allocate a 1D 'pinned' host array for 64bit reals
Type | Intent | Optional | 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 |
Allocate a 1D 'pinned' host array for 64bit reals on default cmdq
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=c_Double), | intent(inout), | pointer | :: | hostPtr(:) |
Host array pointer to allocate |
|
integer, | intent(in) | :: | dim |
Size of array to allocate |