File tree Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Original file line number Diff line number Diff line change 1
1
$export CUDA_LAUNCH_BLOCKING=1
2
- ��������֮�����к˺����ĵ��ö��������첽�ģ� ����ͬ���ġ�
3
- ��Ӱ��������ܣ�
2
+ 这样设置之后,所有核函数的调用都不再是异步的, 而是同步的。
3
+ 会影响程序性能,
4
4
5
5
error.cuh:
6
6
21
21
}\
22
22
}while(0);
23
23
24
- CUDA�Դ���鹤�� CUDA-MEMCHECK
24
+ CUDA自带检查工具集 CUDA-MEMCHECK
25
25
$ cuda-memcheck --tool memcheck [options] app_name [options]
26
26
$ cuda-memcheck --tool racecheck [options] app_name [options]
27
27
$ cuda-memcheck --tool initcheck [options] app_name [options]
28
28
$ cuda-memcheck --tool synccheck [options] app_name [options]
29
29
30
- memcheck���߿���ʡ�� --tool memcheck
31
- ��Ϊ :
30
+ memcheck工具可以省略 --tool memcheck
31
+ 变为 :
32
32
$ cuda-memcheck [options] app_name [options]
33
33
34
- �� $ cuda-memcheck ./a.out
34
+ 如 $ cuda-memcheck ./a.out
35
35
36
36
$ nvprof ./a.out
37
- �������������ʱ�������������µĴ�����ʾ��
38
- 54 CUDA ��̣�������ʵ��
37
+ 如果用上述命令时遇到了类似如下的错误提示:
38
+ 54 CUDA 编程:基础与实践
39
39
Unable to profile application. Unified Memory profiling failed
40
- ����Գ��Խ��������Ϊ��
40
+ 则可以尝试将运行命令换为:
41
41
$ nvprof --unified-memory-profiling off ./a.out
42
42
43
- ���GPU���ٱȵİ취��
44
- �����������豸֮������ݴ��䣻
45
- ��ߺ˺���������ǿ�ȣ�
46
- ����˺����IJ��й�ģ��
43
+ 提高GPU加速比的办法:
44
+ 减少主机与设备之间的数据传输;
45
+ 提高核函数的算术强度;
46
+ 增大核函数的并行规模。
47
47
48
- һ�� GPU һ������פ������ʮ����̡߳����һ���˺����ж�����߳���ĿԶС��������Ļ����Ͳ�����
49
- �õ��ܸߵļ��ٱȡ�
48
+ 一块 GPU 一共可以驻留几万到几十万个线程。如果一个核函数中定义的线程数目远小于这个数的话,就不可能
49
+ 得到很高的加速比。
You can’t perform that action at this time.
0 commit comments