Skip to content
GitLab
Menu
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
ca17e888
Commit
ca17e888
authored
Jan 13, 2020
by
Stephan Seitz
Browse files
Re-add code for CubicInterpolationCUDA
parent
dd6b920e
Changes
1
Hide whitespace changes
Inline
Side-by-side
pystencils/gpucuda/cudajit.py
View file @
ca17e888
...
...
@@ -45,17 +45,20 @@ def make_python_function(kernel_function_node, argument_dict=None, custom_backen
if
USE_FAST_MATH
:
nvcc_options
.
append
(
"-use_fast_math"
)
# Code for
# if any(t.interpolation_mode == InterpolationMode.CUBIC_SPLINE for t in textures):
# assert isdir(join(dirname(__file__), "CubicInterpolationCUDA", "code")), \
# "Submodule CubicInterpolationCUDA does not exist"
# nvcc_options += ["-I" + join(dirname(__file__), "CubicInterpolationCUDA", "code")]
# nvcc_options += ["-I" + join(dirname(__file__), "CubicInterpolationCUDA", "code", "internal")]
# needed_dims = set(t.field.spatial_dimensions for t in textures
# if t.interpolation_mode == InterpolationMode.CUBIC_SPLINE)
# for i in needed_dims:
# code = 'extern "C++" {\n#include "cubicTex%iD.cu"\n}\n' % i + code
# Code for CubicInterpolationCUDA
from
pystencils.interpolation_astnodes
import
InterpolationMode
from
os.path
import
join
,
dirname
,
isdir
if
any
(
t
.
interpolation_mode
==
InterpolationMode
.
CUBIC_SPLINE
for
t
in
textures
):
assert
isdir
(
join
(
dirname
(
__file__
),
"CubicInterpolationCUDA"
,
"code"
)),
\
"Submodule CubicInterpolationCUDA does not exist"
nvcc_options
+=
[
"-I"
+
join
(
dirname
(
__file__
),
"CubicInterpolationCUDA"
,
"code"
)]
nvcc_options
+=
[
"-I"
+
join
(
dirname
(
__file__
),
"CubicInterpolationCUDA"
,
"code"
,
"internal"
)]
needed_dims
=
set
(
t
.
field
.
spatial_dimensions
for
t
in
textures
if
t
.
interpolation_mode
==
InterpolationMode
.
CUBIC_SPLINE
)
for
i
in
needed_dims
:
code
=
'extern "C++" {
\n
#include "cubicTex%iD.cu"
\n
}
\n
'
%
i
+
code
mod
=
SourceModule
(
code
,
options
=
nvcc_options
,
include_dirs
=
[
get_pystencils_include_path
(),
get_pycuda_include_path
()])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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