From 019538e84beb54346ee39cc0a1bc987acfc9e8b0 Mon Sep 17 00:00:00 2001 From: Bourgerie Quentin Date: Tue, 9 Jan 2024 12:07:28 +0100 Subject: [PATCH] fix(compiler/benchamrk): Fix command line for compilation options of e2e tools --- .../tests/end_to_end_tests/end_to_end_test.h | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/compilers/concrete-compiler/compiler/tests/end_to_end_tests/end_to_end_test.h b/compilers/concrete-compiler/compiler/tests/end_to_end_tests/end_to_end_test.h index 05b85bbde0..d15ceea3c5 100644 --- a/compilers/concrete-compiler/compiler/tests/end_to_end_tests/end_to_end_test.h +++ b/compilers/concrete-compiler/compiler/tests/end_to_end_tests/end_to_end_test.h @@ -35,8 +35,6 @@ parseEndToEndCommandLine(int argc, char **argv) { // --help // llvm::cl::ResetCommandLineParser(); - mlir::concretelang::CompilationOptions defaultOptions; - llvm::cl::list descriptionFiles( llvm::cl::Positional, llvm::cl::desc(""), llvm::cl::OneOrMore); @@ -51,32 +49,32 @@ parseEndToEndCommandLine(int argc, char **argv) { "Target a GPU backend")), llvm::cl::init(mlir::concretelang::Backend::CPU)); - llvm::cl::opt loopParallelize( + llvm::cl::opt loopParallelize( "loop-parallelize", llvm::cl::desc( "Set the loopParallelize compilation options to run the tests"), - llvm::cl::init(defaultOptions.loopParallelize)); - llvm::cl::opt dataflowParallelize( + llvm::cl::init(-1)); + llvm::cl::opt dataflowParallelize( "dataflow-parallelize", llvm::cl::desc( - "Set the dataflowParallelize compilation options to run the tests"), - llvm::cl::init(defaultOptions.dataflowParallelize)); - llvm::cl::opt emitGPUOps( + "Set the loopParallelize compilation options to run the tests"), + llvm::cl::init(-1)); + llvm::cl::opt emitGPUOps( "emit-gpu-ops", llvm::cl::desc("Set the emitGPUOps compilation options to run the tests"), - llvm::cl::init(defaultOptions.emitGPUOps)); - llvm::cl::opt batchTFHEOps( + llvm::cl::init(-1)); + llvm::cl::opt batchTFHEOps( "batch-tfhe-ops", llvm::cl::desc( "Set the batchTFHEOps compilation options to run the tests"), - llvm::cl::init(defaultOptions.batchTFHEOps)); + llvm::cl::init(-1)); llvm::cl::opt simulate("simulate", llvm::cl::desc("Simulate the FHE execution"), llvm::cl::init(false)); llvm::cl::opt compressEvaluationKeys( "compress-evaluation-keys", llvm::cl::desc("Enable the compression of evaluation keys"), - llvm::cl::init(defaultOptions.compressEvaluationKeys)); + llvm::cl::init(false)); llvm::cl::opt distBenchmark( "distributed", @@ -139,10 +137,15 @@ parseEndToEndCommandLine(int argc, char **argv) { // Build compilation options mlir::concretelang::CompilationOptions compilationOptions("main", backend.getValue()); - compilationOptions.loopParallelize = loopParallelize.getValue(); - compilationOptions.dataflowParallelize = dataflowParallelize.getValue(); - compilationOptions.emitGPUOps = emitGPUOps.getValue(); - compilationOptions.batchTFHEOps = batchTFHEOps.getValue(); + if (loopParallelize.getValue() != -1) + compilationOptions.loopParallelize = loopParallelize.getValue(); + + if (dataflowParallelize.getValue() != -1) + compilationOptions.dataflowParallelize = dataflowParallelize.getValue(); + if (emitGPUOps.getValue() != -1) + compilationOptions.emitGPUOps = emitGPUOps.getValue(); + if (batchTFHEOps.getValue() != -1) + compilationOptions.batchTFHEOps = batchTFHEOps.getValue(); compilationOptions.simulate = simulate.getValue(); compilationOptions.compressEvaluationKeys = compressEvaluationKeys.getValue(); compilationOptions.optimizerConfig.display = optimizerDisplay.getValue();