Changeset View
Changeset View
Standalone View
Standalone View
openmp/libomptarget/src/rtl.h
Show All 24 Lines | |||||
struct __tgt_bin_desc; | struct __tgt_bin_desc; | ||||
struct RTLInfoTy { | struct RTLInfoTy { | ||||
typedef int32_t(is_valid_binary_ty)(void *); | typedef int32_t(is_valid_binary_ty)(void *); | ||||
typedef int32_t(number_of_devices_ty)(); | typedef int32_t(number_of_devices_ty)(); | ||||
typedef int32_t(init_device_ty)(int32_t); | typedef int32_t(init_device_ty)(int32_t); | ||||
typedef __tgt_target_table *(load_binary_ty)(int32_t, void *); | typedef __tgt_target_table *(load_binary_ty)(int32_t, void *); | ||||
typedef void *(data_alloc_ty)(int32_t, int64_t, void *); | typedef void *(data_alloc_ty)(int32_t, int64_t, void *); | ||||
typedef int32_t(data_submit_ty)(int32_t, void *, void *, int64_t); | typedef int32_t(data_submit_ty)(int32_t, void *, void *, int64_t, | ||||
typedef int32_t(data_retrieve_ty)(int32_t, void *, void *, int64_t); | __tgt_async_info *); | ||||
typedef int32_t(data_retrieve_ty)(int32_t, void *, void *, int64_t, | |||||
__tgt_async_info *); | |||||
typedef int32_t(data_delete_ty)(int32_t, void *); | typedef int32_t(data_delete_ty)(int32_t, void *); | ||||
typedef int32_t(run_region_ty)(int32_t, void *, void **, ptrdiff_t *, | typedef int32_t(run_region_ty)(int32_t, void *, void **, ptrdiff_t *, int32_t, | ||||
int32_t); | __tgt_async_info *); | ||||
jdoerfert: Similar to my last comment, why do we need async versions here? Let them be the default (w/o… | |||||
typedef int32_t(run_team_region_ty)(int32_t, void *, void **, ptrdiff_t *, | typedef int32_t(run_team_region_ty)(int32_t, void *, void **, ptrdiff_t *, | ||||
int32_t, int32_t, int32_t, uint64_t); | int32_t, int32_t, int32_t, uint64_t, | ||||
__tgt_async_info *); | |||||
typedef int64_t(init_requires_ty)(int64_t); | typedef int64_t(init_requires_ty)(int64_t); | ||||
typedef int64_t(synchronize_ty)(int64_t, __tgt_async_info *); | |||||
int32_t Idx = -1; // RTL index, index is the number of devices | int32_t Idx = -1; // RTL index, index is the number of devices | ||||
// of other RTLs that were registered before, | // of other RTLs that were registered before, | ||||
// i.e. the OpenMP index of the first device | // i.e. the OpenMP index of the first device | ||||
// to be registered with this RTL. | // to be registered with this RTL. | ||||
int32_t NumberOfDevices = -1; // Number of devices this RTL deals with. | int32_t NumberOfDevices = -1; // Number of devices this RTL deals with. | ||||
void *LibraryHandler = nullptr; | void *LibraryHandler = nullptr; | ||||
Show All 9 Lines | #endif | ||||
load_binary_ty *load_binary = nullptr; | load_binary_ty *load_binary = nullptr; | ||||
data_alloc_ty *data_alloc = nullptr; | data_alloc_ty *data_alloc = nullptr; | ||||
data_submit_ty *data_submit = nullptr; | data_submit_ty *data_submit = nullptr; | ||||
data_retrieve_ty *data_retrieve = nullptr; | data_retrieve_ty *data_retrieve = nullptr; | ||||
data_delete_ty *data_delete = nullptr; | data_delete_ty *data_delete = nullptr; | ||||
run_region_ty *run_region = nullptr; | run_region_ty *run_region = nullptr; | ||||
run_team_region_ty *run_team_region = nullptr; | run_team_region_ty *run_team_region = nullptr; | ||||
init_requires_ty *init_requires = nullptr; | init_requires_ty *init_requires = nullptr; | ||||
synchronize_ty *synchronize = nullptr; | |||||
// Are there images associated with this RTL. | // Are there images associated with this RTL. | ||||
bool isUsed = false; | bool isUsed = false; | ||||
// Mutex for thread-safety when calling RTL interface functions. | // Mutex for thread-safety when calling RTL interface functions. | ||||
// It is easier to enforce thread-safety at the libomptarget level, | // It is easier to enforce thread-safety at the libomptarget level, | ||||
// so that developers of new RTLs do not have to worry about it. | // so that developers of new RTLs do not have to worry about it. | ||||
std::mutex Mtx; | std::mutex Mtx; | ||||
Show All 16 Lines | #endif | ||||
data_alloc = r.data_alloc; | data_alloc = r.data_alloc; | ||||
data_submit = r.data_submit; | data_submit = r.data_submit; | ||||
data_retrieve = r.data_retrieve; | data_retrieve = r.data_retrieve; | ||||
data_delete = r.data_delete; | data_delete = r.data_delete; | ||||
run_region = r.run_region; | run_region = r.run_region; | ||||
run_team_region = r.run_team_region; | run_team_region = r.run_team_region; | ||||
init_requires = r.init_requires; | init_requires = r.init_requires; | ||||
isUsed = r.isUsed; | isUsed = r.isUsed; | ||||
synchronize = r.synchronize; | |||||
} | } | ||||
}; | }; | ||||
/// RTLs identified in the system. | /// RTLs identified in the system. | ||||
class RTLsTy { | class RTLsTy { | ||||
private: | private: | ||||
// Mutex-like object to guarantee thread-safety and unique initialization | // Mutex-like object to guarantee thread-safety and unique initialization | ||||
// (i.e. the library attempts to load the RTLs (plugins) only once). | // (i.e. the library attempts to load the RTLs (plugins) only once). | ||||
▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines |
Similar to my last comment, why do we need async versions here? Let them be the default (w/o the _async).