From ca64751c205e2db2c5610433dc84382651bf225e Mon Sep 17 00:00:00 2001 From: Cedric Augonnet Date: Fri, 10 Jan 2025 00:40:30 +0100 Subject: [PATCH 1/2] Add a rrule to build the examples with STF too --- examples/CMakeLists.txt | 18 ++++++++++++++++++ examples/simple_radar_pipeline.h | 6 +++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 563b6fc3..cb1ae68f 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -20,6 +20,10 @@ set(examples black_scholes print_styles) +set(stf_examples + simple_radar_pipeline +) + @@ -54,6 +58,20 @@ foreach( example ${examples} ) target_link_libraries(${example} example_lib) endforeach() +foreach( example ${examples} ) + string( CONCAT file ${example} ".cu" ) + + set(output_name "${example}_stf") + add_executable( ${output_name} ${file} ) + + # Add the -DUSE_STF compilation flag + target_compile_definitions(${output_name} PRIVATE USE_STF) + + target_link_libraries(${output_name} example_lib) +endforeach() + + + # Build proprietary examples file (GLOB_RECURSE proprietary_sources CONFIGURE_DEPENDS ${CMAKE_SOURCE_DIR}/proprietary/*/examples/*.cu) foreach (pexample ${proprietary_sources}) diff --git a/examples/simple_radar_pipeline.h b/examples/simple_radar_pipeline.h index 7aea6c8d..2e68b1ba 100644 --- a/examples/simple_radar_pipeline.h +++ b/examples/simple_radar_pipeline.h @@ -35,9 +35,9 @@ #include #include -#ifndef USE_STF -#define USE_STF 1 -#endif +//#ifndef USE_STF +////#define USE_STF 1 +//#endif using namespace matx; From dc7f8ab8cea3e9f43522ca834ea08ab18c1ce17a Mon Sep 17 00:00:00 2001 From: Cedric Augonnet Date: Wed, 22 Jan 2025 08:40:40 +0100 Subject: [PATCH 2/2] Minor cleanups --- examples/CMakeLists.txt | 8 +------- examples/simple_radar_pipeline.h | 4 ---- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index cb1ae68f..fbbd1be1 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -20,13 +20,6 @@ set(examples black_scholes print_styles) -set(stf_examples - simple_radar_pipeline -) - - - - add_library(example_lib INTERFACE) target_include_directories(example_lib SYSTEM INTERFACE ${CUTLASS_INC} ${pybind11_INCLUDE_DIR} ${PYTHON_INCLUDE_DIRS}) @@ -58,6 +51,7 @@ foreach( example ${examples} ) target_link_libraries(${example} example_lib) endforeach() +# Compile all examples with CUDASTF and append their name with _stf foreach( example ${examples} ) string( CONCAT file ${example} ".cu" ) diff --git a/examples/simple_radar_pipeline.h b/examples/simple_radar_pipeline.h index 2e68b1ba..4ef3f590 100644 --- a/examples/simple_radar_pipeline.h +++ b/examples/simple_radar_pipeline.h @@ -35,10 +35,6 @@ #include #include -//#ifndef USE_STF -////#define USE_STF 1 -//#endif - using namespace matx; /**