Skip to content
Snippets Groups Projects
Commit dd6b920e authored by Stephan Seitz's avatar Stephan Seitz
Browse files

Attempt to implement printing of DiffInterpolatorAccess

parent ee9587df
Branches
Tags
1 merge request!129Interpolation refactoring
...@@ -3,7 +3,7 @@ from os.path import dirname, join ...@@ -3,7 +3,7 @@ from os.path import dirname, join
from pystencils.astnodes import Node from pystencils.astnodes import Node
from pystencils.backends.cbackend import CBackend, CustomSympyPrinter, generate_c from pystencils.backends.cbackend import CBackend, CustomSympyPrinter, generate_c
from pystencils.fast_approximation import fast_division, fast_inv_sqrt, fast_sqrt from pystencils.fast_approximation import fast_division, fast_inv_sqrt, fast_sqrt
from pystencils.interpolation_astnodes import InterpolationMode from pystencils.interpolation_astnodes import DiffInterpolatorAccess, InterpolationMode
with open(join(dirname(__file__), 'cuda_known_functions.txt')) as f: with open(join(dirname(__file__), 'cuda_known_functions.txt')) as f:
lines = f.readlines() lines = f.readlines()
...@@ -73,7 +73,10 @@ class CudaSympyPrinter(CustomSympyPrinter): ...@@ -73,7 +73,10 @@ class CudaSympyPrinter(CustomSympyPrinter):
def _print_TextureAccess(self, node): def _print_TextureAccess(self, node):
dtype = node.texture.field.dtype.numpy_dtype dtype = node.texture.field.dtype.numpy_dtype
if node.texture.interpolation_mode == InterpolationMode.CUBIC_SPLINE: if type(node) == DiffInterpolatorAccess:
# cubicTex3D_1st_derivative_x(texture tex, float3 coord)
template = f"cubicTex%iD_1st_{'xyz'[node.diff_coordinate_idx]}(%s, %s)"
elif node.texture.interpolation_mode == InterpolationMode.CUBIC_SPLINE:
template = "cubicTex%iDSimple(%s, %s)" template = "cubicTex%iDSimple(%s, %s)"
else: else:
if dtype.itemsize > 4: if dtype.itemsize > 4:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment