Skip to content

Commit 6987891

Browse files
authored
Merge pull request oneapi-src#931 from ldorau/Add_the_coarse_library
Add the coarse library
2 parents c70a02b + 958b690 commit 6987891

File tree

7 files changed

+2823
-5
lines changed

7 files changed

+2823
-5
lines changed

cmake/helpers.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,8 @@ function(add_umf_library)
387387
${ARG_NAME}
388388
PRIVATE ${UMF_CMAKE_SOURCE_DIR}/include
389389
${UMF_CMAKE_SOURCE_DIR}/src/utils
390-
${UMF_CMAKE_SOURCE_DIR}/src/base_alloc)
390+
${UMF_CMAKE_SOURCE_DIR}/src/base_alloc
391+
${UMF_CMAKE_SOURCE_DIR}/src/coarse)
391392
add_umf_target_compile_options(${ARG_NAME})
392393
add_umf_target_link_options(${ARG_NAME})
393394
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: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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)
8+
9+
if(UMF_BUILD_SHARED_LIBRARY)
10+
set(COARSE_EXTRA_SRCS ${BA_SOURCES})
11+
set(COARSE_EXTRA_LIBS $<BUILD_INTERFACE:umf_utils>)
12+
endif()
13+
14+
add_umf_library(
15+
NAME coarse
16+
TYPE STATIC
17+
SRCS ${COARSE_SOURCES} ${COARSE_EXTRA_SRCS}
18+
LIBS ${COARSE_EXTRA_LIBS})
19+
20+
target_include_directories(
21+
coarse
22+
PRIVATE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
23+
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>
24+
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/ravl>)
25+
26+
add_library(${PROJECT_NAME}::coarse ALIAS coarse)

0 commit comments

Comments
 (0)