From a8d8af9901254aafe0dc5c769041d2edc266211e Mon Sep 17 00:00:00 2001 From: Lukas Thomann Date: Wed, 25 Feb 2026 21:56:48 +0100 Subject: [PATCH 1/3] cleaned up the cmake stuff a little bit, added new features for vcpkg to cover the dependencies automatically (for the most part) --- cmake/HalideUtils.cmake | 99 ------------------- cmake/{ => find}/BuildBackwardCpp.cmake | 0 cmake/{ => find}/BuildCereal.cmake | 0 .../{ => find}/BuildFlashlightSequence.cmake | 0 cmake/{ => find}/BuildFlashlightText.cmake | 0 cmake/{ => find}/BuildGloo.cmake | 0 cmake/{ => find}/BuildGoogleTest.cmake | 0 cmake/{ => find}/BuildSndFile.cmake | 0 cmake/{ => find}/BuildStb.cmake | 0 cmake/{ => find}/Buildsox.cmake | 0 cmake/{ => find}/FindCBLAS.cmake | 0 cmake/{ => find}/FindCUDNN.cmake | 0 cmake/{ => find}/FindFFTW3.cmake | 0 cmake/{ => find}/FindFLAC.cmake | 0 cmake/{ => find}/FindFilesystem.cmake | 0 cmake/{ => find}/FindGLOG.cmake | 0 cmake/{ => find}/FindGMock.cmake | 0 cmake/{ => find}/FindMKL.cmake | 0 cmake/{ => find}/FindNCCL.cmake | 0 cmake/{ => find}/FindOgg.cmake | 0 cmake/{ => find}/FindSndFile.cmake | 0 cmake/{ => find}/FindVorbis.cmake | 0 cmake/{ => find}/Findgflags.cmake | 0 cmake/{ => find}/Findsox.cmake | 0 cmake/{ => utils}/InternalUtils.cmake | 32 +++--- cmake/{ => utils}/TestUtils.cmake | 0 cmake/{ => utils}/flashlightConfig.cmake.in | 0 cmake/utils/toolchain.cmake | 10 +- vcpkg.json | 35 ++++++- 29 files changed, 54 insertions(+), 122 deletions(-) delete mode 100644 cmake/HalideUtils.cmake rename cmake/{ => find}/BuildBackwardCpp.cmake (100%) rename cmake/{ => find}/BuildCereal.cmake (100%) rename cmake/{ => find}/BuildFlashlightSequence.cmake (100%) rename cmake/{ => find}/BuildFlashlightText.cmake (100%) rename cmake/{ => find}/BuildGloo.cmake (100%) rename cmake/{ => find}/BuildGoogleTest.cmake (100%) rename cmake/{ => find}/BuildSndFile.cmake (100%) rename cmake/{ => find}/BuildStb.cmake (100%) rename cmake/{ => find}/Buildsox.cmake (100%) rename cmake/{ => find}/FindCBLAS.cmake (100%) rename cmake/{ => find}/FindCUDNN.cmake (100%) rename cmake/{ => find}/FindFFTW3.cmake (100%) rename cmake/{ => find}/FindFLAC.cmake (100%) rename cmake/{ => find}/FindFilesystem.cmake (100%) rename cmake/{ => find}/FindGLOG.cmake (100%) rename cmake/{ => find}/FindGMock.cmake (100%) rename cmake/{ => find}/FindMKL.cmake (100%) rename cmake/{ => find}/FindNCCL.cmake (100%) rename cmake/{ => find}/FindOgg.cmake (100%) rename cmake/{ => find}/FindSndFile.cmake (100%) rename cmake/{ => find}/FindVorbis.cmake (100%) rename cmake/{ => find}/Findgflags.cmake (100%) rename cmake/{ => find}/Findsox.cmake (100%) rename cmake/{ => utils}/InternalUtils.cmake (95%) rename cmake/{ => utils}/TestUtils.cmake (100%) rename cmake/{ => utils}/flashlightConfig.cmake.in (100%) diff --git a/cmake/HalideUtils.cmake b/cmake/HalideUtils.cmake deleted file mode 100644 index d1b0831..0000000 --- a/cmake/HalideUtils.cmake +++ /dev/null @@ -1,99 +0,0 @@ -# Adds a Halide library. Compiles a Halide AOT-generator at compile time, -# then runs the generator to produce header and lib artifacts that -# can be linked to a passed target. -# -# SRC - the src file for the project -# NAME - the name of the resulting target -# LIBS - libraries to which the generated library will be linked -# PREPROC - preprocessor defs to pass to the new target -# LINK_TO - target to which to link the generated pipeline -function(fl_add_and_link_halide_lib) - set(options) - set(oneValueArgs SRC NAME LINK_TO) - set(multiValueArgs LIBS PREPROC) - cmake_parse_arguments(fl_add_and_link_halide_lib - "${options}" - "${oneValueArgs}" - "${multiValueArgs}" - ${ARGN}) - - # Generator binary - set(GENERATOR_TARGET ${fl_add_and_link_halide_lib_NAME}_generator) - # Generator output - set(GENERATED_TARGET generate_${fl_add_and_link_halide_lib_NAME}) - add_executable(${GENERATOR_TARGET} ${fl_add_and_link_halide_lib_SRC}) - target_link_libraries( - ${GENERATOR_TARGET} - PRIVATE - Halide::Halide - ${LIBS}) - target_compile_definitions( - ${GENERATOR_TARGET} - PRIVATE - ${PREPROC}) - - # Run the generator - # LLVM may leak memory during Halide compilation - if building with ASAN, - # the generator might fail. Disable leack checking when executing generators - set(GENERATED_LIB "${fl_add_and_link_halide_lib_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}") - set(GENERATED_HEADER "${fl_add_and_link_halide_lib_NAME}.h") - add_custom_command(OUTPUT ${GENERATED_HEADER} "${GENERATED_LIB}" - DEPENDS ${GENERATOR_TARGET} - COMMAND ${CMAKE_COMMAND} -E env "ASAN_OPTIONS=detect_leaks=0" $ - VERBATIM) - add_custom_target(${GENERATED_TARGET} - DEPENDS ${GENERATED_HEADER} "${GENERATED_LIB}") - add_dependencies(${GENERATED_TARGET} ${GENERATOR_TARGET}) - - set(LIB_PATH ${CMAKE_CURRENT_BINARY_DIR}/${GENERATED_LIB}) - message(STATUS "Will generate AOT Halide Pipeline ${fl_add_and_link_halide_lib_NAME}") - - # TODO: use an IMPORTED target? Might be cleaner - # add_library(${fl_add_and_link_halide_lib_NAME} STATIC IMPORTED) - # set_target_properties(${fl_add_and_link_halide_lib_NAME} PROPERTIES - # INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR} - # IMPORTED_LOCATION "${GENERATED_LIB}" - # INTERFACE_LINK_LIBRARIES Halide::Halide) - # add_dependencies(${fl_add_and_link_halide_lib_NAME} ${GENERATED_TARGET}) - - # Link the generated Halide lib to the target - add_dependencies(${fl_add_and_link_halide_lib_LINK_TO} ${GENERATED_TARGET}) - # Ensure we can find generated headers - target_include_directories( - ${fl_add_and_link_halide_lib_LINK_TO} PUBLIC - $) - # For now, this linkeage is private, which means the Flashlight core needs - # to wrap Halide pipelines when exposing them to external binaries. - # Properly installing the Halide lib will facilitate public linkeage. - target_link_libraries(${fl_add_and_link_halide_lib_LINK_TO} PRIVATE ${LIB_PATH}) -endfunction(fl_add_and_link_halide_lib) - -# Adds a Halide library that is linked with Flashlight. -# -# If used from an included CMake list, we won't run into -# cmake_policy(SET CMP0079 NEW) issues. Halide pipelines -# compiled for tests should use fl_add_and_link_halide_lib -# instead since those are called via calls to `add_subdirectories`. -# CMake 3.13 resolves this. -function(fl_add_halide_lib) - set(options) - set(oneValueArgs SRC NAME) - set(multiValueArgs LIBS PREPROC) - cmake_parse_arguments(fl_add_halide_lib "${options}" "${oneValueArgs}" - "${multiValueArgs}" ${ARGN}) - - fl_add_and_link_halide_lib( - SRC ${fl_add_halide_lib_SRC} - NAME ${fl_add_halide_lib_NAME} - LIBS ${fl_add_halide_lib_LIBS} - PREPROC ${fl_add_halide_lib_PREPROC} - LINK_TO flashlight - ) - - # TODO: An IMPORTED target could help with this - # cmake_policy(SET CMP0079 NEW) - # target_link_libraries(flashlight PUBLIC ...) - # add_dependencies(flashlight ${GENERATED_TARGET}) - # Generated Halide libs get installed too - # set(INSTALLABLE_TARGETS ${INSTALLABLE_TARGETS} ${LIB_PATH} PARENT_SCOPE) -endfunction(fl_add_halide_lib) diff --git a/cmake/BuildBackwardCpp.cmake b/cmake/find/BuildBackwardCpp.cmake similarity index 100% rename from cmake/BuildBackwardCpp.cmake rename to cmake/find/BuildBackwardCpp.cmake diff --git a/cmake/BuildCereal.cmake b/cmake/find/BuildCereal.cmake similarity index 100% rename from cmake/BuildCereal.cmake rename to cmake/find/BuildCereal.cmake diff --git a/cmake/BuildFlashlightSequence.cmake b/cmake/find/BuildFlashlightSequence.cmake similarity index 100% rename from cmake/BuildFlashlightSequence.cmake rename to cmake/find/BuildFlashlightSequence.cmake diff --git a/cmake/BuildFlashlightText.cmake b/cmake/find/BuildFlashlightText.cmake similarity index 100% rename from cmake/BuildFlashlightText.cmake rename to cmake/find/BuildFlashlightText.cmake diff --git a/cmake/BuildGloo.cmake b/cmake/find/BuildGloo.cmake similarity index 100% rename from cmake/BuildGloo.cmake rename to cmake/find/BuildGloo.cmake diff --git a/cmake/BuildGoogleTest.cmake b/cmake/find/BuildGoogleTest.cmake similarity index 100% rename from cmake/BuildGoogleTest.cmake rename to cmake/find/BuildGoogleTest.cmake diff --git a/cmake/BuildSndFile.cmake b/cmake/find/BuildSndFile.cmake similarity index 100% rename from cmake/BuildSndFile.cmake rename to cmake/find/BuildSndFile.cmake diff --git a/cmake/BuildStb.cmake b/cmake/find/BuildStb.cmake similarity index 100% rename from cmake/BuildStb.cmake rename to cmake/find/BuildStb.cmake diff --git a/cmake/Buildsox.cmake b/cmake/find/Buildsox.cmake similarity index 100% rename from cmake/Buildsox.cmake rename to cmake/find/Buildsox.cmake diff --git a/cmake/FindCBLAS.cmake b/cmake/find/FindCBLAS.cmake similarity index 100% rename from cmake/FindCBLAS.cmake rename to cmake/find/FindCBLAS.cmake diff --git a/cmake/FindCUDNN.cmake b/cmake/find/FindCUDNN.cmake similarity index 100% rename from cmake/FindCUDNN.cmake rename to cmake/find/FindCUDNN.cmake diff --git a/cmake/FindFFTW3.cmake b/cmake/find/FindFFTW3.cmake similarity index 100% rename from cmake/FindFFTW3.cmake rename to cmake/find/FindFFTW3.cmake diff --git a/cmake/FindFLAC.cmake b/cmake/find/FindFLAC.cmake similarity index 100% rename from cmake/FindFLAC.cmake rename to cmake/find/FindFLAC.cmake diff --git a/cmake/FindFilesystem.cmake b/cmake/find/FindFilesystem.cmake similarity index 100% rename from cmake/FindFilesystem.cmake rename to cmake/find/FindFilesystem.cmake diff --git a/cmake/FindGLOG.cmake b/cmake/find/FindGLOG.cmake similarity index 100% rename from cmake/FindGLOG.cmake rename to cmake/find/FindGLOG.cmake diff --git a/cmake/FindGMock.cmake b/cmake/find/FindGMock.cmake similarity index 100% rename from cmake/FindGMock.cmake rename to cmake/find/FindGMock.cmake diff --git a/cmake/FindMKL.cmake b/cmake/find/FindMKL.cmake similarity index 100% rename from cmake/FindMKL.cmake rename to cmake/find/FindMKL.cmake diff --git a/cmake/FindNCCL.cmake b/cmake/find/FindNCCL.cmake similarity index 100% rename from cmake/FindNCCL.cmake rename to cmake/find/FindNCCL.cmake diff --git a/cmake/FindOgg.cmake b/cmake/find/FindOgg.cmake similarity index 100% rename from cmake/FindOgg.cmake rename to cmake/find/FindOgg.cmake diff --git a/cmake/FindSndFile.cmake b/cmake/find/FindSndFile.cmake similarity index 100% rename from cmake/FindSndFile.cmake rename to cmake/find/FindSndFile.cmake diff --git a/cmake/FindVorbis.cmake b/cmake/find/FindVorbis.cmake similarity index 100% rename from cmake/FindVorbis.cmake rename to cmake/find/FindVorbis.cmake diff --git a/cmake/Findgflags.cmake b/cmake/find/Findgflags.cmake similarity index 100% rename from cmake/Findgflags.cmake rename to cmake/find/Findgflags.cmake diff --git a/cmake/Findsox.cmake b/cmake/find/Findsox.cmake similarity index 100% rename from cmake/Findsox.cmake rename to cmake/find/Findsox.cmake diff --git a/cmake/InternalUtils.cmake b/cmake/utils/InternalUtils.cmake similarity index 95% rename from cmake/InternalUtils.cmake rename to cmake/utils/InternalUtils.cmake index 9f0075f..374f08d 100644 --- a/cmake/InternalUtils.cmake +++ b/cmake/utils/InternalUtils.cmake @@ -9,7 +9,8 @@ function(add_coverage_to_target) -O0 # TODO: reconcile this with CMake modes for something cleaner -g $<$:--coverage> - ) + ) + if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.13) target_link_options(${add_coverage_to_target_TARGET} PUBLIC @@ -28,7 +29,8 @@ function(setup_install_targets) "${multiValueArgs}" ${ARGN}) list(LENGTH setup_install_targets_INSTALL_TARGETS TARGETS_LENGTH) - if (${TARGETS_LENGTH} EQUAL 0) + + if(${TARGETS_LENGTH} EQUAL 0) message(FATAL_ERROR "Flashlight setup_install_targets called with " "empty targets list.") endif() @@ -44,7 +46,7 @@ function(setup_install_targets) ARCHIVE DESTINATION ${FL_INSTALL_LIB_DIR} FRAMEWORK DESTINATION framework INCLUDES DESTINATION ${FL_INSTALL_INC_DIR} - ) + ) # Write and install targets file install( @@ -52,44 +54,43 @@ function(setup_install_targets) NAMESPACE flashlight:: DESTINATION ${FL_INSTALL_CMAKE_DIR} COMPONENT flashlight - ) + ) # Write config file (used by projects including fl, such as examples) include(CMakePackageConfigHelpers) set(INCLUDE_DIRS include) set(CMAKE_DIR ${FL_INSTALL_CMAKE_DIR}) configure_package_config_file( - ${PROJECT_SOURCE_DIR}/cmake/flashlightConfig.cmake.in + ${PROJECT_SOURCE_DIR}/cmake/utils/flashlightConfig.cmake.in cmake/install/${FL_CONFIG_CMAKE_BUILD_DIR}/flashlightConfig.cmake INSTALL_DESTINATION ${FL_INSTALL_CMAKE_DIR} PATH_VARS INCLUDE_DIRS CMAKE_DIR - ) + ) write_basic_package_version_file( cmake/install/${FL_CONFIG_CMAKE_BUILD_DIR}/flashlightConfigVersion.cmake COMPATIBILITY SameMajorVersion - ) + ) install(FILES ${PROJECT_BINARY_DIR}/cmake/install/flashlightConfig.cmake ${PROJECT_BINARY_DIR}/cmake/install/flashlightConfigVersion.cmake DESTINATION ${FL_INSTALL_CMAKE_DIR} COMPONENT flashlight - ) + ) set_target_properties(${setup_install_targets_INSTALL_TARGETS} PROPERTIES VERSION "${flashlight_VERSION}" SOVERSION "${flashlight_VERSION_MAJOR}") endfunction(setup_install_targets) function(setup_install_headers HEADER_DIR DEST_DIR) - # Move headers install( DIRECTORY ${HEADER_DIR} COMPONENT headers DESTINATION ${DEST_DIR} FILES_MATCHING # preserve directory structure - PATTERN "*.h" - PATTERN "*.hpp" + PATTERN "*.h" + PATTERN "*.hpp" PATTERN "*.cuh" # TODO: make this conditional, e.g. $ PATTERN "test*" EXCLUDE PATTERN "tests" EXCLUDE @@ -103,17 +104,17 @@ function(setup_install_headers HEADER_DIR DEST_DIR) PATTERN "experimental" EXCLUDE PATTERN "plugincompiler" EXCLUDE PATTERN ".git" EXCLUDE - ) + ) endfunction(setup_install_headers) function(setup_install_find_module CONFIG_PATH) # Only actually move module files if doing a standalone install; otherwise, # assume we're being installed by a package manager - if (FL_BUILD_STANDALONE) + if(FL_BUILD_STANDALONE) install( FILES ${CONFIG_PATH} DESTINATION ${FL_INSTALL_CMAKE_DIR} - ) + ) endif() endfunction() @@ -121,7 +122,7 @@ function(set_executable_output_directory EXEC_TARGET DIRECTORY) set_target_properties(${EXEC_TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${DIRECTORY} - ) + ) endfunction() # Small utility function which wraps cmake_dependent options and throws an error if the user @@ -143,5 +144,6 @@ function(fl_dependent_option) message(FATAL_ERROR "${_dep} Required to build ${_option}") endif() endforeach() + cmake_dependent_option(${_option} ${_text} "${_val}" "${_deps}" ${_frce}) endfunction() diff --git a/cmake/TestUtils.cmake b/cmake/utils/TestUtils.cmake similarity index 100% rename from cmake/TestUtils.cmake rename to cmake/utils/TestUtils.cmake diff --git a/cmake/flashlightConfig.cmake.in b/cmake/utils/flashlightConfig.cmake.in similarity index 100% rename from cmake/flashlightConfig.cmake.in rename to cmake/utils/flashlightConfig.cmake.in diff --git a/cmake/utils/toolchain.cmake b/cmake/utils/toolchain.cmake index 57071c2..9d75007 100644 --- a/cmake/utils/toolchain.cmake +++ b/cmake/utils/toolchain.cmake @@ -8,12 +8,16 @@ message(STATUS "---- fm_cmake toolchain ----") #append cmake dir to module path set(FM_CMAKE_LIBRARY_DIR ${CMAKE_CURRENT_LIST_DIR}) -list(APPEND CMAKE_MODULE_PATH "${FM_CMAKE_LIBRARY_DIR}") -message(STATUS "appended cmake/utils/ to cmake module path") +set(FM_CMAKE_UTILITY_DIR "${FM_CMAKE_LIBRARY_DIR}") +list(APPEND CMAKE_MODULE_PATH "${FM_CMAKE_UTILITY_DIR}") +message(VERBOSE "appended utility dir to cmake module path (${FM_CMAKE_UTILITY_DIR})") list(APPEND CMAKE_MODULE_PATH "${FM_CMAKE_LIBRARY_DIR}/../") -message(STATUS "appended (${FM_CMAKE_LIBRARY_DIR}/../) cmake/ to cmake module path") +message(VERBOSE "appended (${FM_CMAKE_LIBRARY_DIR}/../) cmake/ to cmake module path") +set(FM_CMAKE_FIND_SCRIPT_DIR "${FM_CMAKE_LIBRARY_DIR}/../find/") +list(APPEND CMAKE_MODULE_PATH "${FM_CMAKE_FIND_SCRIPT_DIR}") +message(VERBOSE "appended find scripts to module path (${FM_CMAKE_FIND_SCRIPT_DIR})") include(fm_assertions) diff --git a/vcpkg.json b/vcpkg.json index 7dcf289..0463957 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -6,14 +6,39 @@ "gtest" ], "features": { - "cuda": { - "description": "Dependencies for gpu backend", + "distributed": { + "description": "Dependencies for distributed backend", + "dependencies": [ + "mpi" + ] + }, + "runtime": { + "description": "flashmini runtime helpers", + "dependencies": [ + "glog", + "gflags" + ] + }, + "vision": { + "description": "vision pkg", + "dependencies": [ + "opencv", + "stb" + ] + }, + "text": { + "description": "text pkg", "dependencies": [] }, - "cpu": { - "description": "Dependencies for cpu backend", + "speech": { + "description": "speech pkg", "dependencies": [ - "onednn" + "libsndfile", + "libogg", + "libvorbis", + "libflac", + "fftw3", + "openblas" ] } } From 7898f9a4caf5ec0daee67a4e44e5da77c56c027d Mon Sep 17 00:00:00 2001 From: Lukas Thomann Date: Wed, 25 Feb 2026 22:01:32 +0100 Subject: [PATCH 2/3] renamed "find" to "dependencies" --- cmake/{find => dependencies}/BuildBackwardCpp.cmake | 0 cmake/{find => dependencies}/BuildCereal.cmake | 0 .../BuildFlashlightSequence.cmake | 0 .../{find => dependencies}/BuildFlashlightText.cmake | 0 cmake/{find => dependencies}/BuildGloo.cmake | 0 cmake/{find => dependencies}/BuildGoogleTest.cmake | 0 cmake/{find => dependencies}/BuildSndFile.cmake | 0 cmake/{find => dependencies}/BuildStb.cmake | 0 cmake/{find => dependencies}/Buildsox.cmake | 0 cmake/{find => dependencies}/FindCBLAS.cmake | 0 cmake/{find => dependencies}/FindCUDNN.cmake | 0 cmake/{find => dependencies}/FindFFTW3.cmake | 0 cmake/{find => dependencies}/FindFLAC.cmake | 0 cmake/{find => dependencies}/FindFilesystem.cmake | 0 cmake/{find => dependencies}/FindGLOG.cmake | 0 cmake/{find => dependencies}/FindGMock.cmake | 0 cmake/{find => dependencies}/FindMKL.cmake | 0 cmake/{find => dependencies}/FindNCCL.cmake | 0 cmake/{find => dependencies}/FindOgg.cmake | 0 cmake/{find => dependencies}/FindSndFile.cmake | 0 cmake/{find => dependencies}/FindVorbis.cmake | 0 cmake/{find => dependencies}/Findgflags.cmake | 0 cmake/{find => dependencies}/Findsox.cmake | 0 cmake/utils/toolchain.cmake | 2 +- flashlight/fl/autograd/tensor/backend/cudnn/RNN.cpp | 12 ++++-------- 25 files changed, 5 insertions(+), 9 deletions(-) rename cmake/{find => dependencies}/BuildBackwardCpp.cmake (100%) rename cmake/{find => dependencies}/BuildCereal.cmake (100%) rename cmake/{find => dependencies}/BuildFlashlightSequence.cmake (100%) rename cmake/{find => dependencies}/BuildFlashlightText.cmake (100%) rename cmake/{find => dependencies}/BuildGloo.cmake (100%) rename cmake/{find => dependencies}/BuildGoogleTest.cmake (100%) rename cmake/{find => dependencies}/BuildSndFile.cmake (100%) rename cmake/{find => dependencies}/BuildStb.cmake (100%) rename cmake/{find => dependencies}/Buildsox.cmake (100%) rename cmake/{find => dependencies}/FindCBLAS.cmake (100%) rename cmake/{find => dependencies}/FindCUDNN.cmake (100%) rename cmake/{find => dependencies}/FindFFTW3.cmake (100%) rename cmake/{find => dependencies}/FindFLAC.cmake (100%) rename cmake/{find => dependencies}/FindFilesystem.cmake (100%) rename cmake/{find => dependencies}/FindGLOG.cmake (100%) rename cmake/{find => dependencies}/FindGMock.cmake (100%) rename cmake/{find => dependencies}/FindMKL.cmake (100%) rename cmake/{find => dependencies}/FindNCCL.cmake (100%) rename cmake/{find => dependencies}/FindOgg.cmake (100%) rename cmake/{find => dependencies}/FindSndFile.cmake (100%) rename cmake/{find => dependencies}/FindVorbis.cmake (100%) rename cmake/{find => dependencies}/Findgflags.cmake (100%) rename cmake/{find => dependencies}/Findsox.cmake (100%) diff --git a/cmake/find/BuildBackwardCpp.cmake b/cmake/dependencies/BuildBackwardCpp.cmake similarity index 100% rename from cmake/find/BuildBackwardCpp.cmake rename to cmake/dependencies/BuildBackwardCpp.cmake diff --git a/cmake/find/BuildCereal.cmake b/cmake/dependencies/BuildCereal.cmake similarity index 100% rename from cmake/find/BuildCereal.cmake rename to cmake/dependencies/BuildCereal.cmake diff --git a/cmake/find/BuildFlashlightSequence.cmake b/cmake/dependencies/BuildFlashlightSequence.cmake similarity index 100% rename from cmake/find/BuildFlashlightSequence.cmake rename to cmake/dependencies/BuildFlashlightSequence.cmake diff --git a/cmake/find/BuildFlashlightText.cmake b/cmake/dependencies/BuildFlashlightText.cmake similarity index 100% rename from cmake/find/BuildFlashlightText.cmake rename to cmake/dependencies/BuildFlashlightText.cmake diff --git a/cmake/find/BuildGloo.cmake b/cmake/dependencies/BuildGloo.cmake similarity index 100% rename from cmake/find/BuildGloo.cmake rename to cmake/dependencies/BuildGloo.cmake diff --git a/cmake/find/BuildGoogleTest.cmake b/cmake/dependencies/BuildGoogleTest.cmake similarity index 100% rename from cmake/find/BuildGoogleTest.cmake rename to cmake/dependencies/BuildGoogleTest.cmake diff --git a/cmake/find/BuildSndFile.cmake b/cmake/dependencies/BuildSndFile.cmake similarity index 100% rename from cmake/find/BuildSndFile.cmake rename to cmake/dependencies/BuildSndFile.cmake diff --git a/cmake/find/BuildStb.cmake b/cmake/dependencies/BuildStb.cmake similarity index 100% rename from cmake/find/BuildStb.cmake rename to cmake/dependencies/BuildStb.cmake diff --git a/cmake/find/Buildsox.cmake b/cmake/dependencies/Buildsox.cmake similarity index 100% rename from cmake/find/Buildsox.cmake rename to cmake/dependencies/Buildsox.cmake diff --git a/cmake/find/FindCBLAS.cmake b/cmake/dependencies/FindCBLAS.cmake similarity index 100% rename from cmake/find/FindCBLAS.cmake rename to cmake/dependencies/FindCBLAS.cmake diff --git a/cmake/find/FindCUDNN.cmake b/cmake/dependencies/FindCUDNN.cmake similarity index 100% rename from cmake/find/FindCUDNN.cmake rename to cmake/dependencies/FindCUDNN.cmake diff --git a/cmake/find/FindFFTW3.cmake b/cmake/dependencies/FindFFTW3.cmake similarity index 100% rename from cmake/find/FindFFTW3.cmake rename to cmake/dependencies/FindFFTW3.cmake diff --git a/cmake/find/FindFLAC.cmake b/cmake/dependencies/FindFLAC.cmake similarity index 100% rename from cmake/find/FindFLAC.cmake rename to cmake/dependencies/FindFLAC.cmake diff --git a/cmake/find/FindFilesystem.cmake b/cmake/dependencies/FindFilesystem.cmake similarity index 100% rename from cmake/find/FindFilesystem.cmake rename to cmake/dependencies/FindFilesystem.cmake diff --git a/cmake/find/FindGLOG.cmake b/cmake/dependencies/FindGLOG.cmake similarity index 100% rename from cmake/find/FindGLOG.cmake rename to cmake/dependencies/FindGLOG.cmake diff --git a/cmake/find/FindGMock.cmake b/cmake/dependencies/FindGMock.cmake similarity index 100% rename from cmake/find/FindGMock.cmake rename to cmake/dependencies/FindGMock.cmake diff --git a/cmake/find/FindMKL.cmake b/cmake/dependencies/FindMKL.cmake similarity index 100% rename from cmake/find/FindMKL.cmake rename to cmake/dependencies/FindMKL.cmake diff --git a/cmake/find/FindNCCL.cmake b/cmake/dependencies/FindNCCL.cmake similarity index 100% rename from cmake/find/FindNCCL.cmake rename to cmake/dependencies/FindNCCL.cmake diff --git a/cmake/find/FindOgg.cmake b/cmake/dependencies/FindOgg.cmake similarity index 100% rename from cmake/find/FindOgg.cmake rename to cmake/dependencies/FindOgg.cmake diff --git a/cmake/find/FindSndFile.cmake b/cmake/dependencies/FindSndFile.cmake similarity index 100% rename from cmake/find/FindSndFile.cmake rename to cmake/dependencies/FindSndFile.cmake diff --git a/cmake/find/FindVorbis.cmake b/cmake/dependencies/FindVorbis.cmake similarity index 100% rename from cmake/find/FindVorbis.cmake rename to cmake/dependencies/FindVorbis.cmake diff --git a/cmake/find/Findgflags.cmake b/cmake/dependencies/Findgflags.cmake similarity index 100% rename from cmake/find/Findgflags.cmake rename to cmake/dependencies/Findgflags.cmake diff --git a/cmake/find/Findsox.cmake b/cmake/dependencies/Findsox.cmake similarity index 100% rename from cmake/find/Findsox.cmake rename to cmake/dependencies/Findsox.cmake diff --git a/cmake/utils/toolchain.cmake b/cmake/utils/toolchain.cmake index 9d75007..47d0dd8 100644 --- a/cmake/utils/toolchain.cmake +++ b/cmake/utils/toolchain.cmake @@ -15,7 +15,7 @@ message(VERBOSE "appended utility dir to cmake module path (${FM_CMAKE_UTILITY_D list(APPEND CMAKE_MODULE_PATH "${FM_CMAKE_LIBRARY_DIR}/../") message(VERBOSE "appended (${FM_CMAKE_LIBRARY_DIR}/../) cmake/ to cmake module path") -set(FM_CMAKE_FIND_SCRIPT_DIR "${FM_CMAKE_LIBRARY_DIR}/../find/") +set(FM_CMAKE_FIND_SCRIPT_DIR "${FM_CMAKE_LIBRARY_DIR}/../dependencies/") list(APPEND CMAKE_MODULE_PATH "${FM_CMAKE_FIND_SCRIPT_DIR}") message(VERBOSE "appended find scripts to module path (${FM_CMAKE_FIND_SCRIPT_DIR})") diff --git a/flashlight/fl/autograd/tensor/backend/cudnn/RNN.cpp b/flashlight/fl/autograd/tensor/backend/cudnn/RNN.cpp index ec209fd..17b242b 100644 --- a/flashlight/fl/autograd/tensor/backend/cudnn/RNN.cpp +++ b/flashlight/fl/autograd/tensor/backend/cudnn/RNN.cpp @@ -167,15 +167,12 @@ std::tuple CudnnAutogradExtension::rnn( TensorDescriptor cyDesc(x.type(), hDims); - size_t workspaceSize = - getWorkspaceSize(handle, rnnDesc, seqLength, xDescs); - size_t reserveSize = - getReserveSize(handle, rnnDesc, seqLength, xDescs); + size_t workspaceSize = getWorkspaceSize(handle, rnnDesc, seqLength, xDescs); + size_t reserveSize = getReserveSize(handle, rnnDesc, seqLength, xDescs); Tensor workspace({static_cast(workspaceSize)}, fl::dtype::b8); // Space must be reused between forward and backward for cuDNN - payload->reserveSpace = - Tensor({static_cast(reserveSize)}, fl::dtype::b8); + payload->reserveSpace = Tensor({static_cast(reserveSize)}, fl::dtype::b8); { auto contiguousX = x.asContiguousTensor(); @@ -265,8 +262,7 @@ std::tuple CudnnAutogradExtension::rnnBackward( int outSize = hiddenSize * (bidirectional ? 2 : 1); DropoutDescriptor dropout(dropProb); - RNNDescriptor rnnDesc( - input.type(), hiddenSize, numLayers, mode, bidirectional, dropout); + RNNDescriptor rnnDesc(input.type(), hiddenSize, numLayers, mode, bidirectional, dropout); setCudnnRnnMathType(input, rnnDesc); TensorDescriptorArray yDesc(seqLength, y.type(), {1, 1, outSize, batchSize}); From 2c798275d277ed27ac2a3d9f9186d822f1817992 Mon Sep 17 00:00:00 2001 From: Lukas Thomann Date: Fri, 27 Feb 2026 20:08:36 +0100 Subject: [PATCH 3/3] accidentally deleted cpu and cuda features --- vcpkg.json | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/vcpkg.json b/vcpkg.json index 0463957..06083f2 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -6,6 +6,16 @@ "gtest" ], "features": { + "cuda": { + "description": "Dependencies for gpu backend", + "dependencies": [] + }, + "cpu": { + "description": "Dependencies for cpu backend", + "dependencies": [ + "onednn" + ] + }, "distributed": { "description": "Dependencies for distributed backend", "dependencies": [ @@ -42,4 +52,4 @@ ] } } -} +} \ No newline at end of file