Already mentioned here ( https://gcc.gnu.org/ml/gcc-patches/2016-11/msg00972.html ): ... With OpenMP/PTX offloading there are 5 additional failures in check-target-libgomp: <SNIP> Two with 'target nowait' (not implemented) FAIL: libgomp.c/target-33.c execution test FAIL: libgomp.c/target-34.c execution test ...
These tests pass on gomp-4_0-branch, because there GOMP_OFFLOAD_get_caps does not return GOMP_OFFLOAD_CAP_OPENMP_400, while on trunk it does.
Created attachment 42484 [details] Patch that moves async_run from plugin-hsa.c to default_sync_run I wonder if this will work.
(In reply to Tom de Vries from comment #3) > Created attachment 42484 [details] > Patch that moves async_run from plugin-hsa.c to default_sync_run > > I wonder if this will work. That got me this error for target-33.c: ... libgomp: libgomp: cuMemAlloc error: invalid device context cuMemAlloc error: invalid device context libgomp: cuCtxPushCurrent_v2 error: unknown cuda error libgomp: device finalization failed ... Using this patch in addition, both target-33.c and target34.c pass: ... diff --git a/libgomp/plugin/plugin-nvptx.c b/libgomp/plugin/plugin-nvptx.c index d5262639578..4e0009f650e 100644 --- a/libgomp/plugin/plugin-nvptx.c +++ b/libgomp/plugin/plugin-nvptx.c @@ -2127,6 +2127,8 @@ GOMP_OFFLOAD_run (int ord, void *tgt_fn, void *tgt_vars, void **args) const char *maybe_abort_msg = "(perhaps abort was called)"; int teams = 0, threads = 0; + nvptx_attach_host_thread_to_device (ord); + if (!args) GOMP_PLUGIN_fatal ("No target arguments provided"); while (*args) ...
patch submitted: https://gcc.gnu.org/ml/gcc-patches/2017-10/msg02079.html
This no longer fails at current trunk.