OpenCL没有将所有数据读回缓冲区

时间:2016-08-05 18:17:48

标签: opencl julia julia-gpu

所以我在Julia中使用OpenCL API,当我运行以下代码时:

using OpenCL
device, context, queue = OpenCL.create_compute_context()

a = rand(Float32, 125356789)
abuf = OpenCL.Buffer(Float32, context, (:r, :copy), hostbuf=a)
b = OpenCL.read(queue, abuf)
isapprox(a, b)

当读回主机时,50个左右的坐标现在归零。有人可以在他们的机器上重现这个吗?这是我的规格:

Version: 10.14.73

Last Modified: 4/26/16, 12:39 AM

Bundle ID: com.apple.driver.AppleIntelHD4000Graphics

Loaded: Yes

Get Info String: AppleIntelHD4000Graphics 10.14.73

Obtained from: Apple

Kind: Intel

Architectures: x86_64

64-Bit (Intel): Yes

Location: /System/Library/Extensions/AppleIntelHD4000Graphics.kext

Kext Version: 10.1.4

Load Address: 18446743521850200000

Loadable: Yes

Dependencies: Satisfied

Signed by: Software Signing, Apple Code Signing Certification Authority, Apple Root CA

我的MAX_MEM_ALLOC_SIZE只有0.4GB,这可能是造成这种情况的原因,因为a大于此值。

然而,我遇到了内存大小< 0.4GB,遗憾的是我无法一致地重现它们,它们似乎以某种奇怪的方式依赖于加载到设备内存中的其他缓冲区。

有没有办法重置设备内存?

0 个答案:

没有答案