gumath 0.2.0dev5 → 0.2.0dev8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +7 -2
  3. data/Gemfile +0 -3
  4. data/ext/ruby_gumath/GPATH +0 -0
  5. data/ext/ruby_gumath/GRTAGS +0 -0
  6. data/ext/ruby_gumath/GTAGS +0 -0
  7. data/ext/ruby_gumath/extconf.rb +0 -5
  8. data/ext/ruby_gumath/functions.c +10 -2
  9. data/ext/ruby_gumath/gufunc_object.c +15 -4
  10. data/ext/ruby_gumath/gufunc_object.h +9 -3
  11. data/ext/ruby_gumath/gumath/Makefile +63 -0
  12. data/ext/ruby_gumath/gumath/Makefile.in +1 -0
  13. data/ext/ruby_gumath/gumath/config.h +56 -0
  14. data/ext/ruby_gumath/gumath/config.h.in +3 -0
  15. data/ext/ruby_gumath/gumath/config.log +497 -0
  16. data/ext/ruby_gumath/gumath/config.status +1034 -0
  17. data/ext/ruby_gumath/gumath/configure +375 -4
  18. data/ext/ruby_gumath/gumath/configure.ac +47 -3
  19. data/ext/ruby_gumath/gumath/libgumath/Makefile +236 -0
  20. data/ext/ruby_gumath/gumath/libgumath/Makefile.in +90 -24
  21. data/ext/ruby_gumath/gumath/libgumath/Makefile.vc +54 -15
  22. data/ext/ruby_gumath/gumath/libgumath/apply.c +92 -28
  23. data/ext/ruby_gumath/gumath/libgumath/apply.o +0 -0
  24. data/ext/ruby_gumath/gumath/libgumath/common.o +0 -0
  25. data/ext/ruby_gumath/gumath/libgumath/cpu_device_binary.o +0 -0
  26. data/ext/ruby_gumath/gumath/libgumath/cpu_device_unary.o +0 -0
  27. data/ext/ruby_gumath/gumath/libgumath/cpu_host_binary.o +0 -0
  28. data/ext/ruby_gumath/gumath/libgumath/cpu_host_unary.o +0 -0
  29. data/ext/ruby_gumath/gumath/libgumath/examples.o +0 -0
  30. data/ext/ruby_gumath/gumath/libgumath/extending/graph.c +27 -20
  31. data/ext/ruby_gumath/gumath/libgumath/extending/pdist.c +1 -1
  32. data/ext/ruby_gumath/gumath/libgumath/func.c +13 -9
  33. data/ext/ruby_gumath/gumath/libgumath/func.o +0 -0
  34. data/ext/ruby_gumath/gumath/libgumath/graph.o +0 -0
  35. data/ext/ruby_gumath/gumath/libgumath/gumath.h +55 -14
  36. data/ext/ruby_gumath/gumath/libgumath/kernels/common.c +513 -0
  37. data/ext/ruby_gumath/gumath/libgumath/kernels/common.h +155 -0
  38. data/ext/ruby_gumath/gumath/libgumath/kernels/contrib/bfloat16.h +520 -0
  39. data/ext/ruby_gumath/gumath/libgumath/kernels/cpu_device_binary.cc +1123 -0
  40. data/ext/ruby_gumath/gumath/libgumath/kernels/cpu_device_binary.h +1062 -0
  41. data/ext/ruby_gumath/gumath/libgumath/kernels/cpu_device_msvc.cc +555 -0
  42. data/ext/ruby_gumath/gumath/libgumath/kernels/cpu_device_unary.cc +368 -0
  43. data/ext/ruby_gumath/gumath/libgumath/kernels/cpu_device_unary.h +335 -0
  44. data/ext/ruby_gumath/gumath/libgumath/kernels/cpu_host_binary.c +2952 -0
  45. data/ext/ruby_gumath/gumath/libgumath/kernels/cpu_host_unary.c +1100 -0
  46. data/ext/ruby_gumath/gumath/libgumath/kernels/cuda_device_binary.cu +1143 -0
  47. data/ext/ruby_gumath/gumath/libgumath/kernels/cuda_device_binary.h +1061 -0
  48. data/ext/ruby_gumath/gumath/libgumath/kernels/cuda_device_unary.cu +528 -0
  49. data/ext/ruby_gumath/gumath/libgumath/kernels/cuda_device_unary.h +463 -0
  50. data/ext/ruby_gumath/gumath/libgumath/kernels/cuda_host_binary.c +2817 -0
  51. data/ext/ruby_gumath/gumath/libgumath/kernels/cuda_host_unary.c +1331 -0
  52. data/ext/ruby_gumath/gumath/libgumath/kernels/device.hh +614 -0
  53. data/ext/ruby_gumath/gumath/libgumath/libgumath.a +0 -0
  54. data/ext/ruby_gumath/gumath/libgumath/libgumath.so +1 -0
  55. data/ext/ruby_gumath/gumath/libgumath/libgumath.so.0 +1 -0
  56. data/ext/ruby_gumath/gumath/libgumath/libgumath.so.0.2.0dev3 +0 -0
  57. data/ext/ruby_gumath/gumath/libgumath/nploops.o +0 -0
  58. data/ext/ruby_gumath/gumath/libgumath/pdist.o +0 -0
  59. data/ext/ruby_gumath/gumath/libgumath/quaternion.o +0 -0
  60. data/ext/ruby_gumath/gumath/libgumath/tbl.o +0 -0
  61. data/ext/ruby_gumath/gumath/libgumath/thread.c +17 -4
  62. data/ext/ruby_gumath/gumath/libgumath/thread.o +0 -0
  63. data/ext/ruby_gumath/gumath/libgumath/xndloops.c +110 -0
  64. data/ext/ruby_gumath/gumath/libgumath/xndloops.o +0 -0
  65. data/ext/ruby_gumath/gumath/python/gumath/__init__.py +150 -0
  66. data/ext/ruby_gumath/gumath/python/gumath/_gumath.c +446 -80
  67. data/ext/ruby_gumath/gumath/python/gumath/cuda.c +78 -0
  68. data/ext/ruby_gumath/gumath/python/gumath/examples.c +0 -5
  69. data/ext/ruby_gumath/gumath/python/gumath/functions.c +2 -2
  70. data/ext/ruby_gumath/gumath/python/gumath/gumath.h +246 -0
  71. data/ext/ruby_gumath/gumath/python/gumath/libgumath.a +0 -0
  72. data/ext/ruby_gumath/gumath/python/gumath/libgumath.so +1 -0
  73. data/ext/ruby_gumath/gumath/python/gumath/libgumath.so.0 +1 -0
  74. data/ext/ruby_gumath/gumath/python/gumath/libgumath.so.0.2.0dev3 +0 -0
  75. data/ext/ruby_gumath/gumath/python/gumath/pygumath.h +31 -2
  76. data/ext/ruby_gumath/gumath/python/gumath_aux.py +767 -0
  77. data/ext/ruby_gumath/gumath/python/randdec.py +535 -0
  78. data/ext/ruby_gumath/gumath/python/randfloat.py +177 -0
  79. data/ext/ruby_gumath/gumath/python/test_gumath.py +1504 -24
  80. data/ext/ruby_gumath/gumath/python/test_xndarray.py +462 -0
  81. data/ext/ruby_gumath/gumath/setup.py +67 -6
  82. data/ext/ruby_gumath/gumath/tools/detect_cuda_arch.cc +35 -0
  83. data/ext/ruby_gumath/include/gumath.h +55 -14
  84. data/ext/ruby_gumath/include/ruby_gumath.h +4 -1
  85. data/ext/ruby_gumath/lib/libgumath.a +0 -0
  86. data/ext/ruby_gumath/lib/libgumath.so.0.2.0dev3 +0 -0
  87. data/ext/ruby_gumath/ruby_gumath.c +231 -70
  88. data/ext/ruby_gumath/ruby_gumath.h +4 -1
  89. data/ext/ruby_gumath/ruby_gumath_internal.h +25 -0
  90. data/ext/ruby_gumath/util.c +34 -0
  91. data/ext/ruby_gumath/util.h +9 -0
  92. data/gumath.gemspec +3 -2
  93. data/lib/gumath.rb +55 -1
  94. data/lib/gumath/version.rb +2 -2
  95. data/lib/ruby_gumath.so +0 -0
  96. metadata +63 -10
  97. data/ext/ruby_gumath/gumath/libgumath/extending/bfloat16.c +0 -130
  98. data/ext/ruby_gumath/gumath/libgumath/kernels/binary.c +0 -547
  99. data/ext/ruby_gumath/gumath/libgumath/kernels/unary.c +0 -449
