diff options
author | Martin Liska <mliska@suse.cz> | 2016-11-23 13:27:13 +0100 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2016-11-23 13:27:13 +0100 |
commit | b8d89b03db5f212919e4571671ebb4f5f8b1e19d (patch) | |
tree | ca8d3a25bea7a0869227ad33aafc39ca9eff7e0e /libgomp/configure | |
parent | 3615816da830d41f67a5d8955ae588eba7f0b6fb (diff) | |
download | gcc-b8d89b03db5f212919e4571671ebb4f5f8b1e19d.zip gcc-b8d89b03db5f212919e4571671ebb4f5f8b1e19d.tar.gz gcc-b8d89b03db5f212919e4571671ebb4f5f8b1e19d.tar.bz2 |
Remove build dependence on HSA run-time
2016-11-23 Martin Liska <mliska@suse.cz>
Martin Jambor <mjambor@suse.cz>
gcc/
* doc/install.texi: Remove entry about --with-hsa-kmt-lib.
libgomp/
* plugin/hsa.h: New file.
* plugin/hsa_ext_finalize.h: New file.
* plugin/configfrag.ac: Remove hsa-kmt-lib test. Added checks for
header file unistd.h, and functions secure_getenv, __secure_getenv,
getuid, geteuid, getgid and getegid.
* plugin/Makefrag.am (libgomp_plugin_hsa_la_CPPFLAGS): Added
-D_GNU_SOURCE.
* plugin/plugin-hsa.c: Include config.h, inttypes.h and stdbool.h.
Handle various cases of secure_getenv presence, add an implementation
when we can test effective UID and GID.
(struct hsa_runtime_fn_info): New structure.
(hsa_runtime_fn_info hsa_fns): New variable.
(hsa_runtime_lib): Likewise.
(support_cpu_devices): Likewise.
(init_enviroment_variables): Load newly introduced ENV
variables.
(hsa_warn): Call hsa run-time functions via hsa_fns structure.
(hsa_fatal): Likewise.
(DLSYM_FN): New macro.
(init_hsa_runtime_functions): New function.
(suitable_hsa_agent_p): Call hsa run-time functions via hsa_fns
structure. Depending on environment, also allow CPU devices.
(init_hsa_context): Call hsa run-time functions via hsa_fns structure.
(get_kernarg_memory_region): Likewise.
(GOMP_OFFLOAD_init_device): Likewise.
(destroy_hsa_program): Likewise.
(init_basic_kernel_info): New function.
(GOMP_OFFLOAD_load_image): Use it.
(create_and_finalize_hsa_program): Call hsa run-time functions via
hsa_fns structure.
(create_single_kernel_dispatch): Likewise.
(release_kernel_dispatch): Likewise.
(init_single_kernel): Likewise.
(parse_target_attributes): Allow up multiple HSA grid dimensions.
(get_group_size): New function.
(run_kernel): Likewise.
(GOMP_OFFLOAD_run): Outline most functionality to run_kernel.
(GOMP_OFFLOAD_fini_device): Call hsa run-time functions via hsa_fns
structure.
* testsuite/lib/libgomp.exp: Remove hsa_kmt_lib support.
* testsuite/libgomp-test-support.exp.in: Likewise.
* Makefile.in: Regenerated.
* aclocal.m4: Likewise.
* config.h.in: Likewise.
* configure: Likewise.
* testsuite/Makefile.in: Likewise.
Co-Authored-By: Martin Jambor <mjambor@suse.cz>
From-SVN: r242749
Diffstat (limited to 'libgomp/configure')
-rwxr-xr-x | libgomp/configure | 129 |
1 files changed, 80 insertions, 49 deletions
diff --git a/libgomp/configure b/libgomp/configure index 52377ba..d369320 100755 --- a/libgomp/configure +++ b/libgomp/configure @@ -597,6 +597,8 @@ ac_includes_default="\ # include <unistd.h> #endif" +ac_header_list= +ac_func_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS @@ -637,7 +639,6 @@ PLUGIN_HSA_LIBS PLUGIN_HSA_LDFLAGS PLUGIN_HSA_CPPFLAGS PLUGIN_HSA -HSA_KMT_LIB HSA_RUNTIME_LIB HSA_RUNTIME_INCLUDE PLUGIN_NVPTX_LIBS @@ -682,7 +683,6 @@ AR am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE -am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE @@ -794,7 +794,6 @@ with_cuda_driver_lib with_hsa_runtime with_hsa_runtime_include with_hsa_runtime_lib -with_hsa_kmt_lib enable_linux_futex enable_tls enable_symvers @@ -1476,7 +1475,6 @@ Optional Packages: --with-hsa-runtime-lib=PATH specify directory for the installed HSA run-time library - --with-hsa-kmt-lib=PATH specify directory for installed HSA KMT library. Some influential environment variables: CC C compiler command @@ -2518,6 +2516,13 @@ $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi +as_fn_append ac_header_list " unistd.h" +as_fn_append ac_func_list " secure_getenv" +as_fn_append ac_func_list " __secure_getenv" +as_fn_append ac_func_list " getuid" +as_fn_append ac_func_list " geteuid" +as_fn_append ac_func_list " getgid" +as_fn_append ac_func_list " getegid" # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false @@ -3280,11 +3285,11 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. -# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AMTAR='$${TAR-tar}' +# Always define AMTAR for backward compatibility. -am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' @@ -4182,7 +4187,6 @@ fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' - am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= @@ -4207,7 +4211,6 @@ else # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. - rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -4267,7 +4270,7 @@ else break fi ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) + msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. @@ -11145,7 +11148,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11148 "configure" +#line 11151 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11251,7 +11254,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11254 "configure" +#line 11257 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15198,6 +15201,57 @@ elif test "x${enable_offload_targets-no}" != xno; then as_fn_error "Can't support offloading without support for plugins" "$LINENO" 5 fi + + + for ac_header in $ac_header_list +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + + + for ac_func in $ac_func_list +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + + + + + + + + + + + + + # Look for the CUDA driver package. CUDA_DRIVER_INCLUDE= CUDA_DRIVER_LIB= @@ -15293,22 +15347,6 @@ if test "x$HSA_RUNTIME_LIB" != x; then HSA_RUNTIME_LDFLAGS=-L$HSA_RUNTIME_LIB fi -HSA_KMT_LIB= - -HSA_KMT_LDFLAGS= - -# Check whether --with-hsa-kmt-lib was given. -if test "${with_hsa_kmt_lib+set}" = set; then : - withval=$with_hsa_kmt_lib; -fi - -if test "x$with_hsa_kmt_lib" != x; then - HSA_KMT_LIB=$with_hsa_kmt_lib -fi -if test "x$HSA_KMT_LIB" != x; then - HSA_KMT_LDFLAGS=-L$HSA_KMT_LIB -fi - PLUGIN_HSA=0 PLUGIN_HSA_CPPFLAGS= PLUGIN_HSA_LDFLAGS= @@ -15318,8 +15356,6 @@ PLUGIN_HSA_LIBS= - - # Get offload targets and path to install tree of offloading compiler. offload_additional_options= offload_additional_lib_paths= @@ -15384,8 +15420,8 @@ rm -f core conftest.err conftest.$ac_objext \ tgt_name=hsa PLUGIN_HSA=$tgt PLUGIN_HSA_CPPFLAGS=$HSA_RUNTIME_CPPFLAGS - PLUGIN_HSA_LDFLAGS="$HSA_RUNTIME_LDFLAGS $HSA_KMT_LDFLAGS" - PLUGIN_HSA_LIBS="-lhsa-runtime64 -lhsakmt" + PLUGIN_HSA_LDFLAGS="$HSA_RUNTIME_LDFLAGS" + PLUGIN_HSA_LIBS="-ldl" PLUGIN_HSA_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$PLUGIN_HSA_CPPFLAGS $CPPFLAGS" @@ -15394,22 +15430,7 @@ rm -f core conftest.err conftest.$ac_objext \ PLUGIN_HSA_save_LIBS=$LIBS LIBS="$PLUGIN_HSA_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include "hsa.h" -int -main () -{ -hsa_status_t status = hsa_init () - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - PLUGIN_HSA=1 -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + PLUGIN_HSA=1 CPPFLAGS=$PLUGIN_HSA_save_CPPFLAGS LDFLAGS=$PLUGIN_HSA_save_LDFLAGS LIBS=$PLUGIN_HSA_save_LIBS @@ -15484,6 +15505,16 @@ cat >>confdefs.h <<_ACEOF _ACEOF +if test "$HSA_RUNTIME_LIB" != ""; then + HSA_RUNTIME_LIB="$HSA_RUNTIME_LIB/" +fi + + +cat >>confdefs.h <<_ACEOF +#define HSA_RUNTIME_LIB "$HSA_RUNTIME_LIB" +_ACEOF + + # Check for functions needed. for ac_func in getloadavg clock_gettime strtoull |