diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 42242e8..cbed319 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -60,7 +60,7 @@ jobs: env: BACKEND_ARG: ${{ matrix.backend }} shell: bash - run: cmake -Bbuild -DBUILD_EXAMPLES=ON $BACKEND_ARG + run: cmake -Bbuild $BACKEND_ARG - name: Build shell: bash diff --git a/CMakeLists.txt b/CMakeLists.txt index badde07..ac60396 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ project(RTNeural-experimental VERSION 1.0.0) get_directory_property(parent_dir PARENT_DIRECTORY) if("${parent_dir}" STREQUAL "") - set(is_toplevel 1) + set(is_toplevel ON) include(cmake/CPM.cmake) option(RTNEURAL_EIGEN "Use Eigen library for vector operations" OFF) option(RTNEURAL_XSIMD "Use xsimd library for vector operations" OFF) @@ -15,7 +15,7 @@ if("${parent_dir}" STREQUAL "") OPTIONS "RTNEURAL_EIGEN ${RTNEURAL_EIGEN}" "RTNEURAL_XSIMD ${RTNEURAL_XSIMD}" "RTNEURAL_STL ${RTNEURAL_STL}" ) else() - set(is_toplevel 0) + set(is_toplevel OFF) endif() if(APPLE) @@ -26,6 +26,6 @@ if(APPLE) target_include_directories(RTNeural-accelerate INTERFACE include/RTNeural-accelerate) endif() -if(is_toplevel) +if(${is_toplevel}) add_subdirectory(examples) endif() diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 588f02b..3d3cb0e 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -17,3 +17,4 @@ endfunction() if(APPLE) add_subdirectory(accelerate) endif() +add_subdirectory(residual_connection) diff --git a/examples/residual_connection/CMakeLists.txt b/examples/residual_connection/CMakeLists.txt new file mode 100644 index 0000000..c6d35aa --- /dev/null +++ b/examples/residual_connection/CMakeLists.txt @@ -0,0 +1 @@ +create_example(residual_connection) diff --git a/examples/residual_connection/residual_connection.cpp b/examples/residual_connection/residual_connection.cpp new file mode 100644 index 0000000..6c727ba --- /dev/null +++ b/examples/residual_connection/residual_connection.cpp @@ -0,0 +1,3 @@ +// +// Created by jatin on 8/17/23. +//