我目前正在做一个 python 项目,我想利用 GPU 进行一些计算.
I am currently working on a project in python, and I would like to make use of the GPU for some calculations.
乍一看似乎有很多可用的工具;乍一看,我觉得我错过了什么.
At first glance it seems like there are many tools available; at second glance, I feel like im missing something.
Copperhead 看起来很棒,但尚未发布.我似乎仅限于编写低级 CUDA 或 openCL 内核;没有推力,没有cudpp.如果我想整理一些东西,我必须自己做.
Copperhead looks awesome but has not yet been released. It would appear that im limited to writing low-level CUDA or openCL kernels; no thrust, no cudpp. If id like to have something sorted, im going to have to do it myself.
这对我来说似乎不太正确.我真的错过了什么吗?还是这种 GPU 脚本还没有达到宣传的效果?
That doesnt seem quite right to me. Am I indeed missing something? Or is this GPU-scripting not quite living up to the hype yet?
GPULIB 似乎是我需要的.文档很简陋,python 绑定只是顺便提及,但我现在正在申请下载链接.任何人都有这方面的经验,或者有类似的免费学术使用 GPU 库的链接?重新好的,python 绑定实际上不存在.
GPULIB seems like it might be what I need. Documentation is rudimentary, and the python bindings are mentioned only in passing, but im applying for a download link right now. Anyone has experience with that, or links to similar free-for-academic-use GPU libraries? Re ok, python bindings are infact nonexistant.
Edit2:所以我想我最好的选择是在 C/CUDA 中编写一些东西并从 python 中调用它?
So I guess my best bet is to write something in C/CUDA and call that from python?
PyCUDA 提供了非常好的与 CUDA 集成,并具有多个帮助接口,使编写 CUDA 代码比在直接 C api 中更容易.Here 是来自 Wiki 的一个示例,它完全不需要任何 C 代码就可以进行 2D FFT.
PyCUDA provides very good integration with CUDA and has several helper interfaces to make writing CUDA code easier than in the straight C api. Here is an example from the Wiki which does a 2D FFT without needing any C code at all.
这篇关于Python GPU 编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
使用 python 解析非常大的 xml 文件时出现问题Troubles while parsing with python very large xml file(使用 python 解析非常大的 xml 文件时出现问题)
使用 Python 2 在 XML 中按属性查找所有节点Find all nodes by attribute in XML using Python 2(使用 Python 2 在 XML 中按属性查找所有节点)
Python - 如何解析 xml 响应并将元素值存储在变量中Python - How to parse xml response and store a elements value in a variable?(Python - 如何解析 xml 响应并将元素值存储在变量中?)
如何在 Python 中获取 XML 标记值How to get XML tag value in Python(如何在 Python 中获取 XML 标记值)
如何使用 ElementTree 正确解析 utf-8 xml?How to correctly parse utf-8 xml with ElementTree?(如何使用 ElementTree 正确解析 utf-8 xml?)
将 XML 从 URL 解析为 python 对象Parse XML from URL into python object(将 XML 从 URL 解析为 python 对象)