loki.transformations.field_api
A set of utility classes for dealing with FIELD API boilerplate in parallel kernels and offload regions.
Functions
|
Utility function to generate a |
|
Utility function to generate a |
Returns the corresponding FIELD API type for an array. |
Classes
|
|
|
Helper class to map FIELD API pointers to intents and access descriptors. |
- class FieldAPITransferType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
Enum- READ_ONLY = 1
- READ_WRITE = 2
- WRITE_ONLY = 3
- class FieldPointerMap(inargs, inoutargs, outargs, scope, ptr_prefix='loki_ptr_')
Bases:
objectHelper class to map FIELD API pointers to intents and access descriptors.
This utility is used to store arrays passed to target kernel calls and easily access corresponding device pointers added by the transformation.
- dataptr_from_array(a: Array)
Returns a contiguous pointer
Variablewith types matching the arraya.
- static field_ptr_from_view(field_view)
Returns a symbol for the pointer to the corresponding Field object.
- property args
A tuple of all argument symbols, concatanating in/inout/out arguments
- property dataptrs
Create a list of contiguous data pointer symbols
- property host_to_device_calls
Returns a tuple of
CallStatementfor host-to-device transfers on fields.
- property sync_host_calls
Returns a tuple of
CallStatementfor host-synchronization transfers on fields.
- get_field_type(a: Array) DerivedType
Returns the corresponding FIELD API type for an array.
This function is IFS specific and assumes that the type is an array declared with one of the IFS type specifiers, e.g. KIND=JPRB
- field_get_device_data(field_ptr, dev_ptr, transfer_type: FieldAPITransferType, scope: Scope)
Utility function to generate a
CallStatementcorresponding to a Field APIGET_DEVICE_DATAcall.- Parameters:
field_ptr (pointer to field object) – Pointer to the field to call
GET_DEVICE_DATAfrom.dev_ptr (
Array) – Device pointer arraytransfer_type (
FieldAPITransferType) – Field API transfer type to determine whichGET_DEVICE_DATAmethod to call.scope (
Scope) – Scope of the createdCallStatement
- field_sync_host(field_ptr, scope)
Utility function to generate a
CallStatementcorresponding to a Field APISYNC_HOSTcall.- Parameters:
field_ptr (pointer to field object) – Pointer to the field to call
SYNC_HOSTfrom.scope (
Scope) – Scope of the createdCallStatement