Numpy、BLAS 和 CUBLAS

2023-01-25Python开发问题
30

本文介绍了Numpy、BLAS 和 CUBLAS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

pandas 有从特定日期开始的按月分组的方式吗?
Is there a way of group by month in Pandas starting at specific day number?( pandas 有从特定日期开始的按月分组的方式吗?)...
2024-08-22 Python开发问题
10

通过在不与其他值冲突的情况下追加值来生成序列
Generate a sequence by appending values without clash in other values(通过在不与其他值冲突的情况下追加值来生成序列)...
2024-08-22 Python开发问题
7

使用MALLOC_MMAP_THRESHOLD_和MALLOC_MMAP_MAX_减少内存碎片
Reduce memory fragmentation with MALLOC_MMAP_THRESHOLD_ and MALLOC_MMAP_MAX_(使用MALLOC_MMAP_THRESHOLD_和MALLOC_MMAP_MAX_减少内存碎片)...
2024-08-22 Python开发问题
40

如何在Pandas中连接包含List(Series)的两列
How to concatenate two columns containing list (series) in Pandas(如何在Pandas中连接包含List(Series)的两列)...
2024-08-22 Python开发问题
2

我怎么才能让这个机器人连续运行呢?
How do I make this bot run continuously?(我怎么才能让这个机器人连续运行呢?)...
2024-08-22 Python开发问题
17

如何使用Telegram Python机器人发送粗体文本
How to send bold text using Telegram Python bot(如何使用Telegram Python机器人发送粗体文本)...
2024-08-22 Python开发问题
9