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 efdcf84Copy full SHA for efdcf84
Tensors/src/main/scala/com/thoughtworks/compute/Tensors.scala
@@ -69,7 +69,14 @@ 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
+ event.waitForComplete() >> buffer.toHostBuffer(event)
79
+
80
}
81
82
object Tensor {
0 commit comments