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
Stephan Seitz
pystencils
Commits
6af6b93f
Commit
6af6b93f
authored
Jan 03, 2020
by
Stephan Seitz
Browse files
Add InterpolatorAccess.__getnewargs__
parent
46b7b88d
Changes
1
Hide whitespace changes
Inline
Side-by-side
pystencils/interpolation_astnodes.py
View file @
6af6b93f
...
...
@@ -142,8 +142,8 @@ class NearestNeightborInterpolator(Interpolator):
class
InterpolatorAccess
(
TypedSymbol
):
def
__new__
(
cls
,
field
,
offsets
,
*
args
,
**
kwargs
):
obj
=
TextureAccess
.
__xnew_cached_
(
cls
,
field
,
offsets
,
*
args
,
**
kwargs
)
def
__new__
(
cls
,
field
,
*
offsets
,
**
kwargs
):
obj
=
TextureAccess
.
__xnew_cached_
(
cls
,
field
,
*
offsets
,
**
kwargs
)
return
obj
def
__new_stage2__
(
self
,
symbol
,
*
offsets
):
...
...
@@ -287,6 +287,9 @@ class InterpolatorAccess(TypedSymbol):
# noinspection SpellCheckingInspection
__xnew_cached_
=
staticmethod
(
cacheit
(
__new_stage2__
))
def
__getnewargs__
(
self
):
return
tuple
(
self
.
symbol
,
*
self
.
offsets
)
##########################################################################################
# GPU-specific fast specializations (for precision GPUs can also use above nodes/symbols #
##########################################################################################
...
...
@@ -362,8 +365,8 @@ class TextureCachedField:
class
TextureAccess
(
InterpolatorAccess
):
def
__new__
(
cls
,
texture_symbol
,
offsets
,
*
args
,
**
kwargs
):
obj
=
TextureAccess
.
__xnew_cached_
(
cls
,
texture_symbol
,
offsets
,
*
args
,
**
kwargs
)
def
__new__
(
cls
,
texture_symbol
,
*
offsets
,
**
kwargs
):
obj
=
TextureAccess
.
__xnew_cached_
(
cls
,
texture_symbol
,
*
offsets
,
**
kwargs
)
return
obj
def
__new_stage2__
(
self
,
symbol
,
*
offsets
):
...
...
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