TestVM for SPIR-V fixed
@@ -79,15 +79,22 @@ public class TestVM {
GlobalObjectState stateC = new GlobalObjectState();
DeviceObjectState objectStateC = stateC.getDeviceState(device);
- // Copy-in buffer
+ // Allocate a
+ device.allocate(a, 0, objectStateA);
+
+ // Copy-in buffer A
device.ensurePresent(a, objectStateA, null, 0, 0);
// Allocate buffer B
device.allocate(b, 0, objectStateB);
- // Stream IN
+ // Allocate buffer c
+ device.allocate(c, 0, objectStateC);
+
+ // Stream IN buffer C
device.streamIn(c, 0, 0, objectStateC, null);
+ // Copy
// b <- device-buffer(regionA)
device.moveDataFromDeviceBufferToHost(objectStateA, b);
@@ -95,7 +102,7 @@ public class TestVM {
device.streamOutBlocking(a, 0, objectStateA, null);
// Add a barrier
- // device.enqueueBarrier();
+ device.enqueueBarrier();
// Flush and execute all pending in the command queue
device.flush();
@@ -112,6 +119,7 @@ public class TestVM {
Arrays.fill(a, 100);
Arrays.fill(b, 0);
+ Arrays.fill(c, 50);
if (device instanceof SPIRVTornadoDevice) {
runWithTornadoVM((SPIRVTornadoDevice) device, a, b, c);
