Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Commits on Source (2)
from pystencils import Target, CreateKernelConfig, create_kernel, no_jit from pystencils import Target, CreateKernelConfig, no_jit
from lbmpy import create_lb_update_rule, LBMOptimisation from lbmpy import create_lb_update_rule, LBMOptimisation
from pystencilssfg import SourceFileGenerator, SfgConfiguration from pystencilssfg import SourceFileGenerator, SfgConfig
from pystencilssfg.lang.cpp import mdspan_ref
sfg_config = SfgConfiguration( sfg_config = SfgConfig()
output_directory="out/test_cuda", sfg_config.extensions.impl = "cu"
outer_namespace="gen_code", sfg_config.output_directory = "out/test_cuda"
impl_extension="cu" sfg_config.outer_namespace = "gen_code"
)
with SourceFileGenerator(sfg_config) as sfg: with SourceFileGenerator(sfg_config) as sfg:
gen_config = CreateKernelConfig(target=Target.CUDA, jit=no_jit) gen_config = CreateKernelConfig(target=Target.CUDA, jit=no_jit)
...@@ -15,6 +13,4 @@ with SourceFileGenerator(sfg_config) as sfg: ...@@ -15,6 +13,4 @@ with SourceFileGenerator(sfg_config) as sfg:
update = create_lb_update_rule() update = create_lb_update_rule()
kernel = sfg.kernels.create(update, "lbm_update", gen_config) kernel = sfg.kernels.create(update, "lbm_update", gen_config)
sfg.function("lb_update")( sfg.function("lb_update")(sfg.call(kernel))
sfg.call(kernel)
)
...@@ -24,6 +24,9 @@ class HeaderFile: ...@@ -24,6 +24,9 @@ class HeaderFile:
return header return header
system_header = False system_header = False
if header.startswith('"') and header.endswith('"'):
header = header[1:-1]
if header.startswith("<") and header.endswith(">"): if header.startswith("<") and header.endswith(">"):
header = header[1:-1] header = header[1:-1]
system_header = True system_header = True
......
from pystencilssfg.lang import HeaderFile
import pytest
def test_parse_system():
headerfile = HeaderFile.parse("<test>")
assert str(headerfile) == "<test>" and headerfile.system_header
@pytest.mark.parametrize("header_string", ["test.hpp", '"test.hpp"'])
def test_parse_private(header_string):
headerfile = HeaderFile.parse(header_string)
assert str(headerfile) == "test.hpp" and not headerfile.system_header