Skip to content

Commit 94d8d53

Browse files
committed
Move examples to their own subdirectories
Ref: #427 Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
1 parent 26fe3ee commit 94d8d53

File tree

11 files changed

+19
-23
lines changed

11 files changed

+19
-23
lines changed

CMakeLists.txt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -521,16 +521,7 @@ endif()
521521
install(FILES ${CMAKE_SOURCE_DIR}/LICENSE.TXT
522522
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}/")
523523

524-
install(
525-
FILES examples/basic/gpu_shared_memory.c
526-
examples/basic/utils_level_zero.h
527-
examples/basic/basic.c
528-
examples/basic/ipc_level_zero.c
529-
examples/basic/ipc_ipcapi_anon_fd.sh
530-
examples/basic/ipc_ipcapi_consumer.c
531-
examples/basic/ipc_ipcapi_producer.c
532-
examples/basic/ipc_ipcapi_shm.sh
533-
DESTINATION "${CMAKE_INSTALL_DOCDIR}/examples")
524+
install(DIRECTORY examples DESTINATION "${CMAKE_INSTALL_DOCDIR}")
534525

535526
# Add the include directory and the headers target to the install.
536527
install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/"

benchmark/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function(add_umf_benchmark)
4646
PRIVATE ${UMF_CMAKE_SOURCE_DIR}/include
4747
${UMF_CMAKE_SOURCE_DIR}/src/utils
4848
${UMF_CMAKE_SOURCE_DIR}/test/common
49-
${UMF_CMAKE_SOURCE_DIR}/examples/basic)
49+
${UMF_CMAKE_SOURCE_DIR}/examples/common)
5050

5151
target_link_directories(${BENCH_NAME} PRIVATE ${ARG_LIBDIRS})
5252

examples/CMakeLists.txt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,14 @@ if(UMF_BUILD_GPU_EXAMPLES
4848

4949
add_umf_executable(
5050
NAME ${EXAMPLE_NAME}
51-
SRCS basic/gpu_shared_memory.c
51+
SRCS gpu_shared_memory/gpu_shared_memory.c
5252
LIBS disjoint_pool ze_loader umf)
5353

5454
target_include_directories(
55-
${EXAMPLE_NAME} PRIVATE ${UMF_CMAKE_SOURCE_DIR}/src/utils
56-
${UMF_CMAKE_SOURCE_DIR}/include)
55+
${EXAMPLE_NAME}
56+
PRIVATE ${UMF_CMAKE_SOURCE_DIR}/src/utils
57+
${UMF_CMAKE_SOURCE_DIR}/include
58+
${UMF_CMAKE_SOURCE_DIR}/examples/common)
5759

5860
target_link_directories(${EXAMPLE_NAME} PRIVATE ${LIBHWLOC_LIBRARY_DIRS})
5961

@@ -87,13 +89,14 @@ if(UMF_BUILD_GPU_EXAMPLES
8789

8890
add_umf_executable(
8991
NAME ${EXAMPLE_NAME}
90-
SRCS basic/ipc_level_zero.c
92+
SRCS ipc_level_zero/ipc_level_zero.c
9193
LIBS disjoint_pool ze_loader umf)
9294

9395
target_include_directories(
9496
${EXAMPLE_NAME}
9597
PRIVATE ${LEVEL_ZERO_INCLUDE_DIRS} ${UMF_CMAKE_SOURCE_DIR}/src/utils
96-
${UMF_CMAKE_SOURCE_DIR}/include)
98+
${UMF_CMAKE_SOURCE_DIR}/include
99+
${UMF_CMAKE_SOURCE_DIR}/examples/common)
97100

98101
target_link_directories(${EXAMPLE_NAME} PRIVATE ${LIBHWLOC_LIBRARY_DIRS})
99102

@@ -124,7 +127,7 @@ function(build_umf_ipc_example name)
124127
set(EX_NAME ${EXAMPLE_NAME}_${loop_var})
125128
add_umf_executable(
126129
NAME ${EX_NAME}
127-
SRCS basic/${BASE_NAME}_${loop_var}.c
130+
SRCS ipc_ipcapi/${BASE_NAME}_${loop_var}.c
128131
LIBS umf)
129132

130133
target_include_directories(
@@ -138,7 +141,7 @@ endfunction()
138141
function(add_umf_ipc_example script)
139142
set(EXAMPLE_NAME umf_example_${script})
140143

141-
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/basic/${script}.sh
144+
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/ipc_ipcapi/${script}.sh
142145
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
143146

144147
add_test(

0 commit comments

Comments
 (0)