Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,10 @@ jobs:
--exclude '.*tasks/.*/tests/.*' \
--exclude '.*modules/.*/tests/.*' \
--exclude '.*tasks/common/runners/.*' \
--exclude '.*modules/core/runners/.*' \
--exclude '.*modules/core/util/include/perf_test_util.hpp' \
--exclude '.*modules/core/util/include/func_test_util.hpp' \
--exclude '.*modules/core/util/src/func_test_util.cpp' \
--exclude '.*modules/runners/.*' \
--exclude '.*modules/util/include/perf_test_util.hpp' \
--exclude '.*modules/util/include/func_test_util.hpp' \
--exclude '.*modules/util/src/func_test_util.cpp' \
--xml --output ../coverage.xml \
--html=../cov-report/index.html --html-details
- name: Upload coverage reports to Codecov
Expand Down
8 changes: 4 additions & 4 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ ignore:
- "tasks/**/tests/**"
- "modules/**/tests/**"
- "tasks/common/runners/**"
- "modules/core/runners/**"
- "modules/core/util/include/perf_test_util.hpp"
- "modules/core/util/include/func_test_util.hpp"
- "modules/core/util/src/func_test_util.cpp"
- "modules/runners/**"
- "modules/util/include/perf_test_util.hpp"
- "modules/util/include/func_test_util.hpp"
- "modules/util/src/func_test_util.cpp"
coverage:
status:
project:
Expand Down
50 changes: 48 additions & 2 deletions modules/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,53 @@
message(STATUS "Modules")
message(STATUS "Core components")
set(exec_func_tests "core_func_tests")
set(exec_func_lib "core_module_lib")

subdirlist(subdirs ${CMAKE_CURRENT_SOURCE_DIR})

foreach(subd ${subdirs})
add_subdirectory(${subd})
get_filename_component(PROJECT_ID ${subd} NAME)
set(PATH_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/${subd}")
set(PROJECT_ID "${PROJECT_ID}")
message(STATUS "-- " ${PROJECT_ID})

file(GLOB_RECURSE TMP_LIB_SOURCE_FILES ${PATH_PREFIX}/include/*
${PATH_PREFIX}/src/*)
list(APPEND LIB_SOURCE_FILES ${TMP_LIB_SOURCE_FILES})

file(GLOB_RECURSE TMP_FUNC_TESTS_SOURCE_FILES ${PATH_PREFIX}/tests/*)
list(APPEND FUNC_TESTS_SOURCE_FILES ${TMP_FUNC_TESTS_SOURCE_FILES})
endforeach()

project(${exec_func_lib})
add_library(${exec_func_lib} STATIC ${LIB_SOURCE_FILES})
set_target_properties(${exec_func_lib} PROPERTIES LINKER_LANGUAGE CXX)

# Add include directories to target
target_include_directories(
${exec_func_lib} PUBLIC ${CMAKE_SOURCE_DIR}/3rdparty
${CMAKE_SOURCE_DIR}/modules ${CMAKE_SOURCE_DIR}/tasks)

ppc_link_envpp(${exec_func_lib})
ppc_link_json(${exec_func_lib})
ppc_link_gtest(${exec_func_lib})
ppc_link_threads(${exec_func_lib})
ppc_link_openmp(${exec_func_lib})
ppc_link_tbb(${exec_func_lib})
ppc_link_mpi(${exec_func_lib})
ppc_link_stb(${exec_func_lib})

add_executable(${exec_func_tests} ${FUNC_TESTS_SOURCE_FILES})

target_link_libraries(${exec_func_tests} PUBLIC ${exec_func_lib})

enable_testing()
add_test(NAME ${exec_func_tests} COMMAND ${exec_func_tests})

# Installation rules
install(
TARGETS ${exec_func_lib}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)

install(TARGETS ${exec_func_tests} RUNTIME DESTINATION bin)
55 changes: 0 additions & 55 deletions modules/core/CMakeLists.txt

This file was deleted.

43 changes: 0 additions & 43 deletions modules/core/performance/tests/test_task.hpp

This file was deleted.

43 changes: 0 additions & 43 deletions modules/core/task/tests/test_task.hpp

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@
#include <stdexcept>
#include <string>

#include "core/task/include/task.hpp"
#include "task/include/task.hpp"

namespace ppc::core {
namespace ppc::performance {

inline double DefaultTimer() { return -1.0; }

struct PerfAttr {
/// @brief Number of times the task is run for performance evaluation.
uint64_t num_running = 5;
/// @brief Timer function returning current time in seconds.
/// @cond
std::function<double()> current_timer = [&] { return -1.0; };
std::function<double()> current_timer = DefaultTimer;
/// @endcond
};

Expand All @@ -33,15 +35,15 @@ template <typename InType, typename OutType>
class Perf {
public:
// Init performance analysis with an initialized task and initialized data
explicit Perf(const TaskPtr<InType, OutType>& task_ptr) : task_(task_ptr) {
task_ptr->GetStateOfTesting() = StateOfTesting::kPerf;
explicit Perf(const ppc::task::TaskPtr<InType, OutType>& task_ptr) : task_(task_ptr) {
task_ptr->GetStateOfTesting() = ppc::task::StateOfTesting::kPerf;
}
// Check performance of full task's pipeline: PreProcessing() ->
// Validation() -> Run() -> PostProcessing()
void PipelineRun(const PerfAttr& perf_attr) {
perf_results_.type_of_running = PerfResults::TypeOfRunning::kPipeline;

CommonRun(perf_attr, [&]() {
CommonRun(perf_attr, [&] {
task_->Validation();
task_->PreProcessing();
task_->Run();
Expand All @@ -54,7 +56,7 @@ class Perf {

task_->Validation();
task_->PreProcessing();
CommonRun(perf_attr, [&]() { task_->Run(); }, perf_results_);
CommonRun(perf_attr, [&] { task_->Run(); }, perf_results_);
task_->PostProcessing();

task_->Validation();
Expand Down Expand Up @@ -92,11 +94,11 @@ class Perf {
}
/// @brief Retrieves the performance test results.
/// @return The latest PerfResults structure.
PerfResults GetPerfResults() { return perf_results_; }
[[nodiscard]] PerfResults GetPerfResults() const { return perf_results_; }

private:
PerfResults perf_results_;
std::shared_ptr<Task<InType, OutType>> task_;
std::shared_ptr<ppc::task::Task<InType, OutType>> task_;
static void CommonRun(const PerfAttr& perf_attr, const std::function<void()>& pipeline, PerfResults& perf_results) {
auto begin = perf_attr.current_timer();
for (uint64_t i = 0; i < perf_attr.num_running; i++) {
Expand All @@ -107,14 +109,14 @@ class Perf {
}
};

inline std::string GetStringParamName(ppc::core::PerfResults::TypeOfRunning type_of_running) {
if (type_of_running == core::PerfResults::kTaskRun) {
inline std::string GetStringParamName(PerfResults::TypeOfRunning type_of_running) {
if (type_of_running == PerfResults::kTaskRun) {
return "task_run";
}
if (type_of_running == core::PerfResults::kPipeline) {
if (type_of_running == PerfResults::kPipeline) {
return "pipeline";
}
return "none";
}

} // namespace ppc::core
} // namespace ppc::performance
Loading
Loading