Skip to content

Commit

Permalink
More adjustments to form code gen.
Browse files Browse the repository at this point in the history
  • Loading branch information
jhale committed May 7, 2024
1 parent c29b682 commit 49160fb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
15 changes: 9 additions & 6 deletions ffcx/codegeneration/C/integrals.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,17 @@ def generator(ir: IntegralIR, options):

code["tabulate_tensor"] = body

code["tabulate_tensor_float32"] = ".tabulate_tensor_float32 = NULL"
code["tabulate_tensor_float64"] = ".tabulate_tensor_float64 = NULL"
if not sys.platform.startswith("win32"):
code["tabulate_tensor_complex64"] = ".tabulate_tensor_complex64 = NULL"
code["tabulate_tensor_complex128"] = ".tabulate_tensor_complex128 = NULL"
code["tabulate_tensor_float32"] = ".tabulate_tensor_float32 = NULL,"
code["tabulate_tensor_float64"] = ".tabulate_tensor_float64 = NULL,"
if sys.platform.startswith("win32"):
code["tabulate_tensor_complex64"] = ""
code["tabulate_tensor_complex128"] = ""
else:
code["tabulate_tensor_complex64"] = ".tabulate_tensor_complex64 = NULL,"
code["tabulate_tensor_complex128"] = ".tabulate_tensor_complex128 = NULL,"
np_scalar_type = np.dtype(options["scalar_type"]).name
code[f"tabulate_tensor_{np_scalar_type}"] = (
f".tabulate_tensor_{np_scalar_type} = tabulate_tensor_{factory_name}"
f".tabulate_tensor_{np_scalar_type} = tabulate_tensor_{factory_name},"
)

element_hash = 0 if ir.coordinate_element_hash is None else ir.coordinate_element_hash
Expand Down
8 changes: 4 additions & 4 deletions ffcx/codegeneration/C/integrals_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
ufcx_integral {factory_name} =
{{
.enabled_coefficients = {enabled_coefficients},
{tabulate_tensor_float32},
{tabulate_tensor_float64},
{tabulate_tensor_complex64},
{tabulate_tensor_complex128},
{tabulate_tensor_float32}
{tabulate_tensor_float64}
{tabulate_tensor_complex64}
{tabulate_tensor_complex128}
.needs_facet_permutations = {needs_facet_permutations},
.coordinate_element_hash = {coordinate_element_hash},
}};
Expand Down

0 comments on commit 49160fb

Please sign in to comment.