@@ -624,6 +624,7 @@ ac_includes_default="\
624
624
  ac_subst_vars='LTLIBOBJS
625
625
  LIBOBJS
626
626
  CONFIGURE_LDFLAGS
627
+ CONFIGURE_CXXFLAGS
627
628
  CONFIGURE_CFLAGS
628
629
  GM_OPT
629
630
  GM_WARN
@@ -633,6 +634,8 @@ CONFIGURE_LIBS_TEST
633
634
  CONFIGURE_LIBS
634
635
  CONFIGURE_INCLUDES_TEST
635
636
  CONFIGURE_INCLUDES
637
+ CONFIGURE_CUDA_CXXFLAGS
638
+ CUDA_CXX
636
639
  INSTALL
637
640
  INSTALL_DATA
638
641
  INSTALL_SCRIPT
@@ -642,6 +645,9 @@ GREP
642
645
  CPP
643
646
  RANLIB
644
647
  AR
648
+ ac_ct_CXX
649
+ CXXFLAGS
650
+ CXX
645
651
  OBJEXT
646
652
  EXEEXT
647
653
  ac_ct_CC
@@ -681,6 +687,7 @@ infodir
681
687
  docdir
682
688
  oldincludedir
683
689
  includedir
690
+ runstatedir
684
691
  localstatedir
