Skip to content

Commit 0870aaf

Browse files
committed
Add libcoarse
Signed-off-by: Lukasz Dorau <[email protected]>
1 parent 0dd3648 commit 0870aaf

File tree

6 files changed

+1544
-5
lines changed

6 files changed

+1544
-5
lines changed

cmake/helpers.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,8 @@ function(add_umf_library)
391391
${ARG_NAME}
392392
PRIVATE ${UMF_CMAKE_SOURCE_DIR}/include
393393
${UMF_CMAKE_SOURCE_DIR}/src/utils
394-
${UMF_CMAKE_SOURCE_DIR}/src/base_alloc)
394+
${UMF_CMAKE_SOURCE_DIR}/src/base_alloc
395+
${UMF_CMAKE_SOURCE_DIR}/src/coarse)
395396
add_umf_target_compile_options(${ARG_NAME})
396397
add_umf_target_link_options(${ARG_NAME})
397398
endfunction()

src/CMakeLists.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@ set(UMF_CUDA_INCLUDE_DIR
1616
# TODO: Cleanup the compile definitions across all the CMake files
1717
set(UMF_COMMON_COMPILE_DEFINITIONS UMF_VERSION=${UMF_VERSION})
1818

19-
add_subdirectory(utils)
20-
21-
set(UMF_LIBS $<BUILD_INTERFACE:umf_utils>)
22-
2319
set(BA_SOURCES
2420
${CMAKE_CURRENT_SOURCE_DIR}/base_alloc/base_alloc.c
2521
${CMAKE_CURRENT_SOURCE_DIR}/base_alloc/base_alloc_linear.c
2622
${CMAKE_CURRENT_SOURCE_DIR}/base_alloc/base_alloc_global.c)
2723

24+
add_subdirectory(utils)
25+
add_subdirectory(coarse)
26+
27+
set(UMF_LIBS $<BUILD_INTERFACE:umf_utils> $<BUILD_INTERFACE:coarse>)
28+
2829
if(LINUX)
2930
set(BA_SOURCES ${BA_SOURCES}
3031
${CMAKE_CURRENT_SOURCE_DIR}/base_alloc/base_alloc_linux.c)
@@ -145,6 +146,8 @@ else()
145146
LIBS ${UMF_LIBS})
146147
endif()
147148

149+
add_dependencies(umf coarse)
150+
148151
if(UMF_LINK_HWLOC_STATICALLY)
149152
add_dependencies(umf ${UMF_HWLOC_NAME})
150153
endif()

src/coarse/CMakeLists.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright (C) 2024 Intel Corporation
2+
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
3+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4+
5+
include(${UMF_CMAKE_SOURCE_DIR}/cmake/helpers.cmake)
6+
7+
set(COARSE_SOURCES coarse.c ../ravl/ravl.c ${BA_SOURCES})
8+
9+
add_umf_library(
10+
NAME coarse
11+
TYPE STATIC
12+
SRCS ${COARSE_SOURCES}
13+
LIBS ${UMF_LIBS})
14+
15+
target_include_directories(
16+
coarse
17+
PRIVATE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
18+
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>
19+
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/ravl>)
20+
21+
add_library(${PROJECT_NAME}::coarse ALIAS coarse)
22+
23+
install(TARGETS coarse EXPORT ${PROJECT_NAME}-targets)

0 commit comments

Comments
 (0)