固定内存OpenCL,有人成功使用它吗? [英] Pinned memory OpenCL, has anybody successfully used it?

查看:281
本文介绍了固定内存OpenCL,有人成功使用它吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用 clCreateBuffer 调用使用 CL_MEM_ALLOC_HOST_PTR 标志,但Compute Profiler显示所有我的主机内存传输类型为Pageable。我尝试在两个不同的内核设置,但分析器不会显示我正在使用固定的内存。

I used the CL_MEM_ALLOC_HOST_PTR flag with my clCreateBuffer calls, but the Compute Profiler shows all my "host mem transfer type" as being Pageable. I tried it in two different kernel setups, but the profiler wouldn't show that I was using pinned memory.

这是真的随机当一个内核使用pinned记忆?它是否受到某些东西的限制?我猜的缓冲区大小的事情。我试了一个大小为10000浮点的缓冲区,我还有pageable内存。让我知道你的想法。

Is it just really random when a kernel gets to use pinned memory? Is it constrained by something? I am guessing the size of the buffer matters. I tried one buffer of a size of 10,000 floats and I still got Pageable memory. Let me know what you all think.

推荐答案

如果你检查OpenCL编程指南(3.1) 1,OpenCL现在对内存对象的控制被分配为固定或不分配。您只能使用CL_MEM_ALLOC_HOST_PTR来创建它们。

If you check the OpenCL programming guide (3.1) it is mentioned in section 3.3.1 that OpenCL has now control over memory objects are allocated pinned or not. You can only TRY to create them using CL_MEM_ALLOC_HOST_PTR.

这篇关于固定内存OpenCL,有人成功使用它吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