From ff23a9d9acbe7c532eab59fc6aeb741ce79b3d18 Mon Sep 17 00:00:00 2001
From: Stephan Seitz <stephan.seitz@fau.de>
Date: Thu, 30 Jan 2020 10:54:13 +0100
Subject: [PATCH] Fix bug in graph_datahandling: HOST_TO_DEVICE and
 DEVICE_TO_HOST was swapped

---
 src/pystencils_autodiff/graph_datahandling.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/pystencils_autodiff/graph_datahandling.py b/src/pystencils_autodiff/graph_datahandling.py
index 59c31c9..f33b89f 100644
--- a/src/pystencils_autodiff/graph_datahandling.py
+++ b/src/pystencils_autodiff/graph_datahandling.py
@@ -179,14 +179,14 @@ class GraphDataHandling(pystencils.datahandling.SerialDataHandling):
 
     def to_cpu(self, name):
         super().to_cpu(name)
-        self.call_queue.append(DataTransfer(self._fields[name], DataTransferKind.HOST_TO_DEVICE))
+        self.call_queue.append(DataTransfer(self._fields[name], DataTransferKind.DEVICE_TO_HOST))
 
     def to_gpu(self, name):
         super().to_gpu(name)
         if name in self._custom_data_transfer_functions:
             self.call_queue.append('Custom Tranfer Function')
         else:
-            self.call_queue.append(DataTransfer(self._fields[name], DataTransferKind.DEVICE_TO_HOST))
+            self.call_queue.append(DataTransfer(self._fields[name], DataTransferKind.HOST_TO_DEVICE))
 
     def synchronization_function(self, names, stencil=None, target=None, **_):
         for name in names:
-- 
GitLab