Skip to content

Instantly share code, notes, and snippets.

@bjodah
Created November 20, 2014 13:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjodah/7f3c9725e2fad7c41eb1 to your computer and use it in GitHub Desktop.
Save bjodah/7f3c9725e2fad7c41eb1 to your computer and use it in GitHub Desktop.
Compiler crash when gdb_debug=True and multiple tempate typenames are used.
# -*- coding: utf-8 -*-
# distutils: language = c++
from func cimport func as _func
def func(double inp):
cdef double out
_func[double, double](&inp, &out);
return out;
namespace myfunc {
template<typename T, typename U>
void func(const T * const in, U * const out){
*out = 2*(*in);
}
}
cdef extern from "func.h" namespace "myfunc":
cdef void func[T, U](const T * const, U * const)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from _func import func
if __name__ == '__main__':
print(func(3))
from distutils.core import setup
from Cython.Build import cythonize
ext_mod = cythonize("_func.pyx", gdb_debug=True)
setup(
ext_modules = ext_mod
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment