問題描述
Numpy 可以針對不同的 BLAS 實現(MKL、ACML、ATLAS、GotoBlas 等)鏈接/編譯".這并不總是很容易配置,但它是可能的.
Numpy can be "linked/compiled" against different BLAS implementations (MKL, ACML, ATLAS, GotoBlas, etc). That's not always straightforward to configure but it is possible.
是否也可以針對 NVIDIA 的 CUBLAS 實現鏈接/編譯"numpy?
我在網絡上找不到任何資源,在我花太多時間嘗試之前,我想確保它完全可行.
Is it also possible to "link/compile" numpy against NVIDIA's CUBLAS implementation?
I couldn't find any resources in the web and before I spend too much time trying it I wanted to make sure that it possible at all.
推薦答案
一句話:不,你不能那樣做.
In a word: no, you can't do that.
有一個相當不錯的 scikit 提供從 scipy 訪問 CUBLAS 的功能,稱為 scikits.cuda
建立在 PyCUDA 之上.PyCUDA 提供了一個類似 numpy.ndarray
的類,它允許使用 CUDA 無縫地操作 GPU 內存中的 numpy 數組.因此,您可以將 CUBLAS 和 CUDA 與 numpy 一起使用,但您不能只鏈接 CUBLAS 并期望它能夠工作.
There is a rather good scikit which provides access to CUBLAS from scipy called scikits.cuda
which is built on top of PyCUDA. PyCUDA provides a numpy.ndarray
like class which seamlessly allows manipulation of numpy arrays in GPU memory with CUDA. So you can use CUBLAS and CUDA with numpy, but you can't just link against CUBLAS and expect it to work.
還有一個商業庫,它提供類似 numpy 和 cublas 的功能,并且具有 Python 接口或綁定,但我將把它留給他們的一個工人來填補.
There is also a commercial library that provides numpy and cublas like functionality and which has a Python interface or bindings, but I will leave it to one of their shills to fill you in on that.
這篇關于Numpy、BLAS 和 CUBLAS的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!