verifyBridge function

void verifyBridge()

Implementation

void verifyBridge() {
  final List<double> values = [1.0, 2.0, 3.0, 4.0];
  final x = Tensor.fromList([2, 2], values);

  // This triggers cudaMemcpy from Device to Host
  final fetched = x.fetchData();

  bool ok = true;
  for (int i = 0; i < values.length; i++) {
    if (!closeEnough(fetched[i], values[i])) ok = false;
  }

  print(
    "BRIDGE (FFI): ${ok ? '✅ PASS' : '❌ FAIL (Sent $values, got $fetched)'}",
  );
}