Commit b8d89b03 by Martin Liska Committed by Martin Jambor

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
parent 3615816d
2016-11-23 Martin Liska <mliska@suse.cz>
Martin Jambor <mjambor@suse.cz>
* doc/install.texi: Remove entry about --with-hsa-kmt-lib.
2016-11-23 Aldy Hernandez <aldyh@redhat.com> 2016-11-23 Aldy Hernandez <aldyh@redhat.com>
PR target/78213 PR target/78213
...@@ -2035,12 +2035,6 @@ explicitly specify the directory where they are installed. The ...@@ -2035,12 +2035,6 @@ explicitly specify the directory where they are installed. The
shorthand for shorthand for
@option{--with-hsa-runtime-lib=@/@var{hsainstalldir}/lib} and @option{--with-hsa-runtime-lib=@/@var{hsainstalldir}/lib} and
@option{--with-hsa-runtime-include=@/@var{hsainstalldir}/include}. @option{--with-hsa-runtime-include=@/@var{hsainstalldir}/include}.
@item --with-hsa-kmt-lib=@var{pathname}
If you configure GCC with HSA offloading but do not have the HSA
KMT library installed in a standard location then you can
explicitly specify the directory where it resides.
@end table @end table
@subheading Cross-Compiler-Specific Options @subheading Cross-Compiler-Specific Options
......
2016-11-23 Martin Liska <mliska@suse.cz>
Martin Jambor <mjambor@suse.cz>
* 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.
2016-11-15 Martin Jambor <mjambor@suse.cz> 2016-11-15 Martin Jambor <mjambor@suse.cz>
Alexander Monakov <amonakov@ispras.ru> Alexander Monakov <amonakov@ispras.ru>
......
...@@ -24,9 +24,21 @@ ...@@ -24,9 +24,21 @@
/* Define to 1 if you have the <dlfcn.h> header file. */ /* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H #undef HAVE_DLFCN_H
/* Define to 1 if you have the `getegid' function. */
#undef HAVE_GETEGID
/* Define to 1 if you have the `geteuid' function. */
#undef HAVE_GETEUID
/* Define to 1 if you have the `getgid' function. */
#undef HAVE_GETGID
/* Define to 1 if you have the `getloadavg' function. */ /* Define to 1 if you have the `getloadavg' function. */
#undef HAVE_GETLOADAVG #undef HAVE_GETLOADAVG
/* Define to 1 if you have the `getuid' function. */
#undef HAVE_GETUID
/* Define to 1 if you have the <inttypes.h> header file. */ /* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H #undef HAVE_INTTYPES_H
...@@ -42,6 +54,9 @@ ...@@ -42,6 +54,9 @@
/* Define to 1 if you have the <pthread.h> header file. */ /* Define to 1 if you have the <pthread.h> header file. */
#undef HAVE_PTHREAD_H #undef HAVE_PTHREAD_H
/* Define to 1 if you have the `secure_getenv' function. */
#undef HAVE_SECURE_GETENV
/* Define to 1 if you have the <semaphore.h> header file. */ /* Define to 1 if you have the <semaphore.h> header file. */
#undef HAVE_SEMAPHORE_H #undef HAVE_SEMAPHORE_H
...@@ -91,6 +106,12 @@ ...@@ -91,6 +106,12 @@
/* Define to 1 if you have the <unistd.h> header file. */ /* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H #undef HAVE_UNISTD_H
/* Define to 1 if you have the `__secure_getenv' function. */
#undef HAVE___SECURE_GETENV
/* Define path to HSA runtime. */
#undef HSA_RUNTIME_LIB
/* Define to 1 if GNU symbol versioning is used for libgomp. */ /* Define to 1 if GNU symbol versioning is used for libgomp. */
#undef LIBGOMP_GNU_SYMBOL_VERSIONING #undef LIBGOMP_GNU_SYMBOL_VERSIONING
......
...@@ -597,6 +597,8 @@ ac_includes_default="\ ...@@ -597,6 +597,8 @@ ac_includes_default="\
# include <unistd.h> # include <unistd.h>
#endif" #endif"
ac_header_list=
ac_func_list=
ac_subst_vars='am__EXEEXT_FALSE ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE am__EXEEXT_TRUE
LTLIBOBJS LTLIBOBJS
...@@ -637,7 +639,6 @@ PLUGIN_HSA_LIBS ...@@ -637,7 +639,6 @@ PLUGIN_HSA_LIBS
PLUGIN_HSA_LDFLAGS PLUGIN_HSA_LDFLAGS
PLUGIN_HSA_CPPFLAGS PLUGIN_HSA_CPPFLAGS
PLUGIN_HSA PLUGIN_HSA
HSA_KMT_LIB
HSA_RUNTIME_LIB HSA_RUNTIME_LIB
HSA_RUNTIME_INCLUDE HSA_RUNTIME_INCLUDE
PLUGIN_NVPTX_LIBS PLUGIN_NVPTX_LIBS
...@@ -682,7 +683,6 @@ AR ...@@ -682,7 +683,6 @@ AR
am__fastdepCC_FALSE am__fastdepCC_FALSE
am__fastdepCC_TRUE am__fastdepCC_TRUE
CCDEPMODE CCDEPMODE
am__nodep
AMDEPBACKSLASH AMDEPBACKSLASH
AMDEP_FALSE AMDEP_FALSE
AMDEP_TRUE AMDEP_TRUE
...@@ -794,7 +794,6 @@ with_cuda_driver_lib ...@@ -794,7 +794,6 @@ with_cuda_driver_lib
with_hsa_runtime with_hsa_runtime
with_hsa_runtime_include with_hsa_runtime_include
with_hsa_runtime_lib with_hsa_runtime_lib
with_hsa_kmt_lib
enable_linux_futex enable_linux_futex
enable_tls enable_tls
enable_symvers enable_symvers
...@@ -1476,7 +1475,6 @@ Optional Packages: ...@@ -1476,7 +1475,6 @@ Optional Packages:
--with-hsa-runtime-lib=PATH --with-hsa-runtime-lib=PATH
specify directory for the installed HSA run-time specify directory for the installed HSA run-time
library library
--with-hsa-kmt-lib=PATH specify directory for installed HSA KMT library.
Some influential environment variables: Some influential environment variables:
CC C compiler command CC C compiler command
...@@ -2518,6 +2516,13 @@ $as_echo "$as_me: creating cache $cache_file" >&6;} ...@@ -2518,6 +2516,13 @@ $as_echo "$as_me: creating cache $cache_file" >&6;}
>$cache_file >$cache_file
fi 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 # Check that the precious variables saved in the cache have kept the same
# value. # value.
ac_cache_corrupted=false ac_cache_corrupted=false
...@@ -3280,11 +3285,11 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} ...@@ -3280,11 +3285,11 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
# We need awk for the "check" target. The system "awk" is bad on # We need awk for the "check" target. The system "awk" is bad on
# some platforms. # some platforms.
# Always define AMTAR for backward compatibility. Yes, it's still used # Always define AMTAR for backward compatibility.
# in the wild :-( We should find a proper way to deprecate it ...
AMTAR='$${TAR-tar}'
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 ...@@ -4182,7 +4187,6 @@ fi
if test "x$enable_dependency_tracking" != xno; then if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp" am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\' AMDEPBACKSLASH='\'
am__nodep='_no'
fi fi
if test "x$enable_dependency_tracking" != xno; then if test "x$enable_dependency_tracking" != xno; then
AMDEP_TRUE= AMDEP_TRUE=
...@@ -4207,7 +4211,6 @@ else ...@@ -4207,7 +4211,6 @@ else
# instance it was reported that on HP-UX the gcc test will end up # 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 # making a dummy file named `D' -- because `-MD' means `put the output
# in D'. # in D'.
rm -rf conftest.dir
mkdir conftest.dir mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're # Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory. # using a relative directory.
...@@ -4267,7 +4270,7 @@ else ...@@ -4267,7 +4270,7 @@ else
break break
fi fi
;; ;;
msvc7 | msvc7msys | msvisualcpp | msvcmsys) msvisualcpp | msvcmsys)
# This compiler won't grok `-c -o', but also, the minuso test has # 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 # not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted. # so weak that their functioning should not be impacted.
...@@ -11145,7 +11148,7 @@ else ...@@ -11145,7 +11148,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF cat > conftest.$ac_ext <<_LT_EOF
#line 11148 "configure" #line 11151 "configure"
#include "confdefs.h" #include "confdefs.h"
#if HAVE_DLFCN_H #if HAVE_DLFCN_H
...@@ -11251,7 +11254,7 @@ else ...@@ -11251,7 +11254,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF cat > conftest.$ac_ext <<_LT_EOF
#line 11254 "configure" #line 11257 "configure"
#include "confdefs.h" #include "confdefs.h"
#if HAVE_DLFCN_H #if HAVE_DLFCN_H
...@@ -15198,6 +15201,57 @@ elif test "x${enable_offload_targets-no}" != xno; then ...@@ -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 as_fn_error "Can't support offloading without support for plugins" "$LINENO" 5
fi 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. # Look for the CUDA driver package.
CUDA_DRIVER_INCLUDE= CUDA_DRIVER_INCLUDE=
CUDA_DRIVER_LIB= CUDA_DRIVER_LIB=
...@@ -15293,22 +15347,6 @@ if test "x$HSA_RUNTIME_LIB" != x; then ...@@ -15293,22 +15347,6 @@ if test "x$HSA_RUNTIME_LIB" != x; then
HSA_RUNTIME_LDFLAGS=-L$HSA_RUNTIME_LIB HSA_RUNTIME_LDFLAGS=-L$HSA_RUNTIME_LIB
fi 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=0
PLUGIN_HSA_CPPFLAGS= PLUGIN_HSA_CPPFLAGS=
PLUGIN_HSA_LDFLAGS= PLUGIN_HSA_LDFLAGS=
...@@ -15318,8 +15356,6 @@ PLUGIN_HSA_LIBS= ...@@ -15318,8 +15356,6 @@ PLUGIN_HSA_LIBS=
# Get offload targets and path to install tree of offloading compiler. # Get offload targets and path to install tree of offloading compiler.
offload_additional_options= offload_additional_options=
offload_additional_lib_paths= offload_additional_lib_paths=
...@@ -15384,8 +15420,8 @@ rm -f core conftest.err conftest.$ac_objext \ ...@@ -15384,8 +15420,8 @@ rm -f core conftest.err conftest.$ac_objext \
tgt_name=hsa tgt_name=hsa
PLUGIN_HSA=$tgt PLUGIN_HSA=$tgt
PLUGIN_HSA_CPPFLAGS=$HSA_RUNTIME_CPPFLAGS PLUGIN_HSA_CPPFLAGS=$HSA_RUNTIME_CPPFLAGS
PLUGIN_HSA_LDFLAGS="$HSA_RUNTIME_LDFLAGS $HSA_KMT_LDFLAGS" PLUGIN_HSA_LDFLAGS="$HSA_RUNTIME_LDFLAGS"
PLUGIN_HSA_LIBS="-lhsa-runtime64 -lhsakmt" PLUGIN_HSA_LIBS="-ldl"
PLUGIN_HSA_save_CPPFLAGS=$CPPFLAGS PLUGIN_HSA_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$PLUGIN_HSA_CPPFLAGS $CPPFLAGS" CPPFLAGS="$PLUGIN_HSA_CPPFLAGS $CPPFLAGS"
...@@ -15394,22 +15430,7 @@ rm -f core conftest.err conftest.$ac_objext \ ...@@ -15394,22 +15430,7 @@ rm -f core conftest.err conftest.$ac_objext \
PLUGIN_HSA_save_LIBS=$LIBS PLUGIN_HSA_save_LIBS=$LIBS
LIBS="$PLUGIN_HSA_LIBS $LIBS" LIBS="$PLUGIN_HSA_LIBS $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext PLUGIN_HSA=1
/* 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
CPPFLAGS=$PLUGIN_HSA_save_CPPFLAGS CPPFLAGS=$PLUGIN_HSA_save_CPPFLAGS
LDFLAGS=$PLUGIN_HSA_save_LDFLAGS LDFLAGS=$PLUGIN_HSA_save_LDFLAGS
LIBS=$PLUGIN_HSA_save_LIBS LIBS=$PLUGIN_HSA_save_LIBS
...@@ -15484,6 +15505,16 @@ cat >>confdefs.h <<_ACEOF ...@@ -15484,6 +15505,16 @@ cat >>confdefs.h <<_ACEOF
_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. # Check for functions needed.
for ac_func in getloadavg clock_gettime strtoull for ac_func in getloadavg clock_gettime strtoull
......
...@@ -44,7 +44,8 @@ if PLUGIN_HSA ...@@ -44,7 +44,8 @@ if PLUGIN_HSA
libgomp_plugin_hsa_version_info = -version-info $(libtool_VERSION) libgomp_plugin_hsa_version_info = -version-info $(libtool_VERSION)
toolexeclib_LTLIBRARIES += libgomp-plugin-hsa.la toolexeclib_LTLIBRARIES += libgomp-plugin-hsa.la
libgomp_plugin_hsa_la_SOURCES = plugin/plugin-hsa.c libgomp_plugin_hsa_la_SOURCES = plugin/plugin-hsa.c
libgomp_plugin_hsa_la_CPPFLAGS = $(AM_CPPFLAGS) $(PLUGIN_HSA_CPPFLAGS) libgomp_plugin_hsa_la_CPPFLAGS = $(AM_CPPFLAGS) $(PLUGIN_HSA_CPPFLAGS) \
-D_GNU_SOURCE
libgomp_plugin_hsa_la_LDFLAGS = $(libgomp_plugin_hsa_version_info) \ libgomp_plugin_hsa_la_LDFLAGS = $(libgomp_plugin_hsa_version_info) \
$(lt_host_flags) $(lt_host_flags)
libgomp_plugin_hsa_la_LDFLAGS += $(PLUGIN_HSA_LDFLAGS) libgomp_plugin_hsa_la_LDFLAGS += $(PLUGIN_HSA_LDFLAGS)
......
...@@ -36,6 +36,9 @@ if test x"$plugin_support" = xyes; then ...@@ -36,6 +36,9 @@ if test x"$plugin_support" = xyes; then
elif test "x${enable_offload_targets-no}" != xno; then elif test "x${enable_offload_targets-no}" != xno; then
AC_MSG_ERROR([Can't support offloading without support for plugins]) AC_MSG_ERROR([Can't support offloading without support for plugins])
fi fi
AC_CHECK_HEADERS_ONCE(unistd.h)
AC_CHECK_FUNCS_ONCE(secure_getenv __secure_getenv getuid geteuid getgid getegid)
# Look for the CUDA driver package. # Look for the CUDA driver package.
CUDA_DRIVER_INCLUDE= CUDA_DRIVER_INCLUDE=
...@@ -118,19 +121,6 @@ if test "x$HSA_RUNTIME_LIB" != x; then ...@@ -118,19 +121,6 @@ if test "x$HSA_RUNTIME_LIB" != x; then
HSA_RUNTIME_LDFLAGS=-L$HSA_RUNTIME_LIB HSA_RUNTIME_LDFLAGS=-L$HSA_RUNTIME_LIB
fi fi
HSA_KMT_LIB=
AC_SUBST(HSA_KMT_LIB)
HSA_KMT_LDFLAGS=
AC_ARG_WITH(hsa-kmt-lib,
[AS_HELP_STRING([--with-hsa-kmt-lib=PATH],
[specify directory for installed HSA KMT library.])])
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=0
PLUGIN_HSA_CPPFLAGS= PLUGIN_HSA_CPPFLAGS=
PLUGIN_HSA_LDFLAGS= PLUGIN_HSA_LDFLAGS=
...@@ -140,8 +130,6 @@ AC_SUBST(PLUGIN_HSA_CPPFLAGS) ...@@ -140,8 +130,6 @@ AC_SUBST(PLUGIN_HSA_CPPFLAGS)
AC_SUBST(PLUGIN_HSA_LDFLAGS) AC_SUBST(PLUGIN_HSA_LDFLAGS)
AC_SUBST(PLUGIN_HSA_LIBS) AC_SUBST(PLUGIN_HSA_LIBS)
# Get offload targets and path to install tree of offloading compiler. # Get offload targets and path to install tree of offloading compiler.
offload_additional_options= offload_additional_options=
offload_additional_lib_paths= offload_additional_lib_paths=
...@@ -195,8 +183,8 @@ if test x"$enable_offload_targets" != x; then ...@@ -195,8 +183,8 @@ if test x"$enable_offload_targets" != x; then
tgt_name=hsa tgt_name=hsa
PLUGIN_HSA=$tgt PLUGIN_HSA=$tgt
PLUGIN_HSA_CPPFLAGS=$HSA_RUNTIME_CPPFLAGS PLUGIN_HSA_CPPFLAGS=$HSA_RUNTIME_CPPFLAGS
PLUGIN_HSA_LDFLAGS="$HSA_RUNTIME_LDFLAGS $HSA_KMT_LDFLAGS" PLUGIN_HSA_LDFLAGS="$HSA_RUNTIME_LDFLAGS"
PLUGIN_HSA_LIBS="-lhsa-runtime64 -lhsakmt" PLUGIN_HSA_LIBS="-ldl"
PLUGIN_HSA_save_CPPFLAGS=$CPPFLAGS PLUGIN_HSA_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$PLUGIN_HSA_CPPFLAGS $CPPFLAGS" CPPFLAGS="$PLUGIN_HSA_CPPFLAGS $CPPFLAGS"
...@@ -205,11 +193,7 @@ if test x"$enable_offload_targets" != x; then ...@@ -205,11 +193,7 @@ if test x"$enable_offload_targets" != x; then
PLUGIN_HSA_save_LIBS=$LIBS PLUGIN_HSA_save_LIBS=$LIBS
LIBS="$PLUGIN_HSA_LIBS $LIBS" LIBS="$PLUGIN_HSA_LIBS $LIBS"
AC_LINK_IFELSE( PLUGIN_HSA=1
[AC_LANG_PROGRAM(
[#include "hsa.h"],
[hsa_status_t status = hsa_init ()])],
[PLUGIN_HSA=1])
CPPFLAGS=$PLUGIN_HSA_save_CPPFLAGS CPPFLAGS=$PLUGIN_HSA_save_CPPFLAGS
LDFLAGS=$PLUGIN_HSA_save_LDFLAGS LDFLAGS=$PLUGIN_HSA_save_LDFLAGS
LIBS=$PLUGIN_HSA_save_LIBS LIBS=$PLUGIN_HSA_save_LIBS
...@@ -260,3 +244,10 @@ AC_DEFINE_UNQUOTED([PLUGIN_NVPTX], [$PLUGIN_NVPTX], ...@@ -260,3 +244,10 @@ AC_DEFINE_UNQUOTED([PLUGIN_NVPTX], [$PLUGIN_NVPTX],
AM_CONDITIONAL([PLUGIN_HSA], [test $PLUGIN_HSA = 1]) AM_CONDITIONAL([PLUGIN_HSA], [test $PLUGIN_HSA = 1])
AC_DEFINE_UNQUOTED([PLUGIN_HSA], [$PLUGIN_HSA], AC_DEFINE_UNQUOTED([PLUGIN_HSA], [$PLUGIN_HSA],
[Define to 1 if the HSA plugin is built, 0 if not.]) [Define to 1 if the HSA plugin is built, 0 if not.])
if test "$HSA_RUNTIME_LIB" != ""; then
HSA_RUNTIME_LIB="$HSA_RUNTIME_LIB/"
fi
AC_DEFINE_UNQUOTED([HSA_RUNTIME_LIB], ["$HSA_RUNTIME_LIB"],
[Define path to HSA runtime.])
/* HSA Extensions API 1.0.1 representation description.
Copyright (C) 2016 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>.
The contents of the file was created by extracting data structures, enum,
typedef and other definitions from HSA Runtime Programmer’s Reference Manual
Version 1.0 (http://www.hsafoundation.com/standards/).
HTML version is provided on the following link:
http://www.hsafoundation.com/html/Content/Runtime/Topics/Runtime_title_page.htm
*/
#ifndef _HSA_EXT_FINALIZE_H
#define _HSA_EXT_FINALIZE_H 1
struct BrigModuleHeader;
typedef struct BrigModuleHeader *BrigModule_t;
typedef enum {
HSA_EXT_IMAGE_GEOMETRY_1D = 0,
HSA_EXT_IMAGE_GEOMETRY_2D = 1,
HSA_EXT_IMAGE_GEOMETRY_3D = 2,
HSA_EXT_IMAGE_GEOMETRY_1DA = 3,
HSA_EXT_IMAGE_GEOMETRY_2DA = 4,
HSA_EXT_IMAGE_GEOMETRY_1DB = 5,
HSA_EXT_IMAGE_GEOMETRY_2DDEPTH = 6,
HSA_EXT_IMAGE_GEOMETRY_2DADEPTH = 7
} hsa_ext_image_geometry_t;
typedef enum {
HSA_EXT_IMAGE_CHANNEL_TYPE_SNORM_INT8 = 0,
HSA_EXT_IMAGE_CHANNEL_TYPE_SNORM_INT16 = 1,
HSA_EXT_IMAGE_CHANNEL_TYPE_UNORM_INT8 = 2,
HSA_EXT_IMAGE_CHANNEL_TYPE_UNORM_INT16 = 3,
HSA_EXT_IMAGE_CHANNEL_TYPE_UNORM_INT24 = 4,
HSA_EXT_IMAGE_CHANNEL_TYPE_UNORM_SHORT_555 = 5,
HSA_EXT_IMAGE_CHANNEL_TYPE_UNORM_SHORT_565 = 6,
HSA_EXT_IMAGE_CHANNEL_TYPE_UNORM_SHORT_101010 = 7,
HSA_EXT_IMAGE_CHANNEL_TYPE_SIGNED_INT8 = 8,
HSA_EXT_IMAGE_CHANNEL_TYPE_SIGNED_INT16 = 9,
HSA_EXT_IMAGE_CHANNEL_TYPE_SIGNED_INT32 = 10,
HSA_EXT_IMAGE_CHANNEL_TYPE_UNSIGNED_INT8 = 11,
HSA_EXT_IMAGE_CHANNEL_TYPE_UNSIGNED_INT16 = 12,
HSA_EXT_IMAGE_CHANNEL_TYPE_UNSIGNED_INT32 = 13,
HSA_EXT_IMAGE_CHANNEL_TYPE_HALF_FLOAT = 14,
HSA_EXT_IMAGE_CHANNEL_TYPE_FLOAT = 15
} hsa_ext_image_channel_type_t;
typedef enum {
HSA_EXT_IMAGE_CHANNEL_ORDER_A = 0,
HSA_EXT_IMAGE_CHANNEL_ORDER_R = 1,
HSA_EXT_IMAGE_CHANNEL_ORDER_RX = 2,
HSA_EXT_IMAGE_CHANNEL_ORDER_RG = 3,
HSA_EXT_IMAGE_CHANNEL_ORDER_RGX = 4,
HSA_EXT_IMAGE_CHANNEL_ORDER_RA = 5,
HSA_EXT_IMAGE_CHANNEL_ORDER_RGB = 6,
HSA_EXT_IMAGE_CHANNEL_ORDER_RGBX = 7,
HSA_EXT_IMAGE_CHANNEL_ORDER_RGBA = 8,
HSA_EXT_IMAGE_CHANNEL_ORDER_BGRA = 9,
HSA_EXT_IMAGE_CHANNEL_ORDER_ARGB = 10,
HSA_EXT_IMAGE_CHANNEL_ORDER_ABGR = 11,
HSA_EXT_IMAGE_CHANNEL_ORDER_SRGB = 12,
HSA_EXT_IMAGE_CHANNEL_ORDER_SRGBX = 13,
HSA_EXT_IMAGE_CHANNEL_ORDER_SRGBA = 14,
HSA_EXT_IMAGE_CHANNEL_ORDER_SBGRA = 15,
HSA_EXT_IMAGE_CHANNEL_ORDER_INTENSITY = 16,
HSA_EXT_IMAGE_CHANNEL_ORDER_LUMINANCE = 17,
HSA_EXT_IMAGE_CHANNEL_ORDER_DEPTH = 18,
HSA_EXT_IMAGE_CHANNEL_ORDER_DEPTH_STENCIL = 19
} hsa_ext_image_channel_order_t;
typedef struct hsa_ext_image_format_s
{
hsa_ext_image_channel_type_t channel_type;
hsa_ext_image_channel_order_t channel_order;
} hsa_ext_image_format_t;
typedef struct hsa_ext_sampler_s
{
uint64_t handle;
} hsa_ext_sampler_t;
typedef struct hsa_ext_image_data_info_s
{
size_t size;
size_t alignment;
} hsa_ext_image_data_info_t;
typedef enum {
HSA_EXT_SAMPLER_ADDRESSING_MODE_UNDEFINED = 0,
HSA_EXT_SAMPLER_ADDRESSING_MODE_CLAMP_TO_EDGE = 1,
HSA_EXT_SAMPLER_ADDRESSING_MODE_CLAMP_TO_BORDER = 2,
HSA_EXT_SAMPLER_ADDRESSING_MODE_REPEAT = 3,
HSA_EXT_SAMPLER_ADDRESSING_MODE_MIRRORED_REPEAT = 4
} hsa_ext_sampler_addressing_mode_t;
typedef struct hsa_ext_image_s
{
uint64_t handle;
} hsa_ext_image_t;
typedef enum {
HSA_EXT_IMAGE_CAPABILITY_NOT_SUPPORTED = 0x0,
HSA_EXT_IMAGE_CAPABILITY_READ_ONLY = 0x1,
HSA_EXT_IMAGE_CAPABILITY_WRITE_ONLY = 0x2,
HSA_EXT_IMAGE_CAPABILITY_READ_WRITE = 0x4,
HSA_EXT_IMAGE_CAPABILITY_READ_MODIFY_WRITE = 0x8,
HSA_EXT_IMAGE_CAPABILITY_ACCESS_INVARIANT_DATA_LAYOUT = 0x10
} hsa_ext_image_capability_t;
typedef struct hsa_ext_control_directives_s
{
uint64_t control_directives_mask;
uint16_t break_exceptions_mask;
uint16_t detect_exceptions_mask;
uint32_t max_dynamic_group_size;
uint64_t max_flat_grid_size;
uint32_t max_flat_workgroup_size;
uint32_t reserved1;
uint64_t required_grid_size[3];
hsa_dim3_t required_workgroup_size;
uint8_t required_dim;
uint8_t reserved2[75];
} hsa_ext_control_directives_t;
typedef enum {
HSA_EXT_SAMPLER_FILTER_MODE_NEAREST = 0,
HSA_EXT_SAMPLER_FILTER_MODE_LINEAR = 1
} hsa_ext_sampler_filter_mode_t;
typedef enum {
HSA_EXT_SAMPLER_COORDINATE_MODE_UNNORMALIZED = 0,
HSA_EXT_SAMPLER_COORDINATE_MODE_NORMALIZED = 1
} hsa_ext_sampler_coordinate_mode_t;
typedef enum {
HSA_EXT_FINALIZER_CALL_CONVENTION_AUTO = -1
} hsa_ext_finalizer_call_convention_t;
typedef struct hsa_ext_program_s
{
uint64_t handle;
} hsa_ext_program_t;
typedef struct hsa_ext_image_descriptor_s
{
hsa_ext_image_geometry_t geometry;
size_t width;
size_t height;
size_t depth;
size_t array_size;
hsa_ext_image_format_t format;
} hsa_ext_image_descriptor_t;
typedef enum {
HSA_EXT_PROGRAM_INFO_MACHINE_MODEL = 0,
HSA_EXT_PROGRAM_INFO_PROFILE = 1,
HSA_EXT_PROGRAM_INFO_DEFAULT_FLOAT_ROUNDING_MODE = 2
} hsa_ext_program_info_t;
typedef BrigModule_t hsa_ext_module_t;
typedef struct hsa_ext_sampler_descriptor_s
{
hsa_ext_sampler_coordinate_mode_t coordinate_mode;
hsa_ext_sampler_filter_mode_t filter_mode;
hsa_ext_sampler_addressing_mode_t address_mode;
} hsa_ext_sampler_descriptor_t;
typedef struct hsa_ext_image_region_s
{
hsa_dim3_t offset;
hsa_dim3_t range;
} hsa_ext_image_region_t;
hsa_status_t hsa_ext_image_export (hsa_agent_t agent, hsa_ext_image_t src_image,
void *dst_memory, size_t dst_row_pitch,
size_t dst_slice_pitch,
const hsa_ext_image_region_t *image_region);
hsa_status_t hsa_ext_program_add_module (hsa_ext_program_t program,
hsa_ext_module_t module);
hsa_status_t hsa_ext_program_iterate_modules (
hsa_ext_program_t program,
hsa_status_t (*callback) (hsa_ext_program_t program, hsa_ext_module_t module,
void *data),
void *data);
hsa_status_t hsa_ext_program_create (
hsa_machine_model_t machine_model, hsa_profile_t profile,
hsa_default_float_rounding_mode_t default_float_rounding_mode,
const char *options, hsa_ext_program_t *program);
hsa_status_t
hsa_ext_image_data_get_info (hsa_agent_t agent,
const hsa_ext_image_descriptor_t *image_descriptor,
hsa_access_permission_t access_permission,
hsa_ext_image_data_info_t *image_data_info);
hsa_status_t hsa_ext_image_import (hsa_agent_t agent, const void *src_memory,
size_t src_row_pitch, size_t src_slice_pitch,
hsa_ext_image_t dst_image,
const hsa_ext_image_region_t *image_region);
hsa_status_t hsa_ext_program_get_info (hsa_ext_program_t program,
hsa_ext_program_info_t attribute,
void *value);
enum
{
HSA_EXT_STATUS_ERROR_IMAGE_FORMAT_UNSUPPORTED = 0x3000,
HSA_EXT_STATUS_ERROR_IMAGE_SIZE_UNSUPPORTED = 0x3001
};
hsa_status_t hsa_ext_image_destroy (hsa_agent_t agent, hsa_ext_image_t image);
hsa_status_t hsa_ext_image_get_capability (
hsa_agent_t agent, hsa_ext_image_geometry_t geometry,
const hsa_ext_image_format_t *image_format, uint32_t *capability_mask);
enum
{
HSA_EXT_STATUS_ERROR_INVALID_PROGRAM = 0x2000,
HSA_EXT_STATUS_ERROR_INVALID_MODULE = 0x2001,
HSA_EXT_STATUS_ERROR_INCOMPATIBLE_MODULE = 0x2002,
HSA_EXT_STATUS_ERROR_MODULE_ALREADY_INCLUDED = 0x2003,
HSA_EXT_STATUS_ERROR_SYMBOL_MISMATCH = 0x2004,
HSA_EXT_STATUS_ERROR_FINALIZATION_FAILED = 0x2005,
HSA_EXT_STATUS_ERROR_DIRECTIVE_MISMATCH = 0x2006
};
hsa_status_t hsa_ext_sampler_destroy (hsa_agent_t agent,
hsa_ext_sampler_t sampler);
hsa_status_t hsa_ext_program_finalize (
hsa_ext_program_t program, hsa_isa_t isa, int32_t call_convention,
hsa_ext_control_directives_t control_directives, const char *options,
hsa_code_object_type_t code_object_type, hsa_code_object_t *code_object);
hsa_status_t hsa_ext_image_create (
hsa_agent_t agent, const hsa_ext_image_descriptor_t *image_descriptor,
const void *image_data, hsa_access_permission_t access_permission,
hsa_ext_image_t *image);
hsa_status_t hsa_ext_program_destroy (hsa_ext_program_t program);
hsa_status_t hsa_ext_image_copy (hsa_agent_t agent, hsa_ext_image_t src_image,
const hsa_dim3_t *src_offset,
hsa_ext_image_t dst_image,
const hsa_dim3_t *dst_offset,
const hsa_dim3_t *range);
hsa_status_t hsa_ext_image_clear (hsa_agent_t agent, hsa_ext_image_t image,
const void *data,
const hsa_ext_image_region_t *image_region);
enum
{
HSA_EXT_AGENT_INFO_IMAGE_1D_MAX_ELEMENTS = 0x3000,
HSA_EXT_AGENT_INFO_IMAGE_1DA_MAX_ELEMENTS = 0x3001,
HSA_EXT_AGENT_INFO_IMAGE_1DB_MAX_ELEMENTS = 0x3002,
HSA_EXT_AGENT_INFO_IMAGE_2D_MAX_ELEMENTS = 0x3003,
HSA_EXT_AGENT_INFO_IMAGE_2DA_MAX_ELEMENTS = 0x3004,
HSA_EXT_AGENT_INFO_IMAGE_2DDEPTH_MAX_ELEMENTS = 0x3005,
HSA_EXT_AGENT_INFO_IMAGE_2DADEPTH_MAX_ELEMENTS = 0x3006,
HSA_EXT_AGENT_INFO_IMAGE_3D_MAX_ELEMENTS = 0x3007,
HSA_EXT_AGENT_INFO_IMAGE_ARRAY_MAX_LAYERS = 0x3008,
HSA_EXT_AGENT_INFO_MAX_IMAGE_RD_HANDLES = 0x3009,
HSA_EXT_AGENT_INFO_MAX_IMAGE_RORW_HANDLES = 0x300A,
HSA_EXT_AGENT_INFO_MAX_SAMPLER_HANDLERS = 0x300B
};
hsa_status_t
hsa_ext_sampler_create (hsa_agent_t agent,
const hsa_ext_sampler_descriptor_t *sampler_descriptor,
hsa_ext_sampler_t *sampler);
#endif /* _HSA_EXT_FINALIZE_H */
# Makefile.in generated by automake 1.11.6 from Makefile.am. # Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Foundation, Inc. # Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
...@@ -15,23 +15,6 @@ ...@@ -15,23 +15,6 @@
@SET_MAKE@ @SET_MAKE@
VPATH = @srcdir@ VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/@PACKAGE@ pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@
...@@ -76,11 +59,6 @@ CONFIG_HEADER = $(top_builddir)/config.h ...@@ -76,11 +59,6 @@ CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = libgomp-test-support.pt.exp CONFIG_CLEAN_FILES = libgomp-test-support.pt.exp
CONFIG_CLEAN_VPATH_FILES = CONFIG_CLEAN_VPATH_FILES =
SOURCES = SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
DEJATOOL = $(PACKAGE) DEJATOOL = $(PACKAGE)
RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
ACLOCAL = @ACLOCAL@ ACLOCAL = @ACLOCAL@
...@@ -111,7 +89,6 @@ FC = @FC@ ...@@ -111,7 +89,6 @@ FC = @FC@
FCFLAGS = @FCFLAGS@ FCFLAGS = @FCFLAGS@
FGREP = @FGREP@ FGREP = @FGREP@
GREP = @GREP@ GREP = @GREP@
HSA_KMT_LIB = @HSA_KMT_LIB@
HSA_RUNTIME_INCLUDE = @HSA_RUNTIME_INCLUDE@ HSA_RUNTIME_INCLUDE = @HSA_RUNTIME_INCLUDE@
HSA_RUNTIME_LIB = @HSA_RUNTIME_LIB@ HSA_RUNTIME_LIB = @HSA_RUNTIME_LIB@
INSTALL = @INSTALL@ INSTALL = @INSTALL@
...@@ -303,7 +280,7 @@ CTAGS: ...@@ -303,7 +280,7 @@ CTAGS:
check-DEJAGNU: site.exp check-DEJAGNU: site.exp
srcdir='$(srcdir)'; export srcdir; \ srcdir=`$(am__cd) $(srcdir) && pwd`; export srcdir; \
EXPECT=$(EXPECT); export EXPECT; \ EXPECT=$(EXPECT); export EXPECT; \
runtest=$(RUNTEST); \ runtest=$(RUNTEST); \
if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \ if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
...@@ -314,12 +291,12 @@ check-DEJAGNU: site.exp ...@@ -314,12 +291,12 @@ check-DEJAGNU: site.exp
else echo "WARNING: could not find \`runtest'" 1>&2; :;\ else echo "WARNING: could not find \`runtest'" 1>&2; :;\
fi; \ fi; \
exit $$exit_status exit $$exit_status
site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG) site.exp: Makefile
@echo 'Making a new site.exp file...' @echo 'Making a new site.exp file...'
@echo '## these variables are automatically generated by make ##' >site.tmp @echo '## these variables are automatically generated by make ##' >site.tmp
@echo '# Do not edit here. If you wish to override these values' >>site.tmp @echo '# Do not edit here. If you wish to override these values' >>site.tmp
@echo '# edit the last section' >>site.tmp @echo '# edit the last section' >>site.tmp
@echo 'set srcdir "$(srcdir)"' >>site.tmp @echo 'set srcdir $(srcdir)' >>site.tmp
@echo "set objdir `pwd`" >>site.tmp @echo "set objdir `pwd`" >>site.tmp
@echo 'set build_alias "$(build_alias)"' >>site.tmp @echo 'set build_alias "$(build_alias)"' >>site.tmp
@echo 'set build_triplet $(build_triplet)' >>site.tmp @echo 'set build_triplet $(build_triplet)' >>site.tmp
...@@ -327,16 +304,9 @@ site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG) ...@@ -327,16 +304,9 @@ site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG)
@echo 'set host_triplet $(host_triplet)' >>site.tmp @echo 'set host_triplet $(host_triplet)' >>site.tmp
@echo 'set target_alias "$(target_alias)"' >>site.tmp @echo 'set target_alias "$(target_alias)"' >>site.tmp
@echo 'set target_triplet $(target_triplet)' >>site.tmp @echo 'set target_triplet $(target_triplet)' >>site.tmp
@list='$(EXTRA_DEJAGNU_SITE_CONFIG)'; for f in $$list; do \ @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp
echo "## Begin content included from file $$f. Do not modify. ##" \ @test ! -f site.exp || \
&& cat `test -f "$$f" || echo '$(srcdir)/'`$$f \ sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
&& echo "## End content included from file $$f. ##" \
|| exit 1; \
done >> site.tmp
@echo "## End of auto-generated content; you can edit from here. ##" >> site.tmp
@if test -f site.exp; then \
sed -e '1,/^## End of auto-generated content.*##/d' site.exp >> site.tmp; \
fi
@-rm -f site.bak @-rm -f site.bak
@test ! -f site.exp || mv site.exp site.bak @test ! -f site.exp || mv site.exp site.bak
@mv site.tmp site.exp @mv site.tmp site.exp
...@@ -361,15 +331,10 @@ install-am: all-am ...@@ -361,15 +331,10 @@ install-am: all-am
installcheck: installcheck-am installcheck: installcheck-am
install-strip: install-strip:
if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \
install; \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic: mostlyclean-generic:
clean-generic: clean-generic:
......
...@@ -205,13 +205,9 @@ proc libgomp_init { args } { ...@@ -205,13 +205,9 @@ proc libgomp_init { args } {
append always_ld_library_path ":$cuda_driver_lib" append always_ld_library_path ":$cuda_driver_lib"
} }
global hsa_runtime_lib global hsa_runtime_lib
global hsa_kmt_lib
if { $hsa_runtime_lib != "" } { if { $hsa_runtime_lib != "" } {
append always_ld_library_path ":$hsa_runtime_lib" append always_ld_library_path ":$hsa_runtime_lib"
} }
if { $hsa_kmt_lib != "" } {
append always_ld_library_path ":$hsa_kmt_lib"
}
} }
# We use atomic operations in the testcases to validate results. # We use atomic operations in the testcases to validate results.
......
set cuda_driver_include "@CUDA_DRIVER_INCLUDE@" set cuda_driver_include "@CUDA_DRIVER_INCLUDE@"
set cuda_driver_lib "@CUDA_DRIVER_LIB@" set cuda_driver_lib "@CUDA_DRIVER_LIB@"
set hsa_runtime_lib "@HSA_RUNTIME_LIB@" set hsa_runtime_lib "@HSA_RUNTIME_LIB@"
set hsa_kmt_lib "@HSA_KMT_LIB@"
set offload_targets "@offload_targets@" set offload_targets "@offload_targets@"
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