configfrag.ac: For --without-cuda-driver don't initialize CUDA_DRIVER_INCLUDE nor...
authorJakub Jelinek <jakub@redhat.com>
Tue, 17 Jan 2017 09:44:17 +0000 (10:44 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 17 Jan 2017 09:44:17 +0000 (10:44 +0100)
commit2393d337e7c5ff258b1ad167025b9e4d5f518533
treeeaf913e6c721a84f592e444c942b624bbb14fe06
parent3c36aa6ba2be894d4092a6ce8129d39ef846c964
configfrag.ac: For --without-cuda-driver don't initialize CUDA_DRIVER_INCLUDE nor CUDA_DRIVER_LIB.

* plugin/configfrag.ac: For --without-cuda-driver don't initialize
CUDA_DRIVER_INCLUDE nor CUDA_DRIVER_LIB.  If both
CUDA_DRIVER_INCLUDE and CUDA_DRIVER_LIB are empty and linking small
cuda program fails, define PLUGIN_NVPTX_DYNAMIC to 1 and use
plugin/include/cuda as include dir and -ldl instead of -lcuda as
library to link ptx plugin against.
* plugin/plugin-nvptx.c: Include dlfcn.h if PLUGIN_NVPTX_DYNAMIC.
(CUDA_CALLS): Define.
(cuda_lib, cuda_lib_inited): New variables.
(init_cuda_lib): New function.
(CUDA_CALL_PREFIX): Define.
(CUDA_CALL_ERET, CUDA_CALL_ASSERT): Use CUDA_CALL_PREFIX.
(CUDA_CALL): Use FN instead of (FN).
(CUDA_CALL_NOCHECK): Define.
(cuda_error, fini_streams_for_device, select_stream_for_async,
nvptx_attach_host_thread_to_device, nvptx_open_device, link_ptx,
event_gc, nvptx_exec, nvptx_async_test, nvptx_async_test_all,
nvptx_wait_all, nvptx_set_clocktick, GOMP_OFFLOAD_unload_image,
nvptx_stacks_alloc, nvptx_stacks_free, GOMP_OFFLOAD_run): Use
CUDA_CALL_NOCHECK.
(nvptx_init): Call init_cuda_lib, if it fails, return false.  Use
CUDA_CALL_NOCHECK.
(nvptx_get_num_devices): Call init_cuda_lib, if it fails, return 0.
Use CUDA_CALL_NOCHECK.
* plugin/cuda/cuda.h: New file.
* config.h.in: Regenerated.
* configure: Regenerated.

From-SVN: r244522
libgomp/ChangeLog
libgomp/config.h.in
libgomp/configure
libgomp/plugin/configfrag.ac
libgomp/plugin/cuda/cuda.h [new file with mode: 0644]
libgomp/plugin/plugin-nvptx.c