685
692
  sharedstatedir
686
693
  sysconfdir
@@ -715,6 +722,9 @@ CFLAGS
715
722
  LDFLAGS
716
723
  LIBS
717
724
  CPPFLAGS
725
+ CXX
726
+ CXXFLAGS
727
+ CCC
718
728
  CPP'
719
729
 
720
730
 
@@ -754,6 +764,7 @@ datadir='${datarootdir}'
754
764
  sysconfdir='${prefix}/etc'
755
765
  sharedstatedir='${prefix}/com'
756
766
  localstatedir='${prefix}/var'
767
+ runstatedir='${localstatedir}/run'
757
768
  includedir='${prefix}/include'
758
769
  oldincludedir='/usr/include'
759
770
  docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1006,6 +1017,15 @@ do
1006
1017
  | -silent | --silent | --silen | --sile | --sil)
1007
1018
  silent=yes ;;
1008
1019
 
1020
+ -runstatedir | --runstatedir | --runstatedi | --runstated \
1021
+ | --runstate | --runstat | --runsta | --runst | --runs \
1022
+ | --run | --ru | --r)
1023
+ ac_prev=runstatedir ;;
1024
+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
1025
+ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
1026
+ | --run=* | --ru=* | --r=*)
1027
+ runstatedir=$ac_optarg ;;
1028
+
1009
1029
  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
1010
1030
  ac_prev=sbindir ;;
1011
1031
  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1143,7 +1163,7 @@ fi
1143
1163
  for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
1144
1164
  datadir sysconfdir sharedstatedir localstatedir includedir \
1145
1165
  oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1146
- libdir localedir mandir
1166
+ libdir localedir mandir runstatedir
1147
1167
  do
1148
1168
  eval ac_val=\$$ac_var
