python函数返回没有GIL错误的指针
Cython function returning pointer without GIL error
我不明白为什么这不能编译。_svd返回双精度*,我将其赋值为双精度*。
错误信息:如果没有GIL, Python不允许强制转换
cpdef svd(A_f, m, n):
cdef double *S_p
with nogil:
S_p = _svd(A_f, m, n)
return <double[:min(m, n)]> S_p
cdef double* _svd(double[:] A_f, int m, int n) nogil:
#code removed bc it is long
编辑:它与GIL一起工作,但我想在没有GIL的情况下调用它。
试试这个
cpdef svd(A_f, int m, int n):
cdef double *S_p
cdef double[:] abc = A_f
with nogil:
S_p = _svd(abc , m, n)
相关文章:
- 删除指向指针的指针是运行时错误吗
- c++中的指针和运行时错误
- 运行几次后合并段错误C++(指针算术)
- LinkedList实现C 错误指针间接
- 虚幻引擎 4.18.0,VS2017,不允许指向不完整类类型的错误指针
- Xcode 错误:指针和双精度之间的比较
- 未分配正在释放的本机node.js插件错误指针
- 错误指针:解析令牌时无法计算表达式
- C++-va_list错误指针
- 为什么我收到错误" (指针的名称)不是模板)?
- mmap 错误:分段错误/指针无效错误
- C++ Winsock2 错误指针断点触发
- C++ 代码中的错误指针错误
- 数组错误指针上的增量运算符
- MAKEINTRESOURCE 返回资源 ID 的错误指针
- 分段错误C++指针
- 段错误指针
- C++ 错误 :: 指针数组的EXC_BAD_ACCESS
- 通过模糊 mat 从 std::vector: <int>cv::Exception 中获取错误指针
- 正在解决编译器错误:指针可能未初始化