Commit 2fef882b authored by Nathanael Schaeffer's avatar Nathanael Schaeffer
Browse files

cuda: update python interface to support GPU off-loading through SHT_ALLOW_GPU

parent bc4d5b38
......@@ -68,7 +68,7 @@ DOCUMENTATION:
CHANGE LOG:
-----------
* v2.10 (28 Feb 2018)
* v3.0 (28 Feb 2018)
- support for nvidia Kepler & Pascal GPU with `--enable-cuda` (including automatic offload).
- Java JNI wrapper (beta, see `shtns_jni` folder -- thanks to Julien Pierret).
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for SHTns 2.9.
# Generated by GNU Autoconf 2.69 for SHTns 3.0.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
......@@ -577,8 +577,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='SHTns'
PACKAGE_TARNAME='shtns'
PACKAGE_VERSION='2.9'
PACKAGE_STRING='SHTns 2.9'
PACKAGE_VERSION='3.0'
PACKAGE_STRING='SHTns 3.0'
PACKAGE_BUGREPORT=''
PACKAGE_URL='https://bitbucket.org/nschaeff/shtns'
......@@ -1251,7 +1251,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures SHTns 2.9 to adapt to many kinds of systems.
\`configure' configures SHTns 3.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1312,7 +1312,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of SHTns 2.9:";;
short | recursive ) echo "Configuration of SHTns 3.0:";;
esac
cat <<\_ACEOF
......@@ -1420,7 +1420,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
SHTns configure 2.9
SHTns configure 3.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -1877,7 +1877,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by SHTns $as_me 2.9, which was
It was created by SHTns $as_me 3.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -5412,7 +5412,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by SHTns $as_me 2.9, which was
This file was extended by SHTns $as_me 3.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -5475,7 +5475,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
SHTns config.status 2.9
SHTns config.status 3.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......
......@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.62])
AC_INIT([SHTns],[2.9],[],[shtns],[https://bitbucket.org/nschaeff/shtns])
AC_INIT([SHTns],[3.0],[],[shtns],[https://bitbucket.org/nschaeff/shtns])
AC_LANG([C])
AC_CONFIG_SRCDIR([sht_init.c])
AC_CONFIG_HEADERS([sht_config.h])
......
......@@ -118,6 +118,7 @@ SHT_PHI_CONTIGUOUS = _shtns.SHT_PHI_CONTIGUOUS
SHT_SOUTH_POLE_FIRST = _shtns.SHT_SOUTH_POLE_FIRST
SHT_SCALAR_ONLY = _shtns.SHT_SCALAR_ONLY
SHT_LOAD_SAVE_CFG = _shtns.SHT_LOAD_SAVE_CFG
SHT_ALLOW_GPU = _shtns.SHT_ALLOW_GPU
class sht(_object):
"""Proxy of C shtns_info struct."""
......@@ -147,6 +148,9 @@ class sht(_object):
__swig_getmethods__["nspat"] = _shtns.sht_nspat_get
if _newclass:
nspat = _swig_property(_shtns.sht_nspat_get)
__swig_getmethods__["nlm_cplx"] = _shtns.sht_nlm_cplx_get
if _newclass:
nlm_cplx = _swig_property(_shtns.sht_nlm_cplx_get)
def __init__(self, lmax, mmax=-1, mres=1, norm=sht_orthonormal, nthreads=0):
"""__init__(shtns_info self, int lmax, int mmax=-1, int mres=1, int norm=sht_orthonormal, int nthreads=0) -> sht"""
......@@ -537,6 +541,10 @@ def nlm_calc(lmax, mmax, mres):
"""nlm_calc(long lmax, long mmax, long mres) -> long"""
return _shtns.nlm_calc(lmax, mmax, mres)
def nlm_cplx_calc(lmax, mmax, mres):
"""nlm_cplx_calc(long lmax, long mmax, long mres) -> long"""
return _shtns.nlm_cplx_calc(lmax, mmax, mres)
def set_verbosity(arg1):
"""set_verbosity(int arg1)"""
return _shtns.set_verbosity(arg1)
......
......@@ -3759,6 +3759,28 @@ fail:
}
SWIGINTERN PyObject *_wrap_sht_nlm_cplx_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
struct shtns_info *arg1 = (struct shtns_info *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
unsigned int result;
if (!PyArg_ParseTuple(args,(char *)"O:sht_nlm_cplx_get",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_shtns_info, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sht_nlm_cplx_get" "', argument " "1"" of type '" "struct shtns_info *""'");
}
arg1 = (struct shtns_info *)(argp1);
result = (unsigned int)(unsigned int) ((arg1)->nlm_cplx);
resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_new_sht(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
PyObject *resultobj = 0;
int arg1 ;
......@@ -5605,6 +5627,46 @@ fail:
}
SWIGINTERN PyObject *_wrap_nlm_cplx_calc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
long arg1 ;
long arg2 ;
long arg3 ;
long val1 ;
int ecode1 = 0 ;
long val2 ;
int ecode2 = 0 ;
long val3 ;
int ecode3 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
PyObject * obj2 = 0 ;
long result;
if (!PyArg_ParseTuple(args,(char *)"OOO:nlm_cplx_calc",&obj0,&obj1,&obj2)) SWIG_fail;
ecode1 = SWIG_AsVal_long(obj0, &val1);
if (!SWIG_IsOK(ecode1)) {
SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "nlm_cplx_calc" "', argument " "1"" of type '" "long""'");
}
arg1 = (long)(val1);
ecode2 = SWIG_AsVal_long(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "nlm_cplx_calc" "', argument " "2"" of type '" "long""'");
}
arg2 = (long)(val2);
ecode3 = SWIG_AsVal_long(obj2, &val3);
if (!SWIG_IsOK(ecode3)) {
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "nlm_cplx_calc" "', argument " "3"" of type '" "long""'");
}
arg3 = (long)(val3);
result = (long)nlm_cplx_calc(arg1,arg2,arg3);
resultobj = SWIG_From_long((long)(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_set_verbosity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
int arg1 ;
......@@ -5647,6 +5709,7 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"sht_nphi_get", _wrap_sht_nphi_get, METH_VARARGS, (char *)"sht_nphi_get(sht self) -> unsigned short const"},
{ (char *)"sht_nlat_get", _wrap_sht_nlat_get, METH_VARARGS, (char *)"sht_nlat_get(sht self) -> unsigned short const"},
{ (char *)"sht_nspat_get", _wrap_sht_nspat_get, METH_VARARGS, (char *)"sht_nspat_get(sht self) -> unsigned int const"},
{ (char *)"sht_nlm_cplx_get", _wrap_sht_nlm_cplx_get, METH_VARARGS, (char *)"sht_nlm_cplx_get(sht self) -> unsigned int const"},
{ (char *)"new_sht", (PyCFunction) _wrap_new_sht, METH_VARARGS | METH_KEYWORDS, (char *)"new_sht(int lmax, int mmax=-1, int mres=1, int norm=sht_orthonormal, int nthreads=0) -> sht"},
{ (char *)"delete_sht", _wrap_delete_sht, METH_VARARGS, (char *)"delete_sht(sht self)"},
{ (char *)"sht_set_grid", (PyCFunction) _wrap_sht_set_grid, METH_VARARGS | METH_KEYWORDS, (char *)"sht_set_grid(sht self, int nlat=0, int nphi=0, int flags=sht_quick_init, double polar_opt=1.0e-8, int nl_order=1)"},
......@@ -5691,6 +5754,7 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"sht_SHqst_to_spat_m", _wrap_sht_SHqst_to_spat_m, METH_VARARGS, (char *)"sht_SHqst_to_spat_m(sht self, PyObject * Qlm, PyObject * Slm, PyObject * Tlm, PyObject * Vr, PyObject * Vt, PyObject * Vp, PyObject * im)"},
{ (char *)"sht_swigregister", sht_swigregister, METH_VARARGS, NULL},
{ (char *)"nlm_calc", _wrap_nlm_calc, METH_VARARGS, (char *)"nlm_calc(long lmax, long mmax, long mres) -> long"},
{ (char *)"nlm_cplx_calc", _wrap_nlm_cplx_calc, METH_VARARGS, (char *)"nlm_cplx_calc(long lmax, long mmax, long mres) -> long"},
{ (char *)"set_verbosity", _wrap_set_verbosity, METH_VARARGS, (char *)"set_verbosity(int arg1)"},
{ (char *)"print_version", _wrap_print_version, METH_VARARGS, (char *)"print_version()"},
{ NULL, NULL, 0, NULL }
......@@ -6435,6 +6499,7 @@ SWIG_init(void) {
SWIG_Python_SetConstant(d, "SHT_SOUTH_POLE_FIRST",SWIG_From_int((int)((256*32))));
SWIG_Python_SetConstant(d, "SHT_SCALAR_ONLY",SWIG_From_int((int)((256*16))));
SWIG_Python_SetConstant(d, "SHT_LOAD_SAVE_CFG",SWIG_From_int((int)((256*64))));
SWIG_Python_SetConstant(d, "SHT_ALLOW_GPU",SWIG_From_int((int)((256*128))));
#if PY_VERSION_HEX >= 0x03000000
return m;
#else
......
Supports Markdown
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