Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pystencils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Bindgen
pystencils
Commits
2e85d1d1
Commit
2e85d1d1
authored
5 years ago
by
Stephan Seitz
Browse files
Options
Downloads
Patches
Plain Diff
Remove TextureAccess
parent
479cc5ad
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pystencils/interpolation_astnodes.py
+2
-33
2 additions, 33 deletions
pystencils/interpolation_astnodes.py
with
2 additions
and
33 deletions
pystencils/interpolation_astnodes.py
+
2
−
33
View file @
2e85d1d1
...
@@ -230,10 +230,10 @@ class InterpolatorAccess(TypedSymbol):
...
@@ -230,10 +230,10 @@ class InterpolatorAccess(TypedSymbol):
field
=
self
.
field
field
=
self
.
field
default_int_type
=
create_type
(
'
int64
'
)
default_int_type
=
create_type
(
'
int64
'
)
use_textures
=
isinstance
(
self
,
TextureAccess
)
use_textures
=
isinstance
(
self
.
interpolator
,
TextureCachedField
)
if
use_textures
:
if
use_textures
:
def
absolute_access
(
x
,
_
):
def
absolute_access
(
x
,
_
):
return
self
.
texture
.
at
((
o
for
o
in
x
))
return
self
.
symbol
.
interpolator
.
at
((
o
for
o
in
x
))
else
:
else
:
absolute_access
=
field
.
absolute_access
absolute_access
=
field
.
absolute_access
...
@@ -407,12 +407,6 @@ class TextureCachedField:
...
@@ -407,12 +407,6 @@ class TextureCachedField:
obj
=
cls
(
interpolator
.
field
,
interpolator
.
address_mode
,
interpolation_mode
=
interpolator
.
interpolation_mode
)
obj
=
cls
(
interpolator
.
field
,
interpolator
.
address_mode
,
interpolation_mode
=
interpolator
.
interpolation_mode
)
return
obj
return
obj
def
at
(
self
,
offset
):
return
TextureAccess
(
self
.
symbol
,
*
offset
)
def
__getitem__
(
self
,
offset
):
return
TextureAccess
(
self
.
symbol
,
*
offset
)
def
__str__
(
self
):
def
__str__
(
self
):
return
'
%s_texture_%s
'
%
(
self
.
field
.
name
,
self
.
reproducible_hash
)
return
'
%s_texture_%s
'
%
(
self
.
field
.
name
,
self
.
reproducible_hash
)
...
@@ -436,30 +430,6 @@ class TextureCachedField:
...
@@ -436,30 +430,6 @@ class TextureCachedField:
return
_hash
(
str
(
self
.
_hashable_contents
).
encode
()).
hexdigest
()
return
_hash
(
str
(
self
.
_hashable_contents
).
encode
()).
hexdigest
()
class
TextureAccess
(
InterpolatorAccess
):
def
__new__
(
cls
,
texture_symbol
,
*
offsets
,
**
kwargs
):
obj
=
TextureAccess
.
__xnew_cached_
(
cls
,
texture_symbol
,
*
offsets
,
**
kwargs
)
return
obj
def
__new_stage2__
(
self
,
symbol
,
*
offsets
):
obj
=
super
().
__xnew__
(
self
,
symbol
,
*
offsets
)
obj
.
required_global_declarations
=
symbol
.
interpolator
.
required_global_declarations
obj
.
required_global_declarations
[
0
].
_symbols_defined
.
add
(
obj
)
return
obj
def
__str__
(
self
):
return
'
%s_texture(%s)
'
%
(
self
.
interpolator
.
field
.
name
,
'
,
'
.
join
(
str
(
o
)
for
o
in
self
.
offsets
))
@property
def
texture
(
self
):
return
self
.
interpolator
# noinspection SpellCheckingInspection
__xnew__
=
staticmethod
(
__new_stage2__
)
# noinspection SpellCheckingInspection
__xnew_cached_
=
staticmethod
(
cacheit
(
__new_stage2__
))
class
TextureDeclaration
(
Node
):
class
TextureDeclaration
(
Node
):
"""
"""
A global declaration of a texture. Visible both for device and host code.
A global declaration of a texture. Visible both for device and host code.
...
@@ -534,4 +504,3 @@ def dtype_supports_textures(dtype):
...
@@ -534,4 +504,3 @@ def dtype_supports_textures(dtype):
return
dtype
().
itemsize
<=
4
return
dtype
().
itemsize
<=
4
return
dtype
.
itemsize
<=
4
return
dtype
.
itemsize
<=
4
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment