Skip to content
Snippets Groups Projects

Allow **kernel_creation_args in create_boundary_kernel

Merged Stephan Seitz requested to merge seitz/pystencils:create_boundary_kwargs into master
1 file
+ 3
2
Compare changes
  • Side-by-side
  • Inline
@@ -442,10 +442,11 @@ class BoundaryOffsetInfo(CustomCodeNode):
@@ -442,10 +442,11 @@ class BoundaryOffsetInfo(CustomCodeNode):
INV_DIR_SYMBOL = TypedSymbol("invdir", "int")
INV_DIR_SYMBOL = TypedSymbol("invdir", "int")
def create_boundary_kernel(field, index_field, stencil, boundary_functor, target='cpu', openmp=True):
def create_boundary_kernel(field, index_field, stencil, boundary_functor, target='cpu', openmp=True,
 
**kernel_creation_args):
elements = [BoundaryOffsetInfo(stencil)]
elements = [BoundaryOffsetInfo(stencil)]
index_arr_dtype = index_field.dtype.numpy_dtype
index_arr_dtype = index_field.dtype.numpy_dtype
dir_symbol = TypedSymbol("dir", index_arr_dtype.fields['dir'][0])
dir_symbol = TypedSymbol("dir", index_arr_dtype.fields['dir'][0])
elements += [Assignment(dir_symbol, index_field[0]('dir'))]
elements += [Assignment(dir_symbol, index_field[0]('dir'))]
elements += boundary_functor(field, direction_symbol=dir_symbol, index_field=index_field)
elements += boundary_functor(field, direction_symbol=dir_symbol, index_field=index_field)
return create_indexed_kernel(elements, [index_field], target=target, cpu_openmp=openmp)
return create_indexed_kernel(elements, [index_field], target=target, cpu_openmp=openmp, **kernel_creation_args)
Loading