Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Deconinck committed Sep 19, 2024
1 parent 8fb7452 commit 0a376c0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/gt4py/cartesian/frontend/gtscript_frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -1440,20 +1440,20 @@ def visit_Assign(self, node: ast.Assign) -> list:
loc=nodes.Location.from_ast_node(t),
)
# Case of K-offset
if (
len(spatial_offset) == 3
and spatial_offset[2] != 0
):
if (self.iteration_order == nodes.IterationOrder.PARALLEL):
if len(spatial_offset) == 3 and spatial_offset[2] != 0:
if self.iteration_order == nodes.IterationOrder.PARALLEL:
raise GTScriptSyntaxError(
message="Assignment to non-zero offsets in K is not available in PARALLEL. Choose FORWARD or BACKWARD.",
loc=nodes.Location.from_ast_node(t))
loc=nodes.Location.from_ast_node(t),
)
if self.backend_name == "gt:gpu":
import cupy as cp

if cp.cuda.get_local_runtime_version() < 12000:
raise GTScriptSyntaxError(
message="Assignment to non-zero offsets in K is not available in gt:gpu for CUDA<12. Please update CUDA.",
loc=nodes.Location.from_ast_node(t))
loc=nodes.Location.from_ast_node(t),
)

if not self._is_known(name):
if name in self.temp_decls:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,7 @@ def test_K_offset_write_conditional(backend):
pytest.skip("Cuda backend is not capable of K offset write")
if backend == "gt:gpu":
import cupy as cp

if cp.cuda.get_local_runtime_version() < 12000:
pytest.skip(
"gt:gpu backend with CUDA 11 is not capable of K offset write, update CUDA if possible"
Expand Down

0 comments on commit 0a376c0

Please sign in to comment.