diff --git a/configure b/configure index 2ccbede56..9efe3c968 100755 --- a/configure +++ b/configure @@ -299,15 +299,15 @@ print_usage() echo " when debugging certain configuration issues, and/or as" echo " a sanity check to make sure these lists are constituted" echo " as expected." - echo " " - echo " --complex-return=gnu|intel" - echo " " - echo " Specify the way in which complex numbers are returned" - echo " from Fortran functions, either \"gnu\" (return in" - echo " registers) or \"intel\" (return via hidden argument)." - echo " If not specified and the environment variable FC is set," - echo " attempt to determine the return type from the compiler." - echo " Otherwise, the default is \"gnu\"." + echo " " + echo " --complex-return=gnu|intel" + echo " " + echo " Specify the way in which complex numbers are returned" + echo " from Fortran functions, either \"gnu\" (return in" + echo " registers) or \"intel\" (return via hidden argument)." + echo " If not specified and the environment variable FC is set," + echo " attempt to determine the return type from the compiler." + echo " Otherwise, the default is \"gnu\"." echo " " echo " -q, --quiet Suppress informational output. By default, configure" echo " is verbose. (NOTE: -q is not yet implemented)" @@ -318,7 +318,7 @@ print_usage() echo " " echo " CC Specifies the C compiler to use." echo " CXX Specifies the C++ compiler to use (sandbox only)." - echo " FC Specifies the Fortran compiler to use (only to determine --complex-return)." + echo " FC Specifies the Fortran compiler to use (only to determine --complex-return)." echo " RANLIB Specifies the ranlib executable to use." echo " AR Specifies the archiver to use." echo " CFLAGS Specifies additional compiler flags to use (prepended)." @@ -2153,9 +2153,9 @@ main() show-config-list) show_config_list=1 ;; - complex-return=*) - complex_return=${OPTARG#*=} - ;; + complex-return=*) + complex_return=${OPTARG#*=} + ;; *) print_usage ;; @@ -3012,47 +3012,47 @@ main() fi # Check the method used for returning complex numbers - if [ "x${complex_return}" = "xdefault" ]; then - if [ -n "${FC}" ]; then - # Determine the complex return type from the given Fortran compiler + if [ "x${complex_return}" = "xdefault" ]; then + if [ -n "${FC}" ]; then + # Determine the complex return type from the given Fortran compiler - # Query the full vendor version string output. This includes the - # version number along with (potentially) a bunch of other textual - # clutter. - # NOTE: This maybe should use merged stdout/stderr rather than only - # stdout. But it works for now. - vendor_string="$(${FC} --version 2>/dev/null)" - - # Query the compiler "vendor" (ie: the compiler's simple name) and - # isolate the version number. - # The last part ({ read first rest ; echo $first ; }) is a workaround - # to OS X's egrep only returning the first match. - fc_vendor=$(echo "${vendor_string}" | egrep -o 'ifort|GNU' | { read first rest ; echo $first ; }) - - if [ "x${fc_vendor}" = "xifort" ]; then - complex_return='intel' - elif [ "x${fc_vendor}" = "xGNU" ]; then - complex_return='gnu' - else - echo "${script_name}: unable to determine Fortran compiler vendor!" - complex_return='gnu' - fi - else - complex_return='gnu' - fi - fi + # Query the full vendor version string output. This includes the + # version number along with (potentially) a bunch of other textual + # clutter. + # NOTE: This maybe should use merged stdout/stderr rather than only + # stdout. But it works for now. + vendor_string="$(${FC} --version 2>/dev/null)" + + # Query the compiler "vendor" (ie: the compiler's simple name) and + # isolate the version number. + # The last part ({ read first rest ; echo $first ; }) is a workaround + # to OS X's egrep only returning the first match. + fc_vendor=$(echo "${vendor_string}" | egrep -o 'ifort|GNU' | { read first rest ; echo $first ; }) + + if [ "x${fc_vendor}" = "xifort" ]; then + complex_return='intel' + elif [ "x${fc_vendor}" = "xGNU" ]; then + complex_return='gnu' + else + echo "${script_name}: unable to determine Fortran compiler vendor!" + complex_return='gnu' + fi + else + complex_return='gnu' + fi + fi - if [ "x${complex_return}" = "xgnu" ]; then - complex_return_intel01='0' - elif [ "x${complex_return}" = "xintel" ]; then - complex_return_intel01='1' + if [ "x${complex_return}" = "xgnu" ]; then + complex_return_intel01='0' + elif [ "x${complex_return}" = "xintel" ]; then + complex_return_intel01='1' else - echo "${script_name}: unknown complex return type \"${complex_return}\"! Cannot continue." - echo "${script_name}: *** Acceptable values are \"gnu\" and \"intel\"." - exit 1 + echo "${script_name}: unknown complex return type \"${complex_return}\"! Cannot continue." + echo "${script_name}: *** Acceptable values are \"gnu\" and \"intel\"." + exit 1 fi - echo "${script_name}: configuring complex return type as \"${complex_return}\"." + echo "${script_name}: configuring complex return type as \"${complex_return}\"." # Variables that may contain forward slashes, such as paths, need extra # escaping when used in sed commands. We insert those extra escape @@ -3221,8 +3221,8 @@ main() | sed -e "s/@enable_memkind@/${enable_memkind_01}/g" \ | sed -e "s/@enable_pragma_omp_simd@/${enable_pragma_omp_simd_01}/g" \ | sed -e "s/@enable_sandbox@/${enable_sandbox_01}/g" \ - | sed -e "s/@enable_shared@/${enable_shared_01}/g" \ - | sed -e "s/@complex_return_intel@/${complex_return_intel01}/g" \ + | sed -e "s/@enable_shared@/${enable_shared_01}/g" \ + | sed -e "s/@complex_return_intel@/${complex_return_intel01}/g" \ > "${bli_config_h_out_path}" diff --git a/frame/compat/bla_dot.c b/frame/compat/bla_dot.c index 8224355bc..0699cb22f 100644 --- a/frame/compat/bla_dot.c +++ b/frame/compat/bla_dot.c @@ -49,41 +49,41 @@ ftype PASTEF772(ch,blasname,chc) \ const ftype* y, const f77_int* incy \ ) \ { \ - dim_t n0; \ - ftype* x0; \ - ftype* y0; \ - inc_t incx0; \ - inc_t incy0; \ - ftype rho; \ + dim_t n0; \ + ftype* x0; \ + ftype* y0; \ + inc_t incx0; \ + inc_t incy0; \ + ftype rho; \ \ - /* Initialize BLIS. */ \ - bli_init_auto(); \ + /* Initialize BLIS. */ \ + bli_init_auto(); \ \ - /* Convert/typecast negative values of n to zero. */ \ - bli_convert_blas_dim1( *n, n0 ); \ + /* Convert/typecast negative values of n to zero. */ \ + bli_convert_blas_dim1( *n, n0 ); \ \ - /* If the input increments are negative, adjust the pointers so we can - use positive increments instead. */ \ - bli_convert_blas_incv( n0, (ftype*)x, *incx, x0, incx0 ); \ - bli_convert_blas_incv( n0, (ftype*)y, *incy, y0, incy0 ); \ + /* If the input increments are negative, adjust the pointers so we can + use positive increments instead. */ \ + bli_convert_blas_incv( n0, (ftype*)x, *incx, x0, incx0 ); \ + bli_convert_blas_incv( n0, (ftype*)y, *incy, y0, incy0 ); \ \ - /* Call BLIS interface. */ \ - PASTEMAC2(ch,blisname,BLIS_TAPI_EX_SUF) \ - ( \ - blis_conjx, \ - BLIS_NO_CONJUGATE, \ - n0, \ - x0, incx0, \ - y0, incy0, \ - &rho, \ - NULL, \ - NULL \ - ); \ + /* Call BLIS interface. */ \ + PASTEMAC2(ch,blisname,BLIS_TAPI_EX_SUF) \ + ( \ + blis_conjx, \ + BLIS_NO_CONJUGATE, \ + n0, \ + x0, incx0, \ + y0, incy0, \ + &rho, \ + NULL, \ + NULL \ + ); \ \ - /* Finalize BLIS. */ \ - bli_finalize_auto(); \ + /* Finalize BLIS. */ \ + bli_finalize_auto(); \ \ - return rho; \ + return rho; \ } INSERT_GENTFUNCDOTR_BLAS( dot, dotv ) @@ -106,41 +106,41 @@ void PASTEF772(ch,blasname,chc) \ const ftype* y, const f77_int* incy \ ) \ { \ - dim_t n0; \ - ftype* x0; \ - ftype* y0; \ - inc_t incx0; \ - inc_t incy0; \ - ftype rho; \ + dim_t n0; \ + ftype* x0; \ + ftype* y0; \ + inc_t incx0; \ + inc_t incy0; \ + ftype rho; \ \ - /* Initialize BLIS. */ \ - bli_init_auto(); \ + /* Initialize BLIS. */ \ + bli_init_auto(); \ \ - /* Convert/typecast negative values of n to zero. */ \ - bli_convert_blas_dim1( *n, n0 ); \ + /* Convert/typecast negative values of n to zero. */ \ + bli_convert_blas_dim1( *n, n0 ); \ \ - /* If the input increments are negative, adjust the pointers so we can - use positive increments instead. */ \ - bli_convert_blas_incv( n0, (ftype*)x, *incx, x0, incx0 ); \ - bli_convert_blas_incv( n0, (ftype*)y, *incy, y0, incy0 ); \ + /* If the input increments are negative, adjust the pointers so we can + use positive increments instead. */ \ + bli_convert_blas_incv( n0, (ftype*)x, *incx, x0, incx0 ); \ + bli_convert_blas_incv( n0, (ftype*)y, *incy, y0, incy0 ); \ \ - /* Call BLIS interface. */ \ - PASTEMAC2(ch,blisname,BLIS_TAPI_EX_SUF) \ - ( \ - blis_conjx, \ - BLIS_NO_CONJUGATE, \ - n0, \ - x0, incx0, \ - y0, incy0, \ - &rho, \ - NULL, \ - NULL \ - ); \ + /* Call BLIS interface. */ \ + PASTEMAC2(ch,blisname,BLIS_TAPI_EX_SUF) \ + ( \ + blis_conjx, \ + BLIS_NO_CONJUGATE, \ + n0, \ + x0, incx0, \ + y0, incy0, \ + &rho, \ + NULL, \ + NULL \ + ); \ \ - /* Finalize BLIS. */ \ - bli_finalize_auto(); \ + /* Finalize BLIS. */ \ + bli_finalize_auto(); \ \ - *rhop = rho; \ + *rhop = rho; \ } INSERT_GENTFUNCDOTC_BLAS( dot, dotv ) diff --git a/frame/compat/bla_dot.h b/frame/compat/bla_dot.h index c84eff481..87d773321 100644 --- a/frame/compat/bla_dot.h +++ b/frame/compat/bla_dot.h @@ -55,7 +55,8 @@ INSERT_GENTPROTDOTC_BLAS( dot ) #else -// For the "intel" complex return type, use a hidden parameter to return the result +// For the "intel" complex return type, we use a hidden parameter (passed by +// address) to return the result. #undef GENTPROTDOT #define GENTPROTDOT( ftype, ch, chc, blasname ) \ \ diff --git a/frame/compat/cblas/f77_sub/f77_dot_sub.c b/frame/compat/cblas/f77_sub/f77_dot_sub.c index f1b3dff40..0ca80464d 100644 --- a/frame/compat/cblas/f77_sub/f77_dot_sub.c +++ b/frame/compat/cblas/f77_sub/f77_dot_sub.c @@ -69,7 +69,8 @@ INSERT_GENTFUNCDOTC_BLAS( dot, NULL ) // // Define CBLAS subrotine wrapper interfaces for complex types. -// For the "intel" complex return type, pass a hidden first parameter. +// For the "intel" complex return type, pass a hidden first parameter +// (by address). // #undef GENTFUNCDOT #define GENTFUNCDOT( ftype, ch, chc, blis_conjx, blasname, blisname ) \ @@ -82,13 +83,13 @@ void PASTEF773(ch,blasname,chc,sub) \ ftype* rval \ ) \ { \ - PASTEF772(ch,blasname,chc) \ - ( \ - rval, \ - n, \ - x, incx, \ - y, incy \ - ); \ + PASTEF772(ch,blasname,chc) \ + ( \ + rval, \ + n, \ + x, incx, \ + y, incy \ + ); \ } INSERT_GENTFUNCDOTC_BLAS( dot, NULL )