-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
For the ComputeBuffer constructor which takes a T[] data parameter, the array is pinned only for the duration of the call to clCreateBuffer. This appears to be fine if using CopyHostPointer, but is a bug when using UseHostPointer. This is because there's no guarantee that the array won't be moved by GC. Note that a fix to this will also handle the case that's given in the remark, about immediate parameters not working.
Steps to reproduce incorrect behavior:
- Create some temporary objects on the small object heap.
- Create some smallish arrays (< 85k bytes, so they go on the small object heap, so they will be candidates for compaction).
- Create compute buffers from these arrays, using the flag
UseHostPointer. - Create a lot of temporary objects on the small object heap, enough to cause a GC and compaction. The compaction will move your buffer arrays.
- Execute a kernel, and observe that the data isn't correct.
Metadata
Metadata
Assignees
Labels
No labels