Skip to content
Snippets Groups Projects
Commit 3ea2e80b authored by René Heß's avatar René Heß
Browse files

Pytest

parent 50d08cfc
No related branches found
No related tags found
No related merge requests found
......@@ -786,6 +786,7 @@ def define_boundary_lambda(boundary, name):
raise ValueError("Expression not understood")
def name_boundary_lambda(boundary, name):
define_boundary_lambda(boundary, name + "lambda")
return name + "lambda"
......
......@@ -399,6 +399,7 @@ def apply_to_global_transformation(name, local):
depends_on=frozenset({Writes(get_pymbolic_basename(local))})
)
def to_global(local):
assert isinstance(local, prim.Expression)
name = get_pymbolic_basename(local) + "_global"
......
......@@ -46,7 +46,6 @@ from loopy.match import Writes
import pymbolic.primitives as prim
def name_sumfact_base_buffer():
count = get_counter('sumfact_base_buffer')
name = "buffer_{}".format(str(count))
......
......@@ -251,12 +251,12 @@ def generate_accumulation_instruction(visitor, accterm, measure, subdomain_id):
# variable.
if get_option('fastdg'):
ft = get_global_context_value("form_type")
if ft=='residual':
if ft == 'residual':
accum = accum + ".data()"
size = basis_functions_per_direction() ** world_dimension()
globalarg(accum, dtype=np.float64, shape=(size,), managed=False)
assignee = prim.Subscript(prim.Variable(accum), (test_lfs.index,))
expression = prim.Sum((assignee,result))
expression = prim.Sum((assignee, result))
instruction(assignee=assignee,
expression=expression,
forced_iname_deps=frozenset(inames),
......@@ -264,12 +264,12 @@ def generate_accumulation_instruction(visitor, accterm, measure, subdomain_id):
depends_on=insn_dep,
)
else:
assert ft=='jacobian'
assert ft == 'jacobian'
accum = accum + ".data()"
size = basis_functions_per_direction() ** world_dimension()
globalarg(accum, dtype=np.float64, shape=(size, size), managed=True)
assignee = prim.Subscript(prim.Variable(accum), (ansatz_lfs.index, test_lfs.index))
expression = prim.Sum((assignee,result))
expression = prim.Sum((assignee, result))
instruction(assignee=assignee,
expression=expression,
forced_iname_deps=frozenset(inames + visitor.inames),
......@@ -282,15 +282,14 @@ def generate_accumulation_instruction(visitor, accterm, measure, subdomain_id):
(ansatz_lfs.get_args() +
test_lfs.get_args() +
(result,)
)
)
)
instruction(assignees=(),
expression=expr,
forced_iname_deps=frozenset(inames + visitor.inames + vecinames),
forced_iname_deps_is_final=True,
depends_on=insn_dep,
)
)
# Mark the transformation that moves the quadrature loop inside the trialfunction loops for application
transform(nest_quadrature_loops, visitor.inames)
......@@ -384,7 +383,7 @@ def sum_factorization_kernel(a_matrices,
# * an input temporary (default)
# * a global data structure (if FastDGGridOperator is in use)
# * a value from a global data structure, broadcasted to a vector type (vectorized + FastDGGridOperator)
if l==0 and direct_input is not None:
if l == 0 and direct_input is not None:
globalarg(direct_input, dtype=np.float64, shape=inp_shape)
if a_matrix.vectorized:
input_summand = prim.Call(prim.Variable("Vec4d"), (prim.Subscript(prim.Variable(direct_input),
......
......@@ -270,32 +270,32 @@ class UFL2LoopyVisitor(ModifiedTerminalTracker):
def eq(self, o):
return prim.Comparison(self.call(o.ufl_operands[0]),
"==",
right = self.call(o.ufl_operands[1]))
right=self.call(o.ufl_operands[1]))
def ge(self, o):
return prim.Comparison(self.call(o.ufl_operands[0]),
">=",
right = self.call(o.ufl_operands[1]))
right=self.call(o.ufl_operands[1]))
def gt(self, o):
return prim.Comparison(self.call(o.ufl_operands[0]),
">",
right = self.call(o.ufl_operands[1]))
right=self.call(o.ufl_operands[1]))
def le(self, o):
return prim.Comparison(self.call(o.ufl_operands[0]),
"<=",
right = self.call(o.ufl_operands[1]))
right=self.call(o.ufl_operands[1]))
def lt(self, o):
return prim.Comparison(self.call(o.ufl_operands[0]),
"<",
right = self.call(o.ufl_operands[1]))
right=self.call(o.ufl_operands[1]))
def ne(self, o):
return prim.Comparison(self.call(o.ufl_operands[0]),
"!=",
right = self.call(o.ufl_operands[1]))
right=self.call(o.ufl_operands[1]))
def and_condition(self, o):
return prim.LogicalAnd((self.call(o.ufl_operands[0]), self.call(o.ufl_operands[1])))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment