Skip to content

Commit 7d671e0

Browse files
committed
update dir
1 parent a0a5ef0 commit 7d671e0

56 files changed

Lines changed: 21 additions & 1467 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,10 @@ include(cmake/gtest.cmake)
4343
message( STATUS "PPC step: Setup headers" )
4444
include_directories(3rdparty)
4545
include_directories(modules)
46-
#include_directories(tasks)
47-
include_directories(tasks-1)
46+
include_directories(tasks)
4847

4948
############################## Modules ##############################
5049

5150
message( STATUS "PPC step: Setup modules" )
5251
add_subdirectory(modules)
53-
#add_subdirectory(tasks)
54-
add_subdirectory(tasks-1)
52+
add_subdirectory(tasks)

tasks-1/CMakeLists.txt

Lines changed: 0 additions & 26 deletions
This file was deleted.

tasks/CMakeLists.txt

Lines changed: 19 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,113 +1,26 @@
11
message(STATUS "Student's tasks")
22

3-
list(APPEND LIST_OF_TASKS "mpi")
4-
list(APPEND LIST_OF_TASKS "omp")
5-
list(APPEND LIST_OF_TASKS "seq")
6-
list(APPEND LIST_OF_TASKS "stl")
7-
list(APPEND LIST_OF_TASKS "tbb")
8-
list(APPEND LIST_OF_TASKS "all")
9-
10-
add_compile_definitions(PATH_TO_PPC_PROJECT="${CMAKE_SOURCE_DIR}")
11-
12-
add_library(stb_image INTERFACE)
13-
14-
foreach(TASK_TYPE ${LIST_OF_TASKS})
15-
set(PATH_TO_TASK "${CMAKE_CURRENT_SOURCE_DIR}/${TASK_TYPE}")
16-
get_filename_component(MODULE_NAME ${PATH_TO_TASK} NAME)
17-
message(STATUS "${MODULE_NAME} tasks")
18-
set(exec_func_tests "${MODULE_NAME}_func_tests")
19-
set(exec_perf_tests "${MODULE_NAME}_perf_tests")
20-
set(exec_func_lib "${MODULE_NAME}_module_lib")
21-
set(project_suffix "_${MODULE_NAME}")
22-
23-
SUBDIRLIST(subdirs ${PATH_TO_TASK})
24-
foreach(subd ${subdirs})
25-
if ("${subd}" MATCHES "_disabled$")
26-
get_filename_component(DIR_NAME ${PATH_TO_TASK} NAME)
27-
list(APPEND LIST_OF_REVERTS "${DIR_NAME}_${subd}")
28-
continue()
29-
endif()
30-
get_filename_component(PROJECT_ID ${subd} NAME)
31-
set(PATH_PREFIX "${PATH_TO_TASK}/${subd}")
32-
message(STATUS "-- ${PROJECT_ID}${project_suffix}")
33-
34-
file(GLOB_RECURSE TMP_LIB_SOURCE_FILES "${PATH_PREFIX}/include/*" "${PATH_PREFIX}/src/*")
35-
list(APPEND LIB_SOURCE_FILES ${TMP_LIB_SOURCE_FILES})
36-
37-
file(GLOB SRC_RES "${PATH_PREFIX}/src/*")
38-
list(APPEND SRC_RES ${TMP_SRC_RES})
39-
40-
file(GLOB_RECURSE TMP_FUNC_TESTS_SOURCE_FILES "${PATH_PREFIX}/func_tests/*")
41-
list(APPEND FUNC_TESTS_SOURCE_FILES ${TMP_FUNC_TESTS_SOURCE_FILES})
42-
43-
file(GLOB_RECURSE TMP_PERF_TESTS_SOURCE_FILES "${PATH_PREFIX}/perf_tests/*")
44-
list(APPEND PERF_TESTS_SOURCE_FILES ${TMP_PERF_TESTS_SOURCE_FILES})
45-
endforeach()
46-
47-
project(${exec_func_lib})
48-
list(LENGTH SRC_RES RES_LEN)
49-
if(RES_LEN EQUAL 0)
50-
add_library(${exec_func_lib} INTERFACE ${LIB_SOURCE_FILES})
51-
else()
52-
add_library(${exec_func_lib} STATIC ${LIB_SOURCE_FILES})
53-
endif()
54-
set_target_properties(${exec_func_lib} PROPERTIES LINKER_LANGUAGE CXX)
55-
56-
if (USE_FUNC_TESTS)
57-
add_executable(${exec_func_tests} ${FUNC_TESTS_SOURCE_FILES} "${PATH_TO_TASK}/runner.cpp")
58-
list(APPEND LIST_OF_EXEC_TESTS ${exec_func_tests})
59-
endif (USE_FUNC_TESTS)
60-
if (USE_PERF_TESTS)
61-
add_executable(${exec_perf_tests} ${PERF_TESTS_SOURCE_FILES} "${PATH_TO_TASK}/runner.cpp")
62-
list(APPEND LIST_OF_EXEC_TESTS ${exec_perf_tests})
63-
endif (USE_PERF_TESTS)
64-
65-
foreach (EXEC_FUNC ${LIST_OF_EXEC_TESTS})
66-
target_link_libraries(${EXEC_FUNC} PUBLIC ${exec_func_lib} core_module_lib)
67-
target_link_libraries(${EXEC_FUNC} PUBLIC Threads::Threads)
68-
target_link_libraries(${EXEC_FUNC} PUBLIC ${OpenMP_libomp_LIBRARY})
69-
if( MPI_COMPILE_FLAGS )
70-
set_target_properties(${EXEC_FUNC} PROPERTIES COMPILE_FLAGS "${MPI_COMPILE_FLAGS}")
71-
endif( MPI_COMPILE_FLAGS )
72-
73-
if( MPI_LINK_FLAGS )
74-
set_target_properties(${EXEC_FUNC} PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
75-
endif( MPI_LINK_FLAGS )
76-
target_link_libraries(${EXEC_FUNC} PUBLIC ${MPI_LIBRARIES})
77-
78-
add_dependencies(${EXEC_FUNC} ppc_onetbb)
79-
target_link_directories(${EXEC_FUNC} PUBLIC ${CMAKE_BINARY_DIR}/ppc_onetbb/install/lib)
80-
if(NOT MSVC)
81-
target_link_libraries(${EXEC_FUNC} PUBLIC tbb)
82-
endif()
83-
84-
target_link_directories(stb_image INTERFACE ${CMAKE_SOURCE_DIR}/3rdparty/stb)
85-
target_link_libraries(${EXEC_FUNC} PUBLIC stb_image)
86-
87-
add_dependencies(${EXEC_FUNC} ppc_googletest)
88-
target_link_directories(${EXEC_FUNC} PUBLIC "${CMAKE_BINARY_DIR}/ppc_googletest/install/lib")
89-
target_link_libraries(${EXEC_FUNC} PUBLIC gtest gtest_main)
90-
enable_testing()
91-
add_test(NAME ${EXEC_FUNC} COMMAND ${EXEC_FUNC})
92-
93-
# Install the executable
94-
install(TARGETS ${EXEC_FUNC} RUNTIME DESTINATION bin)
3+
set(list_of_reverts "")
4+
5+
SUBDIRLIST(subdirs ${CMAKE_CURRENT_LIST_DIR})
6+
foreach(subd ${subdirs})
7+
add_subdirectory(${subd})
8+
foreach (dir_type "all" "mpi" "omp" "seq" "stl" "tbb")
9+
set(base_dir "${CMAKE_CURRENT_SOURCE_DIR}/${subd}/${dir_type}_disabled")
10+
if (NOT EXISTS "${base_dir}")
11+
continue()
12+
else ()
13+
list(APPEND list_of_reverts "${subd}_${dir_type}")
14+
endif ()
9515
endforeach ()
96-
97-
# Install the library
98-
install(TARGETS ${exec_func_lib} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)
99-
100-
set(LIST_OF_EXEC_TESTS "")
101-
set(LIB_SOURCE_FILES "")
102-
set(SRC_RES "")
103-
set(FUNC_TESTS_SOURCE_FILES "")
104-
set(PERF_TESTS_SOURCE_FILES "")
10516
endforeach()
10617

107-
set(OUTPUT_FILE "${CMAKE_BINARY_DIR}/revert-list.txt")
108-
file(WRITE ${OUTPUT_FILE} "${CONTENT}")
109-
message(STATUS "revert list")
110-
foreach (dir_name ${LIST_OF_REVERTS})
18+
set(output_file "${CMAKE_BINARY_DIR}/revert-list.txt")
19+
file(WRITE ${output_file} "${CONTENT}")
20+
message(STATUS "Revert list")
21+
foreach (dir_name ${list_of_reverts})
11122
message(STATUS "-- ${dir_name}")
112-
file(APPEND ${OUTPUT_FILE} "${dir_name}\n")
23+
file(APPEND ${output_file} "${dir_name}\n")
11324
endforeach()
25+
26+
add_compile_definitions(PATH_TO_PPC_PROJECT="${CMAKE_SOURCE_DIR}")

tasks/all/example/data/pic_all.jpg

-15 KB
Binary file not shown.

tasks/all/example/func_tests/main.cpp

Lines changed: 0 additions & 75 deletions
This file was deleted.

tasks/all/example/include/ops_all.hpp

Lines changed: 0 additions & 27 deletions
This file was deleted.

tasks/all/example/perf_tests/main.cpp

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)