diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 488f583ef..6af50291e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,14 +75,14 @@ jobs: clang-runtime: '11' coverage: true cuda: true - extra_cmake_options: '-DLLVM_ENABLE_WERROR=On -DENABLE_ENZYME_BACKEND=On' + extra_cmake_options: '-DLLVM_ENABLE_WERROR=On -DCLAD_ENABLE_ENZYME_BACKEND=On' #clang-format: true - name: ubu20-gcc7-runtime11-benchmarks os: ubuntu-20.04 compiler: gcc-7 clang-runtime: '11' - extra_cmake_options: '-DCLAD_ENABLE_BENCHMARKS=On -DENABLE_ENZYME_BACKEND=On' + extra_cmake_options: '-DCLAD_ENABLE_BENCHMARKS=On -DCLAD_ENABLE_ENZYME_BACKEND=On' benchmark: true - name: ubu20-gcc8-runtime11-coverity diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt index a78ac118c..1921b4f68 100644 --- a/benchmark/CMakeLists.txt +++ b/benchmark/CMakeLists.txt @@ -7,9 +7,9 @@ include(AddCladBenchmark) CB_ADD_GBENCHMARK(Simple Simple.cpp) CB_ADD_GBENCHMARK(AlgorithmicComplexity AlgorithmicComplexity.cpp) CB_ADD_GBENCHMARK(ArrayExpressionTemplates ArrayExpressionTemplates.cpp) -if (ENABLE_ENZYME_BACKEND) +if (CLAD_ENABLE_ENZYME_BACKEND) CB_ADD_GBENCHMARK(EnzymeCladComparison EnzymeCladComparison.cpp) -endif(ENABLE_ENZYME_BACKEND) +endif(CLAD_ENABLE_ENZYME_BACKEND) CB_ADD_GBENCHMARK(VectorModeComparison VectorModeComparison.cpp) CB_ADD_GBENCHMARK(MemoryComplexity MemoryComplexity.cpp) diff --git a/docs/userDocs/source/user/UsingEnzymeWithinClad.rst b/docs/userDocs/source/user/UsingEnzymeWithinClad.rst index cb31adec8..f60454527 100644 --- a/docs/userDocs/source/user/UsingEnzymeWithinClad.rst +++ b/docs/userDocs/source/user/UsingEnzymeWithinClad.rst @@ -29,15 +29,15 @@ section describes how Enzyme can be used within Clad. Configuring Clad to use Enzyme ================================= To enable the use of enzyme within Clad, one needs to configure Clad to use -Enzyme. This can be done by adding the flag ``-DENABLE_ENZYME_BACKEND=On`` to -cmake while configuring Clad build. Thus the overall cmake command should look -something like this +Enzyme. This can be done by adding the flag ``-DCLAD_ENABLE_ENZYME_BACKEND=On`` +to cmake while configuring Clad build. Thus the overall cmake command should +look something like this .. code-block:: bash cmake ../clad -DClang_DIR=/usr/lib/llvm-11 -DLLVM_DIR=/usr/lib/llvm-11 -DCMAKE_INSTALL_PREFIX=../inst -DLLVM_EXTERNAL_LIT="``which lit``" - -DENABLE_ENZYME_BACKEND=On + -DCLAD_ENABLE_ENZYME_BACKEND=On This flag instructs the build system to download and build Enzyme. Then it is linked as a static library to Clad. @@ -72,4 +72,4 @@ Currently functions that take in arrays, pointers and primitive types(integer and real) as parameters are supported for differentiation with Enzyme within Clad. For more ideas on the type of functions supported, please have a look at ``test/Enzyme/ReverseMode.C`` for examples that can be differentiated within -Clad. \ No newline at end of file +Clad. diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in index a82bd36d7..c35235bcf 100644 --- a/test/lit.site.cfg.in +++ b/test/lit.site.cfg.in @@ -10,7 +10,7 @@ config.llvm_lib_output_intdir = "@LLVM_LIBRARY_OUTPUT_INTDIR@" config.clad_obj_root = "@CLAD_BINARY_DIR@" config.target_triple = "@TARGET_TRIPLE@" config.shlibext = "@TARGET_SHLIBEXT@" -config.have_enzyme = "@ENABLE_ENZYME_BACKEND@" +config.have_enzyme = "@CLAD_ENABLE_ENZYME_BACKEND@" # Support substitution of the tools and libs dirs with user parameters. This is # used when we can't determine the tool dir at configuration time. diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 9c03baa6e..b79bde961 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -16,7 +16,7 @@ if (NOT CLAD_BUILD_STATIC_ONLY) target_link_libraries(clad PRIVATE cladDifferentiator) # Add Enzyme as a backend. - if (ENABLE_ENZYME_BACKEND) + if (CLAD_ENABLE_ENZYME_BACKEND) if (LLVM_VERSION_MAJOR VERSION_LESS 9 OR LLVM_VERSION_MAJOR VERSION_GREATER 12) message(FATAL_ERROR "The enzyme backend is supported only in LLVM versions 9 to 12") @@ -94,6 +94,6 @@ if (NOT CLAD_BUILD_STATIC_ONLY) target_link_libraries(clad PUBLIC ${_enzyme_link_flags}) add_dependencies(clad LLVMEnzyme) - endif(ENABLE_ENZYME_BACKEND) + endif(CLAD_ENABLE_ENZYME_BACKEND) endif() set_source_files_properties(ClangPlugin.cpp PROPERTIES COMPILE_DEFINITIONS CLANG_MAJOR_VERSION="${CLANG_VERSION_MAJOR}")