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
b20974fe
Commit
b20974fe
authored
5 years ago
by
Stephan Seitz
Browse files
Options
Downloads
Patches
Plain Diff
interpolation: Stuff is working let's commit quickly
parent
fa782b82
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
pystencils/gpucuda/texture_utils.py
+3
-0
3 additions, 0 deletions
pystencils/gpucuda/texture_utils.py
pystencils/interpolation_astnodes.py
+1
-4
1 addition, 4 deletions
pystencils/interpolation_astnodes.py
pystencils/transformations.py
+6
-6
6 additions, 6 deletions
pystencils/transformations.py
with
10 additions
and
10 deletions
pystencils/gpucuda/texture_utils.py
+
3
−
0
View file @
b20974fe
...
...
@@ -15,6 +15,7 @@ import numpy as np
try
:
import
pycuda.driver
as
cuda
from
pycuda
import
gpuarray
import
pycuda
except
Exception
:
pass
...
...
@@ -35,6 +36,8 @@ def ndarray_to_tex(tex_ref,
use_normalized_coordinates
=
False
,
read_as_integer
=
False
):
if
isinstance
(
address_mode
,
str
):
address_mode
=
getattr
(
pycuda
.
driver
.
address_mode
,
address_mode
.
upper
())
if
address_mode
is
None
:
address_mode
=
cuda
.
address_mode
.
BORDER
if
filter_mode
is
None
:
...
...
This diff is collapsed.
Click to expand it.
pystencils/interpolation_astnodes.py
+
1
−
4
View file @
b20974fe
...
...
@@ -116,7 +116,6 @@ class Interpolator(object):
def
_hashable_contents
(
self
):
return
(
str
(
self
.
address_mode
),
str
(
type
(
self
)),
self
.
address_mode
,
self
.
hash_str
,
self
.
use_normalized_coordinates
)
...
...
@@ -416,11 +415,9 @@ class TextureCachedField(Interpolator):
read_as_integer
=
False
):
super
().
__init__
(
parent_field
,
interpolation_mode
,
address_mode
,
use_normalized_coordinates
)
if
isinstance
(
address_mode
,
str
):
address_mode
=
getattr
(
pycuda
.
driver
.
address_mode
,
address_mode
.
upper
())
if
address_mode
is
None
:
address_mode
=
pycuda
.
driver
.
address_mode
.
BORDER
address_mode
=
'
border
'
if
filter_mode
is
None
:
filter_mode
=
pycuda
.
driver
.
filter_mode
.
LINEAR
...
...
This diff is collapsed.
Click to expand it.
pystencils/transformations.py
+
6
−
6
View file @
b20974fe
...
...
@@ -1334,19 +1334,19 @@ def implement_interpolations(ast_node: ast.Node,
if
implement_by_texture_accesses
:
for
i
in
interpolation_accesses
:
old_i
=
i
from
pystencils.interpolation_astnodes
import
_InterpolationSymbol
try
:
import
pycuda.driver
as
cuda
texture
=
TextureCachedField
.
from_interpolator
(
i
.
interpolator
)
i
.
symbol
.
interpolator
=
texture
if
can_use_hw_interpolation
(
i
):
i
.
symbol
.
interpolator
.
filter_mode
=
cuda
.
filter_mode
.
LINEAR
texture
.
filter_mode
=
cuda
.
filter_mode
.
LINEAR
else
:
i
.
symbol
.
interpolator
.
filter_mode
=
cuda
.
filter_mode
.
POINT
i
.
symbol
.
interpolator
.
read_as_integer
=
True
texture
.
filter_mode
=
cuda
.
filter_mode
.
POINT
texture
.
read_as_integer
=
True
except
Exception
as
e
:
raise
e
ast_node
.
subs
({
old_i
:
i
}
)
i
.
symbol
=
_InterpolationSymbol
(
str
(
texture
),
i
.
symbol
.
field
,
texture
)
# from pystencils.math_optimizations import ReplaceOptim, optimize_ast
...
...
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