So I'm using the OpenCL API in Julia, and when I run the following code:
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 or so coordinates are now zeroed out upon reading back onto the host. Can anyone reproduce this on their machine? Here are my specs:
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
My MAX_MEM_ALLOC_SIZE is only 0.4GB, which could be what is causing this, since a
is larger than that.
However I'm encountering this problem with memory sizes < 0.4GB, unfortunately I cannot reproduce them consistently, they appear to depend in some bizarre way on other buffers which are loaded into device memory.
Is there a way to reset the device memory?