From dab31433d9fee61de455598e7e056690e1586715 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Tue, 28 Mar 2023 17:50:40 -0300 Subject: [PATCH] fix(backend): fix ci after 08e8012 Google benchmark is built twice due to the new bench infrastructure for concrete-cuda, this commit fixes it by introducing CONCRETE_CUDA_BUILD_TESTS and CONCRETE_CUDA_BUILD_BENCHMARKS options to skip unecessary builds. --- .github/workflows/concrete_cuda_test.yml | 2 +- .../test_and_benchmark/CMakeLists.txt | 13 +++++++++++-- .../test_and_benchmark/benchmark/CMakeLists.txt | 1 - .../test_and_benchmark/test/CMakeLists.txt | 1 + compilers/concrete-compiler/compiler/CMakeLists.txt | 2 ++ 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/concrete_cuda_test.yml b/.github/workflows/concrete_cuda_test.yml index c85d45351..650571a92 100644 --- a/.github/workflows/concrete_cuda_test.yml +++ b/.github/workflows/concrete_cuda_test.yml @@ -42,7 +42,7 @@ jobs: with: mode: start github-token: ${{ secrets.CONCRETE_ACTIONS_TOKEN }} - ec2-image-id: ami-03f11dc8c6a5f5c0a + ec2-image-id: ami-08e27480d79e82238 ec2-instance-type: p3.2xlarge subnet-id: subnet-8123c9e7 security-group-id: sg-0466d33ced960ba35 diff --git a/backends/concrete-cuda/implementation/test_and_benchmark/CMakeLists.txt b/backends/concrete-cuda/implementation/test_and_benchmark/CMakeLists.txt index dc28d1a84..5d4e31392 100644 --- a/backends/concrete-cuda/implementation/test_and_benchmark/CMakeLists.txt +++ b/backends/concrete-cuda/implementation/test_and_benchmark/CMakeLists.txt @@ -1,2 +1,11 @@ -add_subdirectory(test) -add_subdirectory(benchmark) +option(CONCRETE_CUDA_BUILD_TESTS "Build the test tool" ON) +option(CONCRETE_CUDA_BUILD_BENCHMARKS "Build the benchmark tool" ON) + +if(CONCRETE_CUDA_BUILD_TESTS) + message(STATUS "Building with Concrete CUDA test tool") + add_subdirectory(test) +endif() +if(CONCRETE_CUDA_BUILD_BENCHMARKS) + message(STATUS "Building with Concrete CUDA benchmark tool") + add_subdirectory(benchmark) +endif() diff --git a/backends/concrete-cuda/implementation/test_and_benchmark/benchmark/CMakeLists.txt b/backends/concrete-cuda/implementation/test_and_benchmark/benchmark/CMakeLists.txt index ff95691a3..3e5d12765 100644 --- a/backends/concrete-cuda/implementation/test_and_benchmark/benchmark/CMakeLists.txt +++ b/backends/concrete-cuda/implementation/test_and_benchmark/benchmark/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 3.8 FATAL_ERROR) find_package(CUDAToolkit) if(NOT CMAKE_BUILD_TYPE) diff --git a/backends/concrete-cuda/implementation/test_and_benchmark/test/CMakeLists.txt b/backends/concrete-cuda/implementation/test_and_benchmark/test/CMakeLists.txt index fa2ce985c..d956c6c9e 100644 --- a/backends/concrete-cuda/implementation/test_and_benchmark/test/CMakeLists.txt +++ b/backends/concrete-cuda/implementation/test_and_benchmark/test/CMakeLists.txt @@ -1,3 +1,4 @@ +find_package(CUDAToolkit) include(FetchContent) FetchContent_Declare(googletest URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip) diff --git a/compilers/concrete-compiler/compiler/CMakeLists.txt b/compilers/concrete-compiler/compiler/CMakeLists.txt index cd23527e8..eba994ab7 100644 --- a/compilers/concrete-compiler/compiler/CMakeLists.txt +++ b/compilers/concrete-compiler/compiler/CMakeLists.txt @@ -141,6 +141,8 @@ if(CONCRETELANG_CUDA_SUPPORT) message(STATUS "Found CUDA version: ${CUDAToolkit_VERSION}") message(STATUS "Found CUDA library dir: ${CUDAToolkit_LIBRARY_DIR}") link_directories(${CUDAToolkit_LIBRARY_DIR}) + set(CONCRETE_CUDA_BUILD_TESTS OFF) + set(CONCRETE_CUDA_BUILD_BENCHMARKS OFF) add_subdirectory(${CONCRETE_CUDA_DIR} concrete-cuda) include_directories(${CONCRETE_CUDA_DIR}/include) include_directories(${CUDAToolkit_INCLUDE_DIRS})