summaryrefslogtreecommitdiff
path: root/liboffloadmic
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2015-08-24 17:10:06 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2015-08-24 17:10:06 +0000
commitd3d8e632f9a4073e705d3af98725f35356b9f7cb (patch)
tree139836bcec017a86c8257b2582f253251c7abb45 /liboffloadmic
parentb8c06a0670bcef3e57e397afa04afcc4965cd002 (diff)
downloadgcc-d3d8e632f9a4073e705d3af98725f35356b9f7cb.tar.gz
libgomp/
* libgomp.map: Add 4.0.2 version. * target.c (offload_image_descr): Add version field. (gomp_load_image_to_device): Add version argument. Adjust plugin call. Improve load mismatch diagnostic. (gomp_unload_image_from_device): Add version argument. Adjust plugin call. (GOMP_offload_regster): Make stub function, move bulk to ... (GOMP_offload_register_ver): ... here. Process version argument. (GOMP_offload_unregister): Make stub function, move bulk to ... (GOMP_offload_unregister_ver): ... here. Process version argument. (gomp_init_device): Process version field. (gomp_unload_device): Process version field. (gomp_load_plugin_for_device): Reimplement DLSYM & DLSYM_OPT macros. Check plugin version. * libgomp.h (gomp_device_descr): Add version function field. Adjust loader and unloader types. * oacc-host.c: Include gomp-constants.h. (host_version): New. (host_load_image, host_unload_image): Adjust. (host_dispatch): Add host_version. * plugin/plugin-nvptx.c: Include gomp-constants.h. (GOMP_OFFLOAD_version): New. (GOMP_OFFLOAD_load_image): Add version arg and check it. (GOMP_OFFLOAD_unload_image): Likewise. * plugin/plugin-host.c: Include gomp-constants.h. (GOMP_OFFLOAD_version): New. (GOMP_OFFLOAD_load_image): Add version arg. (GOMP_OFFLOAD_unload_image): Likewise. liboffloadmic/ * plugin/libgomp-plugin-intelmic.cpp (GOMP_OFFLOAD_version): New. (GOMP_OFFLOAD_load_image): Add version arg and check it. (GOMP_OFFLOAD_unload_image): Likewise. include/ * gomp-constants.h (GOMP_VERSION, GOMP_VERSION_NVIDIA_PTX, GOMP_VERSION_INTEL_MIC): New. (GOMP_VERSION_PACK, GOMP_VERSION_LIB, GOMP_VERSION_DEV): New. gcc/ * config/nvptx/mkoffload.c (process): Replace GOMP_offload_{,un}register with GOMP_offload_{,un}register_ver. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227137 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'liboffloadmic')
-rw-r--r--liboffloadmic/ChangeLog6
-rw-r--r--liboffloadmic/plugin/libgomp-plugin-intelmic.cpp24
2 files changed, 27 insertions, 3 deletions
diff --git a/liboffloadmic/ChangeLog b/liboffloadmic/ChangeLog
index 73c711587cb..67a3f6aee5d 100644
--- a/liboffloadmic/ChangeLog
+++ b/liboffloadmic/ChangeLog
@@ -1,3 +1,9 @@
+2015-08-24 Nathan Sidwell <nathan@codesourcery.com>
+
+ * plugin/libgomp-plugin-intelmic.cpp (GOMP_OFFLOAD_version): New.
+ (GOMP_OFFLOAD_load_image): Add version arg and check it.
+ (GOMP_OFFLOAD_unload_image): Likewise.
+
2015-08-24 Thomas Schwinge <thomas@codesourcery.com>
* plugin/Makefile.am (include_src_dir): Set.
diff --git a/liboffloadmic/plugin/libgomp-plugin-intelmic.cpp b/liboffloadmic/plugin/libgomp-plugin-intelmic.cpp
index aa2d7c69bcd..fde7d9e3820 100644
--- a/liboffloadmic/plugin/libgomp-plugin-intelmic.cpp
+++ b/liboffloadmic/plugin/libgomp-plugin-intelmic.cpp
@@ -328,12 +328,26 @@ offload_image (const void *target_image)
free (image);
}
+/* Return the libgomp version number we're compatible with. There is
+ no requirement for cross-version compatibility. */
+
+extern "C" unsigned
+GOMP_OFFLOAD_version (void)
+{
+ return GOMP_VERSION;
+}
+
extern "C" int
-GOMP_OFFLOAD_load_image (int device, const void *target_image,
- addr_pair **result)
+GOMP_OFFLOAD_load_image (int device, const unsigned version,
+ void *target_image, addr_pair **result)
{
TRACE ("(device = %d, target_image = %p)", device, target_image);
+ if (GOMP_VERSION_DEV (version) > GOMP_VERSION_INTEL_MIC)
+ GOMP_PLUGIN_fatal ("Offload data incompatible with intelmic plugin"
+ " (expected %u, received %u)",
+ GOMP_VERSION_INTEL_MIC, GOMP_VERSION_DEV (version));
+
/* If target_image is already present in address_table, then there is no need
to offload it. */
if (address_table->count (target_image) == 0)
@@ -354,8 +368,12 @@ GOMP_OFFLOAD_load_image (int device, const void *target_image,
}
extern "C" void
-GOMP_OFFLOAD_unload_image (int device, const void *target_image)
+GOMP_OFFLOAD_unload_image (int device, unsigned version,
+ const void *target_image)
{
+ if (GOMP_VERSION_DEV (version) > GOMP_VERSION_INTEL_MIC)
+ return;
+
TRACE ("(device = %d, target_image = %p)", device, target_image);
/* TODO: Currently liboffloadmic doesn't support __offload_unregister_image