提交 ea16db87 编写于 作者: W wizardforcel

Merge branch 'master' of https://github.com/apachecn/numba-doc-zh

......@@ -62,7 +62,7 @@ increment_by_one[blockspergrid, threadsperblock](an_array)
运行内核时,每个线程执行一次内核函数的代码。因此,它必须知道它所在的线程,以便知道它负责哪个数组元素(复杂的算法可能定义更复杂的责任,但基本原理是相同的)。
一种方法是让线程确定它在网格中的位置并阻塞并手动计算相应的数组位置:
一种方法是让线程定位它在网格和块中的位置,并手动计算在数组中对应的位置:
```py
@cuda.jit
......@@ -165,4 +165,4 @@ increment_a_2D_array[blockspergrid, threadsperblock](an_array)
### 3.2.4.2。进一步阅读
有关 CUDA 编程的详细讨论,请参见 [CUDA C 编程指南](http://docs.nvidia.com/cuda/cuda-c-programming-guide)
\ No newline at end of file
有关 CUDA 编程的详细讨论,请参见 [CUDA C 编程指南](http://docs.nvidia.com/cuda/cuda-c-programming-guide)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册