From d97512f5079ea53b0ceaed7e8be0cc6078d3daef Mon Sep 17 00:00:00 2001 From: youben11 Date: Wed, 8 Sep 2021 11:52:26 +0100 Subject: [PATCH] tests: remove RunJit tests It's better to have execution tests as unittest (that we have now), better control of the execution than just MLIR. --- compiler/tests/RunJit/hlfhe_add_eint.mlir | 7 ------ .../tests/RunJit/hlfhe_add_eint_int_6.mlir | 7 ------ .../tests/RunJit/hlfhe_add_eint_int_7.mlir | 7 ------ compiler/tests/RunJit/hlfhe_mul_and_add.mlir | 8 ------- compiler/tests/RunJit/hlfhe_mul_eint_int.mlir | 7 ------ compiler/tests/RunJit/hlfhe_sub_int_eint.mlir | 8 ------- .../RunJit/lowlfhe_add_lwe_ciphertexts.mlir | 7 ------ compiler/tests/RunJit/lowlfhe_identity.mlir | 6 ----- .../RunJit/lowlfhe_mul_lwe_ciphertexts.mlir | 8 ------- .../RunJit/lowlfhe_negate_lwe_ciphertext.mlir | 7 ------ compiler/tests/RunJit/std_addi.mlir | 7 ------ compiler/tests/RunJit/tensor_cst.mlir | 22 ------------------- 12 files changed, 101 deletions(-) delete mode 100644 compiler/tests/RunJit/hlfhe_add_eint.mlir delete mode 100644 compiler/tests/RunJit/hlfhe_add_eint_int_6.mlir delete mode 100644 compiler/tests/RunJit/hlfhe_add_eint_int_7.mlir delete mode 100644 compiler/tests/RunJit/hlfhe_mul_and_add.mlir delete mode 100644 compiler/tests/RunJit/hlfhe_mul_eint_int.mlir delete mode 100644 compiler/tests/RunJit/hlfhe_sub_int_eint.mlir delete mode 100644 compiler/tests/RunJit/lowlfhe_add_lwe_ciphertexts.mlir delete mode 100644 compiler/tests/RunJit/lowlfhe_identity.mlir delete mode 100644 compiler/tests/RunJit/lowlfhe_mul_lwe_ciphertexts.mlir delete mode 100644 compiler/tests/RunJit/lowlfhe_negate_lwe_ciphertext.mlir delete mode 100644 compiler/tests/RunJit/std_addi.mlir delete mode 100644 compiler/tests/RunJit/tensor_cst.mlir diff --git a/compiler/tests/RunJit/hlfhe_add_eint.mlir b/compiler/tests/RunJit/hlfhe_add_eint.mlir deleted file mode 100644 index e0fff1536..000000000 --- a/compiler/tests/RunJit/hlfhe_add_eint.mlir +++ /dev/null @@ -1,7 +0,0 @@ -// RUN: zamacompiler %s --run-jit --jit-args 2 --jit-args 3 2>&1| FileCheck %s - -// CHECK-LABEL: 5 -func @main(%arg0: !HLFHE.eint<7>, %arg1: !HLFHE.eint<7>) -> !HLFHE.eint<7> { - %1 = "HLFHE.add_eint"(%arg0, %arg1): (!HLFHE.eint<7>, !HLFHE.eint<7>) -> (!HLFHE.eint<7>) - return %1: !HLFHE.eint<7> -} \ No newline at end of file diff --git a/compiler/tests/RunJit/hlfhe_add_eint_int_6.mlir b/compiler/tests/RunJit/hlfhe_add_eint_int_6.mlir deleted file mode 100644 index 88f86fc7c..000000000 --- a/compiler/tests/RunJit/hlfhe_add_eint_int_6.mlir +++ /dev/null @@ -1,7 +0,0 @@ -// RUN: zamacompiler %s --run-jit --jit-args 10 --jit-args 54 2>&1| FileCheck %s - -// CHECK-LABEL: 64 -func @main(%arg0: !HLFHE.eint<6>, %arg1: i7) -> !HLFHE.eint<6> { - %1 = "HLFHE.add_eint_int"(%arg0, %arg1): (!HLFHE.eint<6>, i7) -> (!HLFHE.eint<6>) - return %1: !HLFHE.eint<6> -} \ No newline at end of file diff --git a/compiler/tests/RunJit/hlfhe_add_eint_int_7.mlir b/compiler/tests/RunJit/hlfhe_add_eint_int_7.mlir deleted file mode 100644 index 719302f5b..000000000 --- a/compiler/tests/RunJit/hlfhe_add_eint_int_7.mlir +++ /dev/null @@ -1,7 +0,0 @@ -// RUN: zamacompiler %s --run-jit --jit-args 100 --jit-args 27 2>&1| FileCheck %s - -// CHECK-LABEL: 127 -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> -} \ No newline at end of file diff --git a/compiler/tests/RunJit/hlfhe_mul_and_add.mlir b/compiler/tests/RunJit/hlfhe_mul_and_add.mlir deleted file mode 100644 index 2a2c073ef..000000000 --- a/compiler/tests/RunJit/hlfhe_mul_and_add.mlir +++ /dev/null @@ -1,8 +0,0 @@ -// RUN: zamacompiler %s --run-jit --jit-args 2 --jit-args 3 2>&1| FileCheck %s - -// CHECK-LABEL: 12 -func @main(%arg0: !HLFHE.eint<7>, %arg1: i8) -> !HLFHE.eint<7> { - %1 = "HLFHE.mul_eint_int"(%arg0, %arg1): (!HLFHE.eint<7>, i8) -> (!HLFHE.eint<7>) - %2 = "HLFHE.add_eint"(%1, %1): (!HLFHE.eint<7>, !HLFHE.eint<7>) -> (!HLFHE.eint<7>) - return %2: !HLFHE.eint<7> -} \ No newline at end of file diff --git a/compiler/tests/RunJit/hlfhe_mul_eint_int.mlir b/compiler/tests/RunJit/hlfhe_mul_eint_int.mlir deleted file mode 100644 index 1c9032e9e..000000000 --- a/compiler/tests/RunJit/hlfhe_mul_eint_int.mlir +++ /dev/null @@ -1,7 +0,0 @@ -// RUN: zamacompiler %s --run-jit --jit-args 21 --jit-args 2 2>&1| FileCheck %s - -// CHECK-LABEL: 42 -func @main(%arg0: !HLFHE.eint<7>, %0: i8) -> !HLFHE.eint<7> { - %1 = "HLFHE.mul_eint_int"(%arg0, %0): (!HLFHE.eint<7>, i8) -> (!HLFHE.eint<7>) - return %1: !HLFHE.eint<7> -} \ No newline at end of file diff --git a/compiler/tests/RunJit/hlfhe_sub_int_eint.mlir b/compiler/tests/RunJit/hlfhe_sub_int_eint.mlir deleted file mode 100644 index 0a273f651..000000000 --- a/compiler/tests/RunJit/hlfhe_sub_int_eint.mlir +++ /dev/null @@ -1,8 +0,0 @@ -// RUN: zamacompiler %s --run-jit --jit-args 3 2>&1| FileCheck %s - -// CHECK-LABEL: 42 -func @main(%arg0: !HLFHE.eint<7>) -> !HLFHE.eint<7> { - %0 = constant 45 : i8 - %1 = "HLFHE.sub_int_eint"(%0, %arg0): (i8, !HLFHE.eint<7>) -> (!HLFHE.eint<7>) - return %1: !HLFHE.eint<7> -} \ No newline at end of file diff --git a/compiler/tests/RunJit/lowlfhe_add_lwe_ciphertexts.mlir b/compiler/tests/RunJit/lowlfhe_add_lwe_ciphertexts.mlir deleted file mode 100644 index 83963720c..000000000 --- a/compiler/tests/RunJit/lowlfhe_add_lwe_ciphertexts.mlir +++ /dev/null @@ -1,7 +0,0 @@ -// RUN: zamacompiler %s --run-jit --jit-args 11 --jit-args 31 2>&1| FileCheck %s - -// CHECK-LABEL: 42 -func @main(%arg0: !LowLFHE.lwe_ciphertext<2048,7>, %arg1: !LowLFHE.lwe_ciphertext<2048,7>) -> !LowLFHE.lwe_ciphertext<2048,7> { - %0 = "LowLFHE.add_lwe_ciphertexts"(%arg0, %arg1) : (!LowLFHE.lwe_ciphertext<2048,7>, !LowLFHE.lwe_ciphertext<2048,7>) -> !LowLFHE.lwe_ciphertext<2048,7> - return %0 : !LowLFHE.lwe_ciphertext<2048,7> -} \ No newline at end of file diff --git a/compiler/tests/RunJit/lowlfhe_identity.mlir b/compiler/tests/RunJit/lowlfhe_identity.mlir deleted file mode 100644 index 7d3c2cdf1..000000000 --- a/compiler/tests/RunJit/lowlfhe_identity.mlir +++ /dev/null @@ -1,6 +0,0 @@ -// RUN: zamacompiler %s --run-jit --jit-args 42 2>&1| FileCheck %s - -// CHECK-LABEL: 42 -func @main(%arg0: !LowLFHE.lwe_ciphertext<2048,7>) -> !LowLFHE.lwe_ciphertext<2048,7> { - return %arg0 : !LowLFHE.lwe_ciphertext<2048,7> -} \ No newline at end of file diff --git a/compiler/tests/RunJit/lowlfhe_mul_lwe_ciphertexts.mlir b/compiler/tests/RunJit/lowlfhe_mul_lwe_ciphertexts.mlir deleted file mode 100644 index 0da6237dd..000000000 --- a/compiler/tests/RunJit/lowlfhe_mul_lwe_ciphertexts.mlir +++ /dev/null @@ -1,8 +0,0 @@ -// RUN: zamacompiler %s --run-jit --jit-args 7 --jit-args 3 2>&1| FileCheck %s - -// CHECK-LABEL: 21 -func @main(%arg0: !LowLFHE.lwe_ciphertext<2048,7>, %arg1: i8) -> !LowLFHE.lwe_ciphertext<2048,7> { - %cleartext = "LowLFHE.int_to_cleartext"(%arg1) : (i8) -> !LowLFHE.cleartext<64> - %0 = "LowLFHE.mul_cleartext_lwe_ciphertext"(%arg0, %cleartext) : (!LowLFHE.lwe_ciphertext<2048,7>, !LowLFHE.cleartext<64>) -> !LowLFHE.lwe_ciphertext<2048,7> - return %0 : !LowLFHE.lwe_ciphertext<2048,7> -} \ No newline at end of file diff --git a/compiler/tests/RunJit/lowlfhe_negate_lwe_ciphertext.mlir b/compiler/tests/RunJit/lowlfhe_negate_lwe_ciphertext.mlir deleted file mode 100644 index e465c8189..000000000 --- a/compiler/tests/RunJit/lowlfhe_negate_lwe_ciphertext.mlir +++ /dev/null @@ -1,7 +0,0 @@ -// RUN: zamacompiler %s --run-jit --jit-args 224 2>&1| FileCheck %s - -// CHECK-LABEL: 32 -func @main(%arg0: !LowLFHE.lwe_ciphertext<2048,7>) -> !LowLFHE.lwe_ciphertext<2048,7> { - %0 = "LowLFHE.negate_lwe_ciphertext"(%arg0) : (!LowLFHE.lwe_ciphertext<2048,7>) -> !LowLFHE.lwe_ciphertext<2048,7> - return %0 : !LowLFHE.lwe_ciphertext<2048,7> -} \ No newline at end of file diff --git a/compiler/tests/RunJit/std_addi.mlir b/compiler/tests/RunJit/std_addi.mlir deleted file mode 100644 index 711d9511c..000000000 --- a/compiler/tests/RunJit/std_addi.mlir +++ /dev/null @@ -1,7 +0,0 @@ -// RUN: zamacompiler %s --run-jit --jit-args 11 --jit-args 31 2>&1| FileCheck %s - -// CHECK-LABEL: 42 -func @main(%arg0: i64, %arg1: i64) -> i64 { - %c = addi %arg0, %arg1 : i64 - return %c : i64 -} \ No newline at end of file diff --git a/compiler/tests/RunJit/tensor_cst.mlir b/compiler/tests/RunJit/tensor_cst.mlir deleted file mode 100644 index 20cc5f960..000000000 --- a/compiler/tests/RunJit/tensor_cst.mlir +++ /dev/null @@ -1,22 +0,0 @@ -// RUN: zamacompiler %s --run-jit --jit-args 11 --split-input-file 2>&1| FileCheck %s - -// CHECK-LABEL: 116 -func @main(%arg0: index) -> i7 { - %t = std.constant dense<[127, 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]> : tensor<128xi7> - %c = tensor.extract %t[%arg0] : tensor<128xi7> - return %c : i7 -} - -// ----- - -// CHECK-LABEL: 116 -func @extract(%arg0: index, %t: tensor<128xi7>) -> i7{ - %c = tensor.extract %t[%arg0] : tensor<128xi7> - return %c : i7 -} - -func @main(%arg0: index) -> i7 { - %t = std.constant dense<[127, 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]> : tensor<128xi7> - %c = call @extract(%arg0, %t): (index, tensor<128xi7>) -> i7 - return %c : i7 -} \ No newline at end of file