cuda内核不执行所有的blockIdx
cuda kernel not executed for all blockIdx
我在我的代码中隔离了一个bug,我不知道我做错了什么。当我执行以下代码时,CUDA内核不会对所有块执行。
#include <stdio.h>
__global__
void dummy_test_kernel()
{
printf("grid = (%i, %i, %i), block = (%i, %i, %i),
bid (%i,%i,%i), tid (%i, %i, %i)n",
gridDim.x, gridDim.y, gridDim.z,
blockDim.x, blockDim.y, blockDim.z,
blockIdx.x, blockIdx.y, blockIdx.z,
threadIdx.x, threadIdx.y, threadIdx.z );
}
int main( int argc, char* argv[] )
{
(void)argc;
(void)argv;
dummy_test_kernel<<<62,256>>>();
if(cudaDeviceSynchronize())
printf("something went wrong in the kernel executionn");
return 0;
}
例如,我从来没有见过带有blockIdx的块。x & lt;20打印任何东西。如果这可能有助于找出我的错误,以下是在CUDA示例中发现的deviceQuery返回的信息:
Device 0: "GeForce GTX 675M"
CUDA Driver Version / Runtime Version 7.5 / 7.0
CUDA Capability Major/Minor version number: 2.1
Total amount of global memory: 2048 MBytes (2147155968 bytes)
( 8) Multiprocessors, ( 48) CUDA Cores/MP: 384 CUDA Cores
GPU Max Clock rate: 1240 MHz (1.24 GHz)
Memory Clock rate: 1500 Mhz
Memory Bus Width: 256-bit
L2 Cache Size: 524288 bytes
Maximum Texture Dimension Size (x,y,z) 1D=(65536), 2D=(65536, 65535), 3D=(2048, 2048, 2048)
Maximum Layered 1D Texture Size, (num) layers 1D=(16384), 2048 layers
Maximum Layered 2D Texture Size, (num) layers 2D=(16384, 16384), 2048 layers
Total amount of constant memory: 65536 bytes
Total amount of shared memory per block: 49152 bytes
Total number of registers available per block: 32768
Warp size: 32
Maximum number of threads per multiprocessor: 1536
Maximum number of threads per block: 1024
Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
Max dimension size of a grid size (x,y,z): (65535, 65535, 65535)
Maximum memory pitch: 2147483647 bytes
Texture alignment: 512 bytes
Concurrent copy and kernel execution: Yes with 1 copy engine(s)
Run time limit on kernels: No
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Disabled
Device supports Unified Addressing (UVA): Yes
Device PCI Domain ID / Bus ID / location ID: 0 / 1 / 0
Compute Mode:
< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >
谁能帮我解决这个问题? - 尝试打印 cudadevicesynize 给出的错误
- 尝试使用cuda-memcheck ./program 执行你的代码
- 如果点2)返回错误,使用cuda-gdb调试它。 你正在启动一个由62个线程块组成的1D内核,每个线程块有256个线程。我希望你的输出是网格(62,1,1)块(256,1,1)出价(b_x, 1,1) tid (t_x,1,1)
相关文章:
- 在执行其他功能的同时播放动画(LED矩阵和Arduino/ESP8266)
- C++,系统无法执行指定的程序
- 使用C++中的模板和运算符重载执行矩阵运算
- 创建一个函数以在输入为负数或零时输出字符串.第一次执行用户定义的函数
- 执行函数时导致崩溃的变量
- 无论条件是否为true,if总是在c++中执行
- 当函数模板参数是具有默认参数的类模板时,函数模板参数的推导如何执行
- 在C++中对T*类型执行std::move的意外行为
- 使用QProcess执行命令,并将结果存储在QStringList中
- 如何在没有信号的情况下从C++执行QML插槽
- 如何确认我的constexpr表达式实际上已经在编译时执行
- C++17中的并行执行策略
- QML按钮点击功能执行顺序
- 程序在执行程序的其余部分之前退出
- 为什么catch中的代码没有被执行
- C++从其他 constexpr 创建 lambda 不能按顺序执行 Constexpr
- 将执行、作业和WinAPI相乘
- 对字符数组中的元素执行逐位操作
- 为什么g++在未执行的代码处标记强制转换错误
- cuda内核不执行所有的blockIdx