mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 20:25:34 -05:00
24 lines
629 B
Python
24 lines
629 B
Python
import pytest
|
|
from zamalang import CompilerEngine
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"mlir_input, args, expected_result",
|
|
[
|
|
(
|
|
"""
|
|
func @main(%arg0: !HLFHE.eint<7>, %arg1: i8) -> !HLFHE.eint<7> {
|
|
%1 = "HLFHE.add_eint_int"(%arg0, %arg1): (!HLFHE.eint<7>, i8) -> (!HLFHE.eint<7>)
|
|
return %1: !HLFHE.eint<7>
|
|
}
|
|
""",
|
|
(5, 7),
|
|
12,
|
|
),
|
|
],
|
|
)
|
|
def test_compile_and_run(mlir_input, args, expected_result):
|
|
engine = CompilerEngine()
|
|
engine.compile_fhe(mlir_input)
|
|
assert engine.run(*args) == expected_result
|