1149
1169
  # Remove trailing slashes.
@@ -1296,6 +1316,7 @@ Fine tuning of the installation directories:
1296
1316
  --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
1297
1317
  --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
1298
1318
  --localstatedir=DIR modifiable single-machine data [PREFIX/var]
1319
+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
1299
1320
  --libdir=DIR object code libraries [EPREFIX/lib]
1300
1321
  --includedir=DIR C header files [PREFIX/include]
1301
1322
  --oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -1342,6 +1363,8 @@ Some influential environment variables:
1342
1363
  LIBS libraries to pass to the linker, e.g. -l<library>
1343
1364
  CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
1344
1365
  you have headers in a nonstandard directory <include dir>
1366
+ CXX C++ compiler command
1367
+ CXXFLAGS C++ compiler flags
1345
1368
  CPP C preprocessor
1346
1369
 
1347
1370
  Use these variables to override the choices made by `configure' or to help
@@ -1463,6 +1486,44 @@ fi
1463
1486
 
1464
1487
  } # ac_fn_c_try_compile
1465
1488
 
1489
+ # ac_fn_cxx_try_compile LINENO
1490
+ # ----------------------------
1491
+ # Try to compile conftest.$ac_ext, and return whether this succeeded.
1492
+ ac_fn_cxx_try_compile ()
1493
+ {
1494
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1495
+ rm -f conftest.$ac_objext
1496
+ if { { ac_try="$ac_compile"
1497
+ case "(($ac_try" in
1498
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1499
+ *) ac_try_echo=$ac_try;;
1500
+ esac
1501
+ eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1502
+ $as_echo "$ac_try_echo"; } >&5
1503
+ (eval "$ac_compile") 2>conftest.err
1504
+ ac_status=$?
1505
+ if test -s conftest.err; then
1506
+ grep -v '^ *+' conftest.err >conftest.er1
1507
+ cat conftest.er1 >&5
1508
+ mv -f conftest.er1 conftest.err
1509
+ fi
1510
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1511
+ test $ac_status = 0; } && {
1512
+ test -z "$ac_cxx_werror_flag" ||
1513
+ test ! -s conftest.err
1514
+ } && test -s conftest.$ac_objext; then :
1515
+ ac_retval=0
1516
+ else
1517
+ $as_echo "$as_me: failed program was:" >&5
1518
+ sed 's/^/| /' conftest.$ac_ext >&5
1519
+
1520
+ ac_retval=1
1521
+ fi
1522
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1523
+ as_fn_set_status $ac_retval
1524
+
1525
+ } # ac_fn_cxx_try_compile
1526
+
1466
1527
  # ac_fn_c_try_cpp LINENO
1467
1528
  # ----------------------
1468
1529
  # Try to preprocess conftest.$ac_ext, and return whether this succeeded.
@@ -2163,7 +2224,8 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2163
2224
  ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2164
2225
  ac_compiler_gnu=$ac_cv_c_compiler_gnu
2165
2226
 
2166
- saved_cflags=$CFLAGS
2227
+ saved_cflags="$CFLAGS"
2228
+ saved_cxxflags="$CXXFLAGS"
2167
2229
  ac_ext=c
2168
2230
  ac_cpp='$CPP $CPPFLAGS'
2169
2231
  ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -2953,7 +3015,265 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2953
3015
  ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2954
3016
  ac_compiler_gnu=$ac_cv_c_compiler_gnu
2955
3017
 
2956
- CFLAGS=$saved_cflags
3018
+ ac_ext=cpp
3019
+ ac_cpp='$CXXCPP $CPPFLAGS'
3020
+ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3021
+ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3022
+ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
3023
+ if test -z "$CXX"; then
3024
+ if test -n "$CCC"; then
3025
+ CXX=$CCC
3026
+ else
3027
+ if test -n "$ac_tool_prefix"; then
3028
+ for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
3029
+ do
3030
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
3031
+ set dummy $ac_tool_prefix$ac_prog; ac_word=$2
3032
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3033
+ $as_echo_n "checking for $ac_word... " >&6; }
3034
+ if ${ac_cv_prog_CXX+:} false; then :
3035
+ $as_echo_n "(cached) " >&6
3036
+ else
3037
+ if test -n "$CXX"; then
3038
+ ac_cv_prog_CXX="$CXX" # Let the user override the test.
3039
+ else
3040
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3041
+ for as_dir in $PATH
3042
+ do
3043
+ IFS=$as_save_IFS
3044
+ test -z "$as_dir" && as_dir=.
3045
+ for ac_exec_ext in '' $ac_executable_extensions; do
3046
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3047
+ ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
3048
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3049
+ break 2
3050
+ fi
3051
+ done
3052
+ done
3053
+ IFS=$as_save_IFS
3054
+
3055
+ fi
3056
+ fi
3057
+ CXX=$ac_cv_prog_CXX
3058
+ if test -n "$CXX"; then
3059
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
3060
+ $as_echo "$CXX" >&6; }
3061
+ else
3062
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3063
+ $as_echo "no" >&6; }
3064
+ fi
3065
+
3066
+
3067
+ test -n "$CXX" && break
3068
+ done
3069
+ fi
3070
+ if test -z "$CXX"; then
3071
+ ac_ct_CXX=$CXX
3072
+ for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
3073
+ do
3074
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
3075
+ set dummy $ac_prog; ac_word=$2
3076
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3077
+ $as_echo_n "checking for $ac_word... " >&6; }
3078
+ if ${ac_cv_prog_ac_ct_CXX+:} false; then :
3079
+ $as_echo_n "(cached) " >&6
3080
+ else
3081
+ if test -n "$ac_ct_CXX"; then
3082
+ ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
3083
+ else
3084
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3085
+ for as_dir in $PATH
3086
+ do
3087
+ IFS=$as_save_IFS
3088
+ test -z "$as_dir" && as_dir=.
3089
+ for ac_exec_ext in '' $ac_executable_extensions; do
3090
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3091
+ ac_cv_prog_ac_ct_CXX="$ac_prog"
3092
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3093
+ break 2
3094
+ fi
3095
+ done
3096
+ done
3097
+ IFS=$as_save_IFS
3098
+
3099
+ fi
3100
+ fi
3101
+ ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
3102
+ if test -n "$ac_ct_CXX"; then
3103
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
3104
+ $as_echo "$ac_ct_CXX" >&6; }
3105
+ else
3106
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3107
+ $as_echo "no" >&6; }
3108
+ fi
3109
+
3110
+
3111
+ test -n "$ac_ct_CXX" && break
3112
+ done
3113
+
3114
+ if test "x$ac_ct_CXX" = x; then
3115
+ CXX="g++"
3116
+ else
3117
+ case $cross_compiling:$ac_tool_warned in
3118
+ yes:)
3119
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3120
+ $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3121
+ ac_tool_warned=yes ;;
3122
+ esac
3123
+ CXX=$ac_ct_CXX
3124
+ fi
3125
+ fi
3126
+
3127
+ fi
3128
+ fi
3129
+ # Provide some information about the compiler.
3130
+ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
3131
+ set X $ac_compile
3132
+ ac_compiler=$2
3133
+ for ac_option in --version -v -V -qversion; do
3134
+ { { ac_try="$ac_compiler $ac_option >&5"
3135
+ case "(($ac_try" in
3136
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3137
+ *) ac_try_echo=$ac_try;;
3138
+ esac
3139
+ eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3140
+ $as_echo "$ac_try_echo"; } >&5
3141
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
3142
+ ac_status=$?
3143
+ if test -s conftest.err; then
3144
+ sed '10a\
3145
+ ... rest of stderr output deleted ...
3146
+ 10q' conftest.err >conftest.er1
3147
+ cat conftest.er1 >&5
3148
+ fi
3149
+ rm -f conftest.er1 conftest.err
3150
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3151
+ test $ac_status = 0; }
3152
+ done
3153
+
3154
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
3155
+ $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
3156
+ if ${ac_cv_cxx_compiler_gnu+:} false; then :
3157
+ $as_echo_n "(cached) " >&6
3158
+ else
3159
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3160
+ /* end confdefs.h. */
3161
+
3162
+ int
3163
+ main ()
3164
+ {
3165
+ #ifndef __GNUC__
3166
+ choke me
3167
+ #endif
3168
+
3169
+ ;
3170
+ return 0;
3171
+ }
3172
+ _ACEOF
3173
+ if ac_fn_cxx_try_compile "$LINENO"; then :
3174
+ ac_compiler_gnu=yes
3175
+ else
3176
+ ac_compiler_gnu=no
3177
+ fi
3178
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3179
+ ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
3180
+
3181
+ fi
3182
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
3183
+ $as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
3184
+ if test $ac_compiler_gnu = yes; then
3185
+ GXX=yes
3186
+ else
3187
+ GXX=
3188
+ fi
3189
+ ac_test_CXXFLAGS=${CXXFLAGS+set}
3190
+ ac_save_CXXFLAGS=$CXXFLAGS
3191
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
3192
+ $as_echo_n "checking whether $CXX accepts -g... " >&6; }
3193
+ if ${ac_cv_prog_cxx_g+:} false; then :
3194
+ $as_echo_n "(cached) " >&6
3195
+ else
3196
+ ac_save_cxx_werror_flag=$ac_cxx_werror_flag
3197
+ ac_cxx_werror_flag=yes
3198
+ ac_cv_prog_cxx_g=no
3199
+ CXXFLAGS="-g"
3200
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3201
+ /* end confdefs.h. */
3202
+
3203
+ int
3204
+ main ()
3205
+ {
3206
+
3207
+ ;
3208
+ return 0;
3209
+ }
3210
+ _ACEOF
3211
+ if ac_fn_cxx_try_compile "$LINENO"; then :
3212
+ ac_cv_prog_cxx_g=yes
3213
+ else
3214
+ CXXFLAGS=""
3215
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3216
+ /* end confdefs.h. */
3217
+
3218
+ int
3219
+ main ()
3220
+ {
3221
+
3222
+ ;
3223
+ return 0;
3224
+ }
3225
+ _ACEOF
3226
+ if ac_fn_cxx_try_compile "$LINENO"; then :
3227
+
3228
+ else
3229
+ ac_cxx_werror_flag=$ac_save_cxx_werror_flag
3230
+ CXXFLAGS="-g"
3231
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3232
+ /* end confdefs.h. */
3233
+
3234
+ int
3235
+ main ()
3236
+ {
3237
+
3238
+ ;
3239
+ return 0;
3240
+ }
3241
+ _ACEOF
3242
+ if ac_fn_cxx_try_compile "$LINENO"; then :
3243
+ ac_cv_prog_cxx_g=yes
3244
+ fi
3245
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3246
+ fi
3247
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3248
+ fi
3249
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3250
+ ac_cxx_werror_flag=$ac_save_cxx_werror_flag
3251
+ fi
3252
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
3253
+ $as_echo "$ac_cv_prog_cxx_g" >&6; }
3254
+ if test "$ac_test_CXXFLAGS" = set; then
3255
+ CXXFLAGS=$ac_save_CXXFLAGS
3256
+ elif test $ac_cv_prog_cxx_g = yes; then
3257
+ if test "$GXX" = yes; then
3258
+ CXXFLAGS="-g -O2"
3259
+ else
3260
+ CXXFLAGS="-g"
3261
+ fi
3262
+ else
3263
+ if test "$GXX" = yes; then
3264
+ CXXFLAGS="-O2"
3265
+ else
3266
+ CXXFLAGS=
3267
+ fi
3268
+ fi
3269
+ ac_ext=c
3270
+ ac_cpp='$CPP $CPPFLAGS'
3271
+ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3272
+ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3273
+ ac_compiler_gnu=$ac_cv_c_compiler_gnu
3274
+
3275
+ CFLAGS="$saved_cflags"
3276
+ CXXFLAGS="$saved_cxxflags"
2957
3277
 
2958
3278
  # ar and ranlib:
2959
3279
  if test -n "$ac_tool_prefix"; then
@@ -3647,6 +3967,50 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
3647
3967
 
3648
3968
 
3649
3969
 
3970
+ # Cuda compiler:
3971
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nvcc" >&5
3972
+ $as_echo_n "checking for nvcc... " >&6; }
3973
+ saved_cc="$CC"
3974
+ saved_cflags="$CFLAGS"
3975
+ saved_cxxflags="$CXXFLAGS"
3976
+ CC=nvcc
3977
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3978
+ /* end confdefs.h. */
3979
+
3980
+ void
3981
+ f(void)
3982
+ {
3983
+ return;
3984
+ }
3985
+
3986
+ _ACEOF
3987
+ if ac_fn_c_try_compile "$LINENO"; then :
3988
+ have_nvcc=yes
3989
+ else
3990
+ have_nvcc=no
3991
+ fi
3992
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3993
+ CC="$saved_cc"
3994
+ CFLAGS="$saved_cflags"
3995
+ CXXFLAGS="$saved_cxxflags"
3996
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_nvcc" >&5
3997
+ $as_echo "$have_nvcc" >&6; }
3998
+
3999
+ CUDA_CXX=
4000
+ CONFIGURE_CUDA_CXXFLAGS=
4001
+ if test "$have_nvcc" = yes; then
4002
+ if nvcc -o tools/detect_cuda_arch tools/detect_cuda_arch.cc > /dev/null 2>&1; then
4003
+ CUDA_CXX="nvcc"
4004
+ CUDA_ARCH=`./tools/detect_cuda_arch`
4005
+ CONFIGURE_CUDA_CXXFLAGS="-std=c++11 -arch=compute_$CUDA_ARCH -code=sm_$CUDA_ARCH"
4006
+
4007
+ $as_echo "#define HAVE_CUDA 1" >>confdefs.h
4008
+
4009
+ fi
4010
+ fi
4011
+
4012
+
4013
+
3650
4014
  # Add an explicit include directory.
3651
4015
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-includes" >&5
3652
4016
  $as_echo_n "checking for --with-includes... " >&6; }
@@ -3743,7 +4107,7 @@ esac
3743
4107
 
3744
4108
  # Substitute variables and generate output:
3745
4109
  if test -z "$LD"; then
3746
- LD="$CC"
4110
+ LD="$CXX"
3747
4111
  fi
3748
4112
 
3749
4113
 
@@ -3757,6 +4121,12 @@ else
3757
4121
  CONFIGURE_CFLAGS="$GM_INCLUDE $GM_WARN $GM_CONFIG $GM_OPT $CFLAGS"
3758
4122
  fi
3759
4123
 
4124
+ if test -z "$CXXFLAGS"; then
4125
+ CONFIGURE_CXXFLAGS="$XND_INCLUDE -Wall -Wextra -std=c++11 $GM_OPT -g"
4126
+ else
4127
+ CONFIGURE_CXXFLAGS="$XND_INCLUDE -Wall -Wextra -std=c++11 $GM_OPT -g $CXXFLAGS"
4128
+ fi
4129
+
3760
4130
  if test -z "$LDFLAGS"; then
3761
4131
  CONFIGURE_LDFLAGS="$GM_LINK $CONFIGURE_LDFLAGS"
3762
4132
  else
@@ -3766,6 +4136,7 @@ fi
3766
4136
 
3767
4137
 
3768
4138
 
4139
+
3769
4140
  cat >confcache <<\_ACEOF
3770
4141
  # This file is a shell script that caches the results of configure
3771
4142
  # tests run on this system so they can be shared between configure