gcc/libgomp/plugin
Tom de Vries c0e9cee285 [libgomp, nvptx] Print error log for link error
By running libgomp test-case libgomp.c/target-28.c with GOMP_NVPTX_PTXRW=w
(using a maintenance patch that adds support for this env var), we dump the
ptx in target-28.exe to file.  By editing one ptx file to rename
gomp_nvptx_main to gomp_nvptx_main2 in both declaration and call, and
running with GOMP_NVPTX_PTXRW=r, we trigger a link error:
...
$ GOMP_NVPTX_PTXRW=r ./target-28.exe
libgomp: cuLinkComplete error: unknown error
...
The error is somewhat uninformative.

Fix this by dumping the error log returned by the failing cuda call, such
that we have instead:
...
$ GOMP_NVPTX_PTXRW=r ./target-28.exe
libgomp: Link error log error   : \
  Undefined reference to 'gomp_nvptx_main2' in ''
libgomp: cuLinkComplete error: unknown error
...

Build on x86_64 with nvptx accelerator, tested libgomp.

libgomp/ChangeLog:

	* plugin/plugin-nvptx.c (link_ptx): Print elog if cuLinkComplete call
	fails.
2020-09-22 13:38:00 +02:00
..
cuda Update copyright years. 2020-01-01 12:51:42 +01:00
configfrag.ac Removal of HSA offloading from gcc and libgomp 2020-08-03 18:13:00 +02:00
cuda-lib.def Add OpenACC 2.6 `acc_get_property' support 2019-12-22 19:54:09 +00:00
Makefrag.am Removal of HSA offloading from gcc and libgomp 2020-08-03 18:13:00 +02:00
plugin-gcn.c amdgcn: Switch to HSACO v3 binary format 2020-06-17 10:06:21 +01:00
plugin-nvptx.c [libgomp, nvptx] Print error log for link error 2020-09-22 13:38:00 +02:00