Skip to content

Commit

Permalink
Move files to lib (#14)
Browse files Browse the repository at this point in the history
Move files into `cpp/lib/`, which enables linting for them.
Formatting will be done in the next PR for easier review.
  • Loading branch information
ProExpertProg authored Oct 19, 2024
1 parent 07088e2 commit 8535f52
Show file tree
Hide file tree
Showing 22 changed files with 29 additions and 29 deletions.
6 changes: 3 additions & 3 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ add_executable(adaptive_hermite_refinement lib/test-triangle.cpp)
target_include_directories(adaptive_hermite_refinement PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(adaptive_hermite_refinement argparse mdspan)

add_library(src-lib OBJECT Naive.cpp Naive.h HermiteRunner.cpp HermiteRunner.h)
target_include_directories(src-lib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
add_library(src-lib OBJECT lib/Naive.cpp lib/Naive.hpp lib/HermiteRunner.cpp lib/HermiteRunner.hpp)
target_include_directories(src-lib PUBLIC lib/)
target_link_libraries(src-lib mdspan fftw-cpp cnpy)

add_subdirectory(bench)

add_executable(naive driver.cpp)
add_executable(naive lib/driver.cpp)
target_link_libraries(naive argparse src-lib)

option(AHR_TEST "Enable AHR tests" ON)
Expand Down
2 changes: 1 addition & 1 deletion cpp/bench/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/..)
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../lib)

add_executable(bench-fft fftw/bench-fft.cpp)
target_link_libraries(bench-fft argparse fftw-cpp)
Expand Down
2 changes: 1 addition & 1 deletion cpp/bench/fftw/bench-fft-fusion.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "fftw-cpp/fftw-cpp.h"

#include "timing.h"
#include "timing.hpp"

#include <argparse/argparse.hpp>
#include <iostream>
Expand Down
4 changes: 2 additions & 2 deletions cpp/bench/fftw/bench-fft-multi.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "fftw-cpp/fftw-cpp.h"

#include "cilk.h"
#include "timing.h"
#include "cilk.hpp"
#include "timing.hpp"

#include <argparse/argparse.hpp>
#include <iostream>
Expand Down
4 changes: 2 additions & 2 deletions cpp/bench/fftw/bench-fft.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "fftw-cpp/fftw-cpp.h"

#include "cilk.h"
#include "timing.h"
#include "cilk.hpp"
#include "timing.hpp"

#include <argparse/argparse.hpp>
#include <iostream>
Expand Down
2 changes: 1 addition & 1 deletion cpp/bench/naive.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "Naive.h"
#include "Naive.hpp"

#include <benchmark/benchmark.h>
#include <iostream>
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion cpp/HermiteRunner.cpp → cpp/lib/HermiteRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// Created by Luka on 4/28/2023.
//

#include "HermiteRunner.h"
#include "HermiteRunner.hpp"

ahr::HermiteRunner::HermiteRunner(std::ostream &out) : out(out) {}
2 changes: 1 addition & 1 deletion cpp/HermiteRunner.h → cpp/lib/HermiteRunner.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "typedefs.h"
#include "typedefs.hpp"
#include <experimental/mdspan>
#include <experimental/mdarray>
#include <iostream>
Expand Down
4 changes: 2 additions & 2 deletions cpp/Naive.cpp → cpp/lib/Naive.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "Naive.h"
#include "equillibrium.h"
#include "Naive.hpp"
#include "equillibrium.hpp"

#include <cnpy.h>
#include <cstdlib>
Expand Down
6 changes: 3 additions & 3 deletions cpp/Naive.h → cpp/lib/Naive.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include "HermiteRunner.h"
#include "constants.h"
#include "nonlinears.h"
#include "HermiteRunner.hpp"
#include "constants.hpp"
#include "nonlinears.hpp"

#include <fftw-cpp/fftw-cpp.h>
#include <iomanip>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion cpp/constants.h → cpp/lib/constants.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "typedefs.h"
#include "typedefs.hpp"

namespace ahr {
using std::numbers::pi;
Expand Down
6 changes: 3 additions & 3 deletions cpp/driver.cpp → cpp/lib/driver.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "typedefs.h"
#include "typedefs.hpp"

#include "CliParams.hpp"
#include "HermiteRunner.h"
#include "Naive.h"
#include "HermiteRunner.hpp"
#include "Naive.hpp"
#include <iostream>

// TODO
Expand Down
4 changes: 2 additions & 2 deletions cpp/equillibrium.h → cpp/lib/equillibrium.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "constants.h"
#include "Naive.h"
#include "constants.hpp"
#include "Naive.hpp"
#include <experimental/mdarray>
#include <utility>

Expand Down
2 changes: 1 addition & 1 deletion cpp/nonlinears.h → cpp/lib/nonlinears.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "constants.h"
#include "constants.hpp"

namespace ahr {
[[nodiscard]] inline Real Gamma0(Real x) {
Expand Down
4 changes: 2 additions & 2 deletions cpp/lib/test-triangle.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "typedefs.h"
#include "typedefs.hpp"

#include "cilk.h"
#include "cilk.hpp"
#include <algorithm>
#include <argparse/argparse.hpp>
#include <cassert>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion cpp/test/NaiveTester.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once
#include "Naive.h"
#include "Naive.hpp"
#include "util.hpp"

#include <gtest/gtest.h>
Expand Down
2 changes: 1 addition & 1 deletion cpp/test/naive-energies.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "Naive.h"
#include "Naive.hpp"
#include "NaiveTester.hpp"
#include "util.hpp"
#include <gtest/gtest.h>
Expand Down
2 changes: 1 addition & 1 deletion cpp/test/naive-moments.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "Naive.h"
#include "Naive.hpp"
#include "NaiveTester.hpp"
#include "util.hpp"

Expand Down

0 comments on commit 8535f52

Please sign in to comment.