From 5068abc0809fbcae6009e0f941e904529c884595 Mon Sep 17 00:00:00 2001 From: Markus Holzer <markus.holzer@fau.de> Date: Mon, 7 Jun 2021 13:30:41 +0000 Subject: [PATCH] Use int64 for indexing --- lbmpy/advanced_streaming/indexing.py | 4 ++-- lbmpy/boundaries/boundaryhandling.py | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lbmpy/advanced_streaming/indexing.py b/lbmpy/advanced_streaming/indexing.py index 6548235d..54249a48 100644 --- a/lbmpy/advanced_streaming/indexing.py +++ b/lbmpy/advanced_streaming/indexing.py @@ -40,7 +40,7 @@ class BetweenTimestepsIndexing: # ============================= def __init__(self, pdf_field, stencil, prev_timestep=Timestep.BOTH, streaming_pattern='pull', - index_dtype=np.int32, offsets_dtype=np.int32): + index_dtype=np.int64, offsets_dtype=np.int64): if prev_timestep == Timestep.BOTH and is_inplace(streaming_pattern): raise ValueError('Cannot create index arrays for both kinds of timesteps for inplace streaming pattern ' + streaming_pattern) @@ -219,7 +219,7 @@ class NeighbourOffsetArrays(CustomCodeNode): def _offset_symbols(dim): return [TypedSymbol(f"neighbour_offset_{d}", create_type(np.int64)) for d in ['x', 'y', 'z'][:dim]] - def __init__(self, stencil, offsets_dtype=np.int32): + def __init__(self, stencil, offsets_dtype=np.int64): offsets_dtype = create_type(offsets_dtype) dim = len(stencil[0]) diff --git a/lbmpy/boundaries/boundaryhandling.py b/lbmpy/boundaries/boundaryhandling.py index 7ebfad53..7cd02822 100644 --- a/lbmpy/boundaries/boundaryhandling.py +++ b/lbmpy/boundaries/boundaryhandling.py @@ -177,10 +177,8 @@ def create_lattice_boltzmann_boundary_kernel(pdf_field, index_field, lb_method, prev_timestep=Timestep.BOTH, streaming_pattern='pull', target='cpu', **kernel_creation_args): - index_dtype = index_field.dtype.numpy_dtype.fields['dir'][0] - offsets_dtype = index_field.dtype.numpy_dtype.fields['x'][0] indexing = BetweenTimestepsIndexing( - pdf_field, lb_method.stencil, prev_timestep, streaming_pattern, index_dtype, offsets_dtype) + pdf_field, lb_method.stencil, prev_timestep, streaming_pattern, np.int64, np.int64) f_out, f_in = indexing.proxy_fields dir_symbol = indexing.dir_symbol -- GitLab