From 494cfe093c9e31a9acd853601349543171f5afef Mon Sep 17 00:00:00 2001
From: Stephan Seitz <stephan.seitz@fau.de>
Date: Sun, 23 Feb 2020 20:19:48 +0100
Subject: [PATCH] Set ast._target of copy kernel to 'opencl'

---
 pystencils/gpucuda/periodicity.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pystencils/gpucuda/periodicity.py b/pystencils/gpucuda/periodicity.py
index 8bb0109be..a947d94a1 100644
--- a/pystencils/gpucuda/periodicity.py
+++ b/pystencils/gpucuda/periodicity.py
@@ -35,13 +35,14 @@ def get_periodic_boundary_functor(stencil, domain_size, index_dimensions=0, inde
     assert target in ['gpu', 'opencl']
     src_dst_slice_tuples = get_periodic_boundary_src_dst_slices(stencil, ghost_layers, thickness)
     kernels = []
-    index_dimensions = index_dimensions
 
     for src_slice, dst_slice in src_dst_slice_tuples:
         ast = create_copy_kernel(domain_size, src_slice, dst_slice, index_dimensions, index_dim_shape, dtype)
         if target == 'gpu':
             kernels.append(pystencils.gpucuda.make_python_function(ast))
         else:
+            ast._target = 'opencl'
+            ast._backend = 'opencl'
             kernels.append(pystencils.opencl.make_python_function(ast, opencl_queue, opencl_ctx))
 
     def functor(pdfs, **_):
-- 
GitLab