From 2169d6fca33ef6408f297a51fa6a326636d1b9b8 Mon Sep 17 00:00:00 2001 From: IgorBaratta Date: Fri, 6 Oct 2023 16:38:32 +0100 Subject: [PATCH] remove unused function --- ffcx/codegeneration/flop_count.py | 34 ------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 ffcx/codegeneration/flop_count.py diff --git a/ffcx/codegeneration/flop_count.py b/ffcx/codegeneration/flop_count.py deleted file mode 100644 index 656fb7428..000000000 --- a/ffcx/codegeneration/flop_count.py +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (C) 2021 Igor A. Baratta -# This file is part of FFCx. (https://www.fenicsproject.org) -# -# SPDX-License-Identifier: LGPL-3.0-or-later - -from typing import Optional - -import ffcx.options -import ufl -from ffcx.analysis import analyze_ufl_objects -from ffcx.codegeneration.backend import FFCXBackend -from ffcx.codegeneration.integral_generator import IntegralGenerator -from ffcx.ir.representation import compute_ir - - -def count_flops(form: ufl.Form, options: Optional[dict] = {}): - """Return a list with the number of flops for each kernel in the Form.""" - options = ffcx.options.get_options(options) - assert isinstance(form, ufl.Form) - analysis = analyze_ufl_objects([form], options) - ir = compute_ir(analysis, {}, "flops", options, False) - - flops = [] - - for integral_ir in ir.integrals: - # Create FFCx C backend - backend = FFCXBackend(integral_ir, options) - # Configure kernel generator - ig = IntegralGenerator(integral_ir, backend) - # Generate code ast for the tabulate_tensor body - ast = ig.generate() - flops.append(ast.flops()) - - return flops