Commit 94767dac by Tom de Vries Committed by Tom de Vries

[libgomp, nvptx] Note that cuGetErrorString is in CUDA_VERSION >= 6000

Cuda driver api function cuGetErrorString is available in version 6.0 and
higher.

This patch:
- removes a comment saying the declaration is not available in cuda.h 6.0
- fixes the presence test to use CUDA_VERSION < 6000
- moves the declaration to toplevel

Build on x86_64 with nvptx accelerator and reg-tested libgomp.

2018-08-08  Tom de Vries  <tdevries@suse.de>

	* plugin/plugin-nvptx.c (cuda_error): Move declaration of cuGetErrorString ...
	(cuGetErrorString): ... here.  Guard with CUDA_VERSION < 6000.

From-SVN: r263405
parent dc878fea
2018-08-08 Tom de Vries <tdevries@suse.de>
* plugin/plugin-nvptx.c (cuda_error): Move declaration of cuGetErrorString ...
(cuGetErrorString): ... here. Guard with CUDA_VERSION < 6000.
2018-08-07 Tom de Vries <tdevries@suse.de> 2018-08-07 Tom de Vries <tdevries@suse.de>
* plugin/plugin-nvptx.c (DO_PRAGMA): Define. * plugin/plugin-nvptx.c (DO_PRAGMA): Define.
......
...@@ -49,6 +49,10 @@ ...@@ -49,6 +49,10 @@
#include <assert.h> #include <assert.h>
#include <errno.h> #include <errno.h>
#if CUDA_VERSION < 6000
extern CUresult cuGetErrorString (CUresult, const char **);
#endif
#define DO_PRAGMA(x) _Pragma (#x) #define DO_PRAGMA(x) _Pragma (#x)
#if PLUGIN_NVPTX_DYNAMIC #if PLUGIN_NVPTX_DYNAMIC
...@@ -156,11 +160,6 @@ init_cuda_lib (void) ...@@ -156,11 +160,6 @@ init_cuda_lib (void)
static const char * static const char *
cuda_error (CUresult r) cuda_error (CUresult r)
{ {
#if CUDA_VERSION < 7000
/* Specified in documentation and present in library from at least
5.5. Not declared in header file prior to 7.0. */
extern CUresult cuGetErrorString (CUresult, const char **);
#endif
const char *desc; const char *desc;
r = CUDA_CALL_NOCHECK (cuGetErrorString, r, &desc); r = CUDA_CALL_NOCHECK (cuGetErrorString, r, &desc);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment