Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pycodegen
lbmpy
Commits
5068abc0
Commit
5068abc0
authored
Jun 07, 2021
by
Markus Holzer
Committed by
Michael Kuron
Jun 07, 2021
Browse files
Use int64 for indexing
parent
55d0ca6c
Changes
2
Hide whitespace changes
Inline
Side-by-side
lbmpy/advanced_streaming/indexing.py
View file @
5068abc0
...
...
@@ -40,7 +40,7 @@ class BetweenTimestepsIndexing:
# =============================
def
__init__
(
self
,
pdf_field
,
stencil
,
prev_timestep
=
Timestep
.
BOTH
,
streaming_pattern
=
'pull'
,
index_dtype
=
np
.
int
32
,
offsets_dtype
=
np
.
int
32
):
index_dtype
=
np
.
int
64
,
offsets_dtype
=
np
.
int
64
):
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
.
int
32
):
def
__init__
(
self
,
stencil
,
offsets_dtype
=
np
.
int
64
):
offsets_dtype
=
create_type
(
offsets_dtype
)
dim
=
len
(
stencil
[
0
])
...
...
lbmpy/boundaries/boundaryhandling.py
View file @
5068abc0
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment