We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent de59952 commit 1164c9cCopy full SHA for 1164c9c
Tensors/src/main/scala/com/thoughtworks/compute/Tensors.scala
@@ -69,7 +69,15 @@ trait Tensors extends OpenCL {
69
def buffer: DeviceBuffer[Float]
70
71
def toHostBuffer = {
72
- buffer.toHostBuffer(event)
+ // We want to read buffer after `event` complete.
73
+ // According to OpenCL's specification, we should pass the `event` as an `event_wait_list` to `clEnqueueReadBuffer`.
74
+ // Unfortunately it seems not work on AMD SDK
75
+ // buffer.toHostBuffer(event)
76
+ //
77
+ // Instead, we have to wait the event then call `clEnqueueReadBuffer`:
78
+ Do.garbageCollected(event.waitForComplete()) >> buffer.toHostBuffer(event)
79
+
80
+ // TODO: find other solution instead of this workaround
81
}
82
83
object Tensor {
0 commit comments