opencl - 等效于 OpenCL 的 Valgrind

标签 opencl gpu valgrind gpgpu

要检查 CPU 上的内存访问冲突,有 Valgrind/memcheck;对于 GPU 上的 CUDA 代码,有 CUDA memcheck .是否有与这些 OpenCL 工具等效的工具?

最佳答案

现在有一个名为 Oclgrind 的 OpenCL 设备模拟器它以与 Valgrind 类似的方式工作,提供“memcheck”功能(除其他外)。

它是开源的,并且有适用于各种平台的二进制构建。和 Valgrind 一样,它并不快,但使用起来非常简单:

$ oclgrind ./myapp

Invalid write of size 4 at global memory address 0x3000000000010
    Kernel: write_out_of_bounds
    Entity: Global(4,0,0) Local(4,0,0) Group(0,0,0)
     store i32 %tmp15, i32 addrspace(1)* %tmp19, align 4, !dbg !24
    At line 4 of input.cl:
        c[i] = a[i] + b[i]

关于opencl - 等效于 OpenCL 的 Valgrind,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18499768/

相关文章:

c++ - 是否可以在 GPU 中运行一段纯 C++ 代码

c++ - 如何避免变量的 __attribute__((weak)) 多重定义错误? [cl2.hpp]

opencv - OpenCL :Access proper index by using globalid(.)

cuda 添加 float 组

c++ - Valgrind 不显示数组复制错误?

c - 这个 valgrind 输出是否意味着存在内存泄漏? (重命名问题)

c - valgrind 发现无效写入和读取的数量令人难以置信

opencl - OpenCL 中 image2d_t 和 image2d_array_t 有什么区别?

c++ - tex1Dfetch 意外返回 0

deep-learning - 如何从系统 RAM 扩展 tensorflow 的 GPU 内存