diff options
author | tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-07-08 14:59:59 +0000 |
---|---|---|
committer | tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-07-08 14:59:59 +0000 |
commit | fe265ad3c9624da88f43be349137696449148f4f (patch) | |
tree | 49238907f42004f77228eb1e7c9ae4aa57f88eed /gcc/config/nvptx | |
parent | 9ba13af9db8cf5190b38e3d02c31fdad15c3dadd (diff) | |
download | gcc-fe265ad3c9624da88f43be349137696449148f4f.tar.gz |
[nvptx offloading] Only 64-bit configurations are currently supported
PR libgomp/65099
gcc/
* config/nvptx/mkoffload.c (main): Create an offload image only in
64-bit configurations.
libgomp/
* plugin/plugin-nvptx.c (nvptx_get_num_devices): Return 0 if not
in a 64-bit configuration.
* testsuite/libgomp.oacc-c++/c++.exp: Don't attempt nvidia
offloading testing if no such device is available.
* testsuite/libgomp.oacc-c/c.exp: Likewise.
* testsuite/libgomp.oacc-fortran/fortran.exp: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225560 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/nvptx')
-rw-r--r-- | gcc/config/nvptx/mkoffload.c | 56 |
1 files changed, 31 insertions, 25 deletions
diff --git a/gcc/config/nvptx/mkoffload.c b/gcc/config/nvptx/mkoffload.c index 8687154a1ac..8bc08bfeaeb 100644 --- a/gcc/config/nvptx/mkoffload.c +++ b/gcc/config/nvptx/mkoffload.c @@ -993,37 +993,43 @@ main (int argc, char **argv) obstack_ptr_grow (&argv_obstack, argv[ix]); } - ptx_name = make_temp_file (".mkoffload"); - obstack_ptr_grow (&argv_obstack, "-o"); - obstack_ptr_grow (&argv_obstack, ptx_name); - obstack_ptr_grow (&argv_obstack, NULL); - const char **new_argv = XOBFINISH (&argv_obstack, const char **); - - char *execpath = getenv ("GCC_EXEC_PREFIX"); - char *cpath = getenv ("COMPILER_PATH"); - char *lpath = getenv ("LIBRARY_PATH"); - unsetenv ("GCC_EXEC_PREFIX"); - unsetenv ("COMPILER_PATH"); - unsetenv ("LIBRARY_PATH"); - - fork_execute (new_argv[0], CONST_CAST (char **, new_argv), true); - obstack_free (&argv_obstack, NULL); - - xputenv (concat ("GCC_EXEC_PREFIX=", execpath, NULL)); - xputenv (concat ("COMPILER_PATH=", cpath, NULL)); - xputenv (concat ("LIBRARY_PATH=", lpath, NULL)); - - in = fopen (ptx_name, "r"); - if (!in) - fatal_error (input_location, "cannot open intermediate ptx file"); - ptx_cfile_name = make_temp_file (".c"); out = fopen (ptx_cfile_name, "w"); if (!out) fatal_error (input_location, "cannot open '%s'", ptx_cfile_name); - process (in, out); + /* PR libgomp/65099: Currently, we only support offloading in 64-bit + configurations. */ + if (!target_ilp32) + { + ptx_name = make_temp_file (".mkoffload"); + obstack_ptr_grow (&argv_obstack, "-o"); + obstack_ptr_grow (&argv_obstack, ptx_name); + obstack_ptr_grow (&argv_obstack, NULL); + const char **new_argv = XOBFINISH (&argv_obstack, const char **); + + char *execpath = getenv ("GCC_EXEC_PREFIX"); + char *cpath = getenv ("COMPILER_PATH"); + char *lpath = getenv ("LIBRARY_PATH"); + unsetenv ("GCC_EXEC_PREFIX"); + unsetenv ("COMPILER_PATH"); + unsetenv ("LIBRARY_PATH"); + + fork_execute (new_argv[0], CONST_CAST (char **, new_argv), true); + obstack_free (&argv_obstack, NULL); + + xputenv (concat ("GCC_EXEC_PREFIX=", execpath, NULL)); + xputenv (concat ("COMPILER_PATH=", cpath, NULL)); + xputenv (concat ("LIBRARY_PATH=", lpath, NULL)); + + in = fopen (ptx_name, "r"); + if (!in) + fatal_error (input_location, "cannot open intermediate ptx file"); + + process (in, out); + } + fclose (out); compile_native (ptx_cfile_name, outname, collect_gcc); |