我的代码在这里:
import numpy as np
from numbapro import cuda
@cuda.autojit
def child_launch(data):
data[cuda.threadIdx.x] = data[cuda.threadIdx.x] + 100
@cuda.autojit
def parent_launch(data):
data[cuda.threadIdx.x] = cuda.threadIdx.x
cuda.syncthreads()
if cuda.threadIdx.x == 0:
child_launch[1, 256](data)
cuda.synchronize()
cuda.syncthreads()
data = np.zeros(256)
print data
parent_launch[ 1, 256 ](data)
print data
运行结果如下:
Traceback (most recent call last):
......
numba.typeinfer.TypingError: Untyped global name 'child_launch'
File "PythonOpenMPTestMain.py", line 14
我只是不知道为什么我无法启动子内核。请帮我。非常感谢。
最佳答案
I just don't know why I can't launch the child kernel.
因为它不受支持(即使在 2018 年中期)。
引用自 Numba 0.39 documentation
Numba does not implement all features of CUDA, yet. Some missing features are listed below:
- dynamic parallelism
- texture memory
关于python - numba.typeinfer.TypingError : Untyped global name 'child_launch' when using CUDA Dynamic Parallelism in Python ( Anaconda ) on NVIDIA GPU,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26335037/