使用numba将函数传递给CUDA块 [英] Passing functions to CUDA blocks with numba

查看:205
本文介绍了使用numba将函数传递给CUDA块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用numba库在python中工作,想知道是否有解决方案可以编写以前工作的并行版本。我有一个函数f(X,S,F),其中X和S是标量数组,而F是函数列表。

I am working in python with the numba library and wondered if there is a solution to write a parallel version of a previous work. I have a function f(X, S, F) where X and S are scalar arrays, and F is a list of functions.

我几乎可以确定,numba(通常是cuda)无法传递函数数组。有什么替代解决方案?

I am almost sure that passing an array of functions is not possible with numba (and cuda in general?). What would be an alternative solution to this? If there is one.

在此先感谢您的帮助

推荐答案

Numba CUDA Python实现目前不支持内核中的任何类型的函数指针或对象。因此,您不可能有雄心壮志。

The Numba CUDA Python implementation presently doesn't support any sort of function pointer or objects within kernels. So what you would have ambitions to do is not possible.

这篇关于使用numba将函数传递给CUDA块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