]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
nvptx plugin: do not force JIT target SM version
authorAlexander Monakov <amonakov@ispras.ru>
Mon, 11 Jan 2016 12:55:31 +0000 (15:55 +0300)
committerAlexander Monakov <amonakov@gcc.gnu.org>
Mon, 11 Jan 2016 12:55:31 +0000 (15:55 +0300)
When link_ptx runs, a CUDA device is already bound to current thread, so the
driver library knows the target architecture.  There isn't any benefit from
forcing a specific target here; on the contrary, hardcoding sm_30 breaks
offloading on later (Maxwell, sm_5x) devices.

* plugin/plugin-nvptx.c (link_ptx): Do not set CU_JIT_TARGET.

From-SVN: r232227

libgomp/ChangeLog
libgomp/plugin/plugin-nvptx.c

index dbe181549c3084c11005cce0abc346eb98b45cc3..e2117259a11857446c7f6ccf369eb5ee645633ff 100644 (file)
@@ -1,3 +1,7 @@
+2016-01-11  Alexander Monakov  <amonakov@ispras.ru>
+
+       * plugin/plugin-nvptx.c (link_ptx): Do not set CU_JIT_TARGET.
+
 2016-01-07  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR fortran/66680
index 0618425806762bcb946450e8f183a225c013fbbe..7ec1810a0468821f66de637739aa865b345d87b1 100644 (file)
@@ -712,8 +712,8 @@ static void
 link_ptx (CUmodule *module, const struct targ_ptx_obj *ptx_objs,
          unsigned num_objs)
 {
-  CUjit_option opts[7];
-  void *optvals[7];
+  CUjit_option opts[6];
+  void *optvals[6];
   float elapsed = 0.0;
 #define LOGSIZE 8192
   char elog[LOGSIZE];
@@ -742,10 +742,7 @@ link_ptx (CUmodule *module, const struct targ_ptx_obj *ptx_objs,
   opts[5] = CU_JIT_LOG_VERBOSE;
   optvals[5] = (void *) 1;
 
-  opts[6] = CU_JIT_TARGET;
-  optvals[6] = (void *) CU_TARGET_COMPUTE_30;
-
-  r = cuLinkCreate (7, opts, optvals, &linkstate);
+  r = cuLinkCreate (6, opts, optvals, &linkstate);
   if (r != CUDA_SUCCESS)
     GOMP_PLUGIN_fatal ("cuLinkCreate error: %s", cuda_error (r));