如果您想编写一个返回多个数组的设备函数,有谁知道 cuda.jit 装饰器的正确语法是什么?
如果我的设备函数应该返回一个浮点数并有两个整数参数,我的装饰器将是:
@cuda.jit('float64(int64,int64)', device=True, inline=True)
现在我希望我的函数采用两个整数参数和两个浮点数,并返回 2 个浮点数组和 2 个整数数组,长度相同(3 到 5 之间),这取决于输入参数。我怎么做?那是否正确:
@cuda.jit(restype=[float64[:], int64[:], float64[:], int64[:]], argtypes=[int64, int64, float64, float64], device=True, inline = True)
同样在我的函数中,我将创建我想要返回的数组:cuda.local.array()
因为我使用 inline=True 我会怀疑这会起作用,并且数组只能由相应的线程访问,对吧?