From 825d30c172e7a2742d62099387d6081a8e8bc531 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Wed, 14 Feb 2024 15:33:42 -0500 Subject: [PATCH] Requesting a clean build directory also clears Jitify cache (#15052) Developers expect that 'cleaning' a build directory will remove all forms of cached files ( objects, libraries, jit cache, etc ). To ensure that happens consistenly we also need to remove the jitify cache objects for cudf. Authors: - Robert Maynard (https://github.com/robertmaynard) Approvers: - Bradley Dice (https://github.com/bdice) - Mark Harris (https://github.com/harrism) URL: https://github.com/rapidsai/cudf/pull/15052 --- cpp/cmake/Modules/JitifyPreprocessKernels.cmake | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cpp/cmake/Modules/JitifyPreprocessKernels.cmake b/cpp/cmake/Modules/JitifyPreprocessKernels.cmake index 8a40be1dc94..8c4e2b47fca 100644 --- a/cpp/cmake/Modules/JitifyPreprocessKernels.cmake +++ b/cpp/cmake/Modules/JitifyPreprocessKernels.cmake @@ -69,3 +69,18 @@ add_custom_target( DEPENDS ${JIT_PREPROCESSED_FILES} COMMENT "Target representing jitified files." ) + +# when a user requests CMake to clean the build directory +# +# * `cmake --build --target clean` +# * `cmake --build --clean-first` +# * ninja clean +# +# We also remove the jitify2 program cache as well. This ensures that we don't keep older versions +# of the programs in cache +set(cache_path "$ENV{HOME}/.cudf") +if(ENV{LIBCUDF_KERNEL_CACHE_PATH}) + set(cache_path "$ENV{LIBCUDF_KERNEL_CACHE_PATH}") +endif() +cmake_path(APPEND cache_path "${CUDF_VERSION}/") +set_target_properties(jitify_preprocess_run PROPERTIES ADDITIONAL_CLEAN_FILES "${cache_path}")