go-opencl
go-opencl copied to clipboard
Is there a way to read from a portion of a buffer?
I wrote a buffer using queue.EnqueueWriteBufferFloat32. Is there a way for me to read/write to an index of the buffer without copying the whole buffer into and out of RAM? Thank you!
I tried using something like this
buffMap, _, err := queue.EnqueueMapBuffer(out, true, cl.MapFlagRead, 177*8, 8, nil)
handle(err)
fmt.Println(buffMap.ByteSlice())
_, err = queue.EnqueueUnmapMemObject(out, buffMap, nil)
handle(err)
The 177th Element was 0.42806938, and this returned [131 255 48 62 91 253 26 60]. Is there a correlation in between these? Is there a way to convert between them?