extern bool GOMP_OFFLOAD_fini_device (int);
extern unsigned GOMP_OFFLOAD_version (void);
extern int GOMP_OFFLOAD_load_image (int, unsigned, const void *,
- struct addr_pair **);
+ struct addr_pair **, uint64_t **);
extern bool GOMP_OFFLOAD_unload_image (int, unsigned, const void *);
extern void *GOMP_OFFLOAD_alloc (int, size_t);
extern bool GOMP_OFFLOAD_free (int, void *);
host_load_image (int n __attribute__ ((unused)),
unsigned v __attribute__ ((unused)),
const void *t __attribute__ ((unused)),
- struct addr_pair **r __attribute__ ((unused)))
+ struct addr_pair **r __attribute__ ((unused)),
+ uint64_t **f __attribute__ ((unused)))
{
return 0;
}
/* Load GCN object-code module described by struct gcn_image_desc in
TARGET_DATA and return references to kernel descriptors in TARGET_TABLE.
- If there are any constructors then run them. */
+ If there are any constructors then run them. If not NULL, REV_FN_TABLE will
+ contain the on-device addresses of the functions for reverse offload. To be
+ freed by the caller. */
int
GOMP_OFFLOAD_load_image (int ord, unsigned version, const void *target_data,
- struct addr_pair **target_table)
+ struct addr_pair **target_table,
+ uint64_t **rev_fn_table __attribute__((unused)))
{
if (GOMP_VERSION_DEV (version) != GOMP_VERSION_GCN)
{
}
/* Load the (partial) program described by TARGET_DATA to device
- number ORD. Allocate and return TARGET_TABLE. */
+ number ORD. Allocate and return TARGET_TABLE. If not NULL, REV_FN_TABLE
+ will contain the on-device addresses of the functions for reverse offload.
+ To be freed by the caller. */
int
GOMP_OFFLOAD_load_image (int ord, unsigned version, const void *target_data,
- struct addr_pair **target_table)
+ struct addr_pair **target_table,
+ uint64_t **rev_fn_table __attribute__((unused)))
{
CUmodule module;
const char *const *var_names;
num_target_entries
= devicep->load_image_func (devicep->target_id, version,
- target_data, &target_table);
+ target_data, &target_table, NULL);
if (num_target_entries != num_funcs + num_vars
/* "+1" due to the additional ICV struct. */
extern "C" int
GOMP_OFFLOAD_load_image (int device, const unsigned version,
- const void *target_image, addr_pair **result)
+ const void *target_image, addr_pair **result,
+ uint64_t ** /* rev_fn_table */)
{
TRACE ("(device = %d, target_image = %p)", device, target_image);