Changeset View
Changeset View
Standalone View
Standalone View
openmp/libomptarget/include/omptargetplugin.h
Show All 25 Lines | |||||
// Return an integer different from zero if the provided device image can be | // Return an integer different from zero if the provided device image can be | ||||
// supported by the runtime. The functionality is similar to comparing the | // supported by the runtime. The functionality is similar to comparing the | ||||
// result of __tgt__rtl__load__binary to NULL. However, this is meant to be a | // result of __tgt__rtl__load__binary to NULL. However, this is meant to be a | ||||
// lightweight query to determine if the RTL is suitable for an image without | // lightweight query to determine if the RTL is suitable for an image without | ||||
// having to load the library, which can be expensive. | // having to load the library, which can be expensive. | ||||
int32_t __tgt_rtl_is_valid_binary(__tgt_device_image *Image); | int32_t __tgt_rtl_is_valid_binary(__tgt_device_image *Image); | ||||
// Return an integer other than zero if the data can be exchaned from SrcDevId | |||||
// to DstDevId. If it is data exchangable, the device plugin should provide | |||||
// function to move data from source device to destination device directly. | |||||
int32_t __tgt_rtl_is_data_exchangable(int32_t SrcDevId, int32_t DstDevId); | |||||
// Initialize the requires flags for the device. | // Initialize the requires flags for the device. | ||||
int64_t __tgt_rtl_init_requires(int64_t RequiresFlags); | int64_t __tgt_rtl_init_requires(int64_t RequiresFlags); | ||||
// Initialize the specified device. In case of success return 0; otherwise | // Initialize the specified device. In case of success return 0; otherwise | ||||
// return an error code. | // return an error code. | ||||
int32_t __tgt_rtl_init_device(int32_t ID); | int32_t __tgt_rtl_init_device(int32_t ID); | ||||
// Pass an executable image section described by image to the specified | // Pass an executable image section described by image to the specified | ||||
Show All 30 Lines | |||||
int32_t __tgt_rtl_data_retrieve(int32_t ID, void *HostPtr, void *TargetPtr, | int32_t __tgt_rtl_data_retrieve(int32_t ID, void *HostPtr, void *TargetPtr, | ||||
int64_t Size); | int64_t Size); | ||||
// Asynchronous version of __tgt_rtl_data_retrieve | // Asynchronous version of __tgt_rtl_data_retrieve | ||||
int32_t __tgt_rtl_data_retrieve_async(int32_t ID, void *HostPtr, | int32_t __tgt_rtl_data_retrieve_async(int32_t ID, void *HostPtr, | ||||
void *TargetPtr, int64_t Size, | void *TargetPtr, int64_t Size, | ||||
__tgt_async_info *AsyncInfoPtr); | __tgt_async_info *AsyncInfoPtr); | ||||
// Copy the data content from one target device to another target device using | |||||
// its address. This operation does not need to copy data back to host and then | |||||
// from host to another device. In case of success, return zero. Otherwise, | |||||
// return an error code. | |||||
int32_t __tgt_rtl_data_exchange(int32_t SrcID, void *SrcPtr, int32_t DstID, | |||||
void *DstPtr, int64_t Size); | |||||
// Asynchronous version of __tgt_rtl_data_exchange | |||||
int32_t __tgt_rtl_data_exchange_async(int32_t SrcID, void *SrcPtr, | |||||
int32_t DesID, void *DstPtr, int64_t Size, | |||||
__tgt_async_info *AsyncInfoPtr); | |||||
// De-allocate the data referenced by target ptr on the device. In case of | // De-allocate the data referenced by target ptr on the device. In case of | ||||
// success, return zero. Otherwise, return an error code. | // success, return zero. Otherwise, return an error code. | ||||
int32_t __tgt_rtl_data_delete(int32_t ID, void *TargetPtr); | int32_t __tgt_rtl_data_delete(int32_t ID, void *TargetPtr); | ||||
// Transfer control to the offloaded entry Entry on the target device. | // Transfer control to the offloaded entry Entry on the target device. | ||||
// Args and Offsets are arrays of NumArgs size of target addresses and | // Args and Offsets are arrays of NumArgs size of target addresses and | ||||
// offsets. An offset should be added to the target address before passing it | // offsets. An offset should be added to the target address before passing it | ||||
// to the outlined function on device side. If AsyncInfoPtr is nullptr, it is | // to the outlined function on device side. If AsyncInfoPtr is nullptr, it is | ||||
Show All 36 Lines |