Skip to content
Snippets Groups Projects
Commit 35861a59 authored by Michael Kuron's avatar Michael Kuron :mortar_board:
Browse files

Only assert field layout in codegen when fsize > 1

parent 374d58c8
No related merge requests found
......@@ -252,7 +252,7 @@ def generate_call(ctx, kernel_info, ghost_layers_to_include=0, cell_interval=Non
coordinates = tuple(coordinates)
kernel_call_lines.append("%s %s = %s->dataAt(%s, %s, %s, %s);" %
((param.symbol.dtype, param.symbol.name, param.field_name) + coordinates))
if ast.assumed_inner_stride_one:
if ast.assumed_inner_stride_one and field.index_dimensions > 0:
kernel_call_lines.append("WALBERLA_ASSERT_EQUAL(%s->layout(), field::fzyx);" % (param.field_name,))
elif param.is_field_stride:
casted_stride = get_field_stride(param)
......@@ -267,7 +267,7 @@ def generate_call(ctx, kernel_info, ghost_layers_to_include=0, cell_interval=Non
max_value = "%s->%sSizeWithGhostLayer()" % (field.name, ('x', 'y', 'z')[coord])
kernel_call_lines.append("WALBERLA_ASSERT_GREATER_EQUAL(%s, %s);" % (max_value, shape))
kernel_call_lines.append("const %s %s = %s;" % (type_str, param.symbol.name, shape))
if ast.assumed_inner_stride_one:
if ast.assumed_inner_stride_one and field.index_dimensions > 0:
kernel_call_lines.append("WALBERLA_ASSERT_EQUAL(%s->layout(), field::fzyx);" % (field.name,))
call_parameters = ", ".join([p.symbol.name for p in ast_params])
......
......@@ -56,7 +56,7 @@ void testJacobi2D()
true, true, true ); // full periodicity
BlockDataID fieldID = field::addToStorage<ScalarField>(blocks, "Field", real_t(0.0), field::fzyx);
BlockDataID fieldID = field::addToStorage<ScalarField>(blocks, "Field", real_t(0.0));
// Initialize a quarter of the field with ones, the rest remains 0
// Jacobi averages the domain -> every cell should be at 0.25 at sufficiently many timesteps
......@@ -104,7 +104,7 @@ void testJacobi3D()
true, true, true ); // no periodicity
BlockDataID fieldID = field::addToStorage<ScalarField>(blocks, "Field", real_t(0.0), field::fzyx);
BlockDataID fieldID = field::addToStorage<ScalarField>(blocks, "Field", real_t(0.0));
// Initialize a quarter of the field with ones, the rest remains 0
// Jacobi averages the domain -> every cell should be at 0.25 at sufficiently many timesteps
......
......@@ -95,10 +95,10 @@ void testPoisson()
false, false, false ); // no periodicity
BlockDataID fieldID = field::addToStorage<ScalarField_T>(blocks, "Field", real_t(0.0), field::fzyx);
BlockDataID fieldID = field::addToStorage<ScalarField_T>(blocks, "Field", real_t(0.0));
initU( blocks, fieldID );
BlockDataID fId = field::addToStorage< ScalarField_T >( blocks, "f", real_t(0.0), field::fzyx);
BlockDataID fId = field::addToStorage< ScalarField_T >( blocks, "f", real_t(0.0));
initF( blocks, fId );
typedef blockforest::communication::UniformBufferedScheme<stencil::D2Q9> CommScheme;
......
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