Created
June 21, 2021 17:41
-
-
Save cycomanic/a0b16ab0c45b3d888a818d17a021b27b to your computer and use it in GitHub Desktop.
pythran generated cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define PY_MAJOR_VERSION 3 | |
#undef ENABLE_PYTHON_MODULE | |
#include <pythonic/core.hpp> | |
#include <pythonic/python/core.hpp> | |
#include <pythonic/types/bool.hpp> | |
#include <pythonic/types/int.hpp> | |
#ifdef _OPENMP | |
#include <omp.h> | |
#endif | |
#include <pythonic/include/types/int.hpp> | |
#include <pythonic/types/int.hpp> | |
#include <pythonic/include/builtins/None.hpp> | |
#include <pythonic/include/builtins/tuple.hpp> | |
#include <pythonic/include/numpy/exp.hpp> | |
#include <pythonic/include/numpy/linspace.hpp> | |
#include <pythonic/include/numpy/sqrt.hpp> | |
#include <pythonic/include/numpy/square.hpp> | |
#include <pythonic/include/operator_/add.hpp> | |
#include <pythonic/include/operator_/mul.hpp> | |
#include <pythonic/include/types/complex.hpp> | |
#include <pythonic/include/types/slice.hpp> | |
#include <pythonic/builtins/None.hpp> | |
#include <pythonic/builtins/tuple.hpp> | |
#include <pythonic/numpy/exp.hpp> | |
#include <pythonic/numpy/linspace.hpp> | |
#include <pythonic/numpy/sqrt.hpp> | |
#include <pythonic/numpy/square.hpp> | |
#include <pythonic/operator_/add.hpp> | |
#include <pythonic/operator_/mul.hpp> | |
#include <pythonic/types/complex.hpp> | |
#include <pythonic/types/slice.hpp> | |
namespace __pythran_eval_exp | |
{ | |
struct eval_exp_vec | |
{ | |
typedef void callable; | |
typedef void pure; | |
template <typename argument_type0 > | |
struct type | |
{ | |
typedef typename std::remove_cv<typename std::remove_reference<decltype(pythonic::numpy::functor::exp{})>::type>::type __type0; | |
typedef std::complex<double> __type1; | |
typedef typename std::remove_cv<typename std::remove_reference<decltype(pythonic::numpy::functor::sqrt{})>::type>::type __type2; | |
typedef typename std::remove_cv<typename std::remove_reference<decltype(pythonic::numpy::functor::square{})>::type>::type __type3; | |
typedef typename std::remove_cv<typename std::remove_reference<decltype(pythonic::numpy::functor::linspace{})>::type>::type __type4; | |
typedef long __type5; | |
typedef double __type6; | |
typedef typename std::remove_cv<typename std::remove_reference<argument_type0>::type>::type __type7; | |
typedef typename pythonic::assignable<decltype(std::declval<__type4>()(std::declval<__type5>(), std::declval<__type6>(), std::declval<__type7>()))>::type __type8; | |
typedef pythonic::types::contiguous_slice __type9; | |
typedef pythonic::types::none_type __type10; | |
typedef decltype(std::declval<__type8>()(std::declval<__type9>(), std::declval<__type10>())) __type11; | |
typedef decltype(std::declval<__type3>()(std::declval<__type11>())) __type12; | |
typedef decltype(std::declval<__type8>()(std::declval<__type10>(), std::declval<__type9>())) __type14; | |
typedef decltype(std::declval<__type3>()(std::declval<__type14>())) __type15; | |
typedef decltype(pythonic::operator_::add(std::declval<__type12>(), std::declval<__type15>())) __type16; | |
typedef decltype(std::declval<__type2>()(std::declval<__type16>())) __type17; | |
typedef decltype(pythonic::operator_::mul(std::declval<__type1>(), std::declval<__type17>())) __type18; | |
typedef typename pythonic::returnable<decltype(std::declval<__type0>()(std::declval<__type18>()))>::type result_type; | |
} | |
; | |
template <typename argument_type0 > | |
typename type<argument_type0>::result_type operator()(argument_type0&& N) const | |
; | |
} ; | |
template <typename argument_type0 > | |
typename eval_exp_vec::type<argument_type0>::result_type eval_exp_vec::operator()(argument_type0&& N) const | |
{ | |
typename pythonic::assignable_noescape<decltype(pythonic::numpy::functor::linspace{}(0L, 6.283185307179586, N))>::type a = pythonic::numpy::functor::linspace{}(0L, 6.283185307179586, N); | |
return pythonic::numpy::functor::exp{}(pythonic::operator_::mul(std::complex<double>(0.0, 100.0), pythonic::numpy::functor::sqrt{}(pythonic::operator_::add(pythonic::numpy::functor::square{}(a(pythonic::types::contiguous_slice(pythonic::builtins::None,pythonic::builtins::None),pythonic::builtins::None)), pythonic::numpy::functor::square{}(a(pythonic::builtins::None,pythonic::types::contiguous_slice(pythonic::builtins::None,pythonic::builtins::None))))))); | |
} | |
} | |
#include <pythonic/python/exception_handler.hpp> | |
#ifdef ENABLE_PYTHON_MODULE | |
typename __pythran_eval_exp::eval_exp_vec::type<long>::result_type eval_exp_vec0(long&& N) | |
{ | |
PyThreadState *_save = PyEval_SaveThread(); | |
try { | |
auto res = __pythran_eval_exp::eval_exp_vec()(N); | |
PyEval_RestoreThread(_save); | |
return res; | |
} | |
catch(...) { | |
PyEval_RestoreThread(_save); | |
throw; | |
} | |
; | |
} | |
static PyObject * | |
__pythran_wrap_eval_exp_vec0(PyObject *self, PyObject *args, PyObject *kw) | |
{ | |
PyObject* args_obj[1+1]; | |
char const* keywords[] = {"N", nullptr}; | |
if(! PyArg_ParseTupleAndKeywords(args, kw, "O", | |
(char**)keywords , &args_obj[0])) | |
return nullptr; | |
if(is_convertible<long>(args_obj[0])) | |
return to_python(eval_exp_vec0(from_python<long>(args_obj[0]))); | |
else { | |
return nullptr; | |
} | |
} | |
static PyObject * | |
__pythran_wrapall_eval_exp_vec(PyObject *self, PyObject *args, PyObject *kw) | |
{ | |
return pythonic::handle_python_exception([self, args, kw]() | |
-> PyObject* { | |
if(PyObject* obj = __pythran_wrap_eval_exp_vec0(self, args, kw)) | |
return obj; | |
PyErr_Clear(); | |
return pythonic::python::raise_invalid_argument( | |
"eval_exp_vec", "\n"" - eval_exp_vec(int)", args, kw); | |
}); | |
} | |
static PyMethodDef Methods[] = { | |
{ | |
"eval_exp_vec", | |
(PyCFunction)__pythran_wrapall_eval_exp_vec, | |
METH_VARARGS | METH_KEYWORDS, | |
"Supported prototypes:\n""\n"" - eval_exp_vec(int)"}, | |
{NULL, NULL, 0, NULL} | |
}; | |
#if PY_MAJOR_VERSION >= 3 | |
static struct PyModuleDef moduledef = { | |
PyModuleDef_HEAD_INIT, | |
"eval_exp", /* m_name */ | |
"", /* m_doc */ | |
-1, /* m_size */ | |
Methods, /* m_methods */ | |
NULL, /* m_reload */ | |
NULL, /* m_traverse */ | |
NULL, /* m_clear */ | |
NULL, /* m_free */ | |
}; | |
#define PYTHRAN_RETURN return theModule | |
#define PYTHRAN_MODULE_INIT(s) PyInit_##s | |
#else | |
#define PYTHRAN_RETURN return | |
#define PYTHRAN_MODULE_INIT(s) init##s | |
#endif | |
PyMODINIT_FUNC | |
PYTHRAN_MODULE_INIT(eval_exp)(void) | |
#ifndef _WIN32 | |
__attribute__ ((visibility("default"))) | |
__attribute__ ((externally_visible)) | |
#endif | |
; | |
PyMODINIT_FUNC | |
PYTHRAN_MODULE_INIT(eval_exp)(void) { | |
import_array() | |
#if PY_MAJOR_VERSION >= 3 | |
PyObject* theModule = PyModule_Create(&moduledef); | |
#else | |
PyObject* theModule = Py_InitModule3("eval_exp", | |
Methods, | |
"" | |
); | |
#endif | |
if(! theModule) | |
PYTHRAN_RETURN; | |
PyObject * theDoc = Py_BuildValue("(sss)", | |
"0.9.10", | |
"2021-06-21 19:41:12.683781", | |
"2b3f855f7b05e82c69b5200349a28f92b63cd8f2befb4a592ae9aa66da5bf39e"); | |
if(! theDoc) | |
PYTHRAN_RETURN; | |
PyModule_AddObject(theModule, | |
"__pythran__", | |
theDoc); | |
PYTHRAN_RETURN; | |
} | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment