Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
network + kokkos-connector + CUDA standard (#204)
Browse files Browse the repository at this point in the history
- Disable building network component lib on non-linux systems
- Work-around for building kp_timemory_gpu_roofline when CUDA standard differs from C++ standard
- Removed ROOFLINE_MODE_CPU "mp" option
  • Loading branch information
jrmadsen authored Jun 25, 2021
1 parent 87dd062 commit ac107eb
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 18 deletions.
11 changes: 6 additions & 5 deletions cmake/Modules/Options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,14 @@ if(${PROJECT_NAME}_MAIN_PROJECT OR TIMEMORY_LANGUAGE_STANDARDS)
endif()

if(${PROJECT_NAME}_MAIN_PROJECT OR TIMEMORY_LANGUAGE_STANDARDS)
# standard
# standard
set(CMAKE_C_STANDARD 11 CACHE STRING "C language standard")
set(CMAKE_CXX_STANDARD 14 CACHE STRING "CXX language standard")
set(CMAKE_CUDA_STANDARD 14 CACHE STRING "CUDA language standard")
if(CMAKE_VERSION VERSION_LESS 3.18.0)
set(CMAKE_CUDA_STANDARD 14 CACHE STRING "CUDA language standard")
else()
set(CMAKE_CUDA_STANDARD ${CMAKE_CXX_STANDARD} CACHE STRING "CUDA language standard")
endif()

# standard required
add_option(CMAKE_C_STANDARD_REQUIRED "Require C language standard" ON)
Expand Down Expand Up @@ -251,9 +255,6 @@ else()
endif()
endif()

# set it to the same because of string_view
# set(CMAKE_CUDA_STANDARD ${CMAKE_CXX_STANDARD})

add_option(CMAKE_INSTALL_RPATH_USE_LINK_PATH "Embed RPATH using link path" ON)


Expand Down
4 changes: 4 additions & 0 deletions source/timemory/components/network/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

if(NOT UNIX OR APPLE)
return()
endif()

set(NAME network)

file(GLOB_RECURSE header_files ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp)
Expand Down
6 changes: 3 additions & 3 deletions source/timemory/settings/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -930,9 +930,9 @@ settings::initialize_roofline()
TIMEMORY_SETTINGS_MEMBER_ARG_IMPL(
string_t, cpu_roofline_mode, TIMEMORY_SETTINGS_KEY("ROOFLINE_MODE_CPU"),
"Configure the roofline collection mode for CPU specifically. Options: 'op', "
"'ai', 'mp'",
"mp", strvector_t({ "--timemory-cpu-roofline-mode" }), 1, 1,
strvector_t({ "op", "ai", "mp" }));
"'ai'",
"op", strvector_t({ "--timemory-cpu-roofline-mode" }), 1, 1,
strvector_t({ "op", "ai" }));

TIMEMORY_SETTINGS_MEMBER_ARG_IMPL(
string_t, gpu_roofline_mode, TIMEMORY_SETTINGS_KEY("ROOFLINE_MODE_GPU"),
Expand Down
25 changes: 15 additions & 10 deletions source/tools/kokkos-connector/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,10 @@ set(TIMEMORY_BUILD_KOKKOS_CONNECTORS "all" CACHE STRING "List of connector confi
#
# Options
#
add_option(TIMEMORY_KOKKOS_BUILD_SAMPLE "Build sample test" OFF NO_FEATURE)
add_option(TIMEMORY_BUILD_KOKKOS_SAMPLE "Build sample test" OFF NO_FEATURE)
add_option(TIMEMORY_BUILD_KOKKOS_CUDA_CONNECTORS "Compile GPU connectors as CUDA if necessary" ON NO_FEATURE)
add_option(TIMEMORY_BUILD_KOKKOS_CONFIG "Build various connector configurations" OFF)
add_feature(TIMEMORY_BUILD_KOKKOS_CONNECTORS "List of connector configurations to build" DOC)
if(DEFINED TIMEMORY_KOKKOS_BUILD_CONFIG)
set(TIMEMORY_BUILD_KOKKOS_CONFIG ${TIMEMORY_KOKKOS_BUILD_CONFIG})
endif()
if(DEFINED TIMEMORY_KOKKOS_BUILD_CONNECTORS)
set(TIMEMORY_BUILD_KOKKOS_CONNECTORS ${TIMEMORY_KOKKOS_BUILD_CONNECTORS})
endif()
string(TOUPPER "${TIMEMORY_BUILD_KOKKOS_CONNECTORS}" _CONNECTORS)

message(STATUS "")
Expand Down Expand Up @@ -147,7 +142,7 @@ configure_library(kp_timemory_filter)
# Generate a test using kokkos
#
function(ADD_KOKKOS_SAMPLE_TEST _NAME _TARG)
if(NOT TIMEMORY_KOKKOS_BUILD_SAMPLE)
if(NOT TIMEMORY_BUILD_KOKKOS_SAMPLE)
return()
endif()

Expand Down Expand Up @@ -175,7 +170,7 @@ endfunction()
#
# Build the sample (test executable)
#
if(TIMEMORY_KOKKOS_BUILD_SAMPLE)
if(TIMEMORY_BUILD_KOKKOS_SAMPLE)
# use launch_compiler feature to ensure kokkos uses it's original compiler
find_package(Kokkos REQUIRED)
add_executable(kokkos-connector-sample ${TIMEMORY_EXCLUDE_FROM_ALL} sample/sample.cpp)
Expand Down Expand Up @@ -246,7 +241,17 @@ function(ADD_CONNECTOR_CONFIG _NAME)
# configure the extension
set(_EXT cpp)
if(CONNECTOR_GPU AND CUDA_AVAILABLE)
set(_EXT cu)
if("${CMAKE_CXX_STANDARD}" GREATER "${CMAKE_CUDA_STANDARD}")
if(TIMEMORY_BUILD_KOKKOS_CUDA_CONNECTORS)
set(_MSG "${_NAME} requested CUDA compilation but CMAKE_CXX_STANDARD (${CMAKE_CXX_STANDARD}) > CMAKE_CUDA_STANDARD (${CMAKE_CUDA_STANDARD})")
set(_MSG "${_MSG}. Compiling as C++... Set TIMEMORY_BUILD_KOKKOS_CUDA_CONNECTORS=OFF to skip compiling ${_NAME}")
timemory_message(WARNING "${_MSG}")
else()
return()
endif()
else()
set(_EXT cu)
endif()
endif()

# configure the components
Expand Down

0 comments on commit ac107eb

Please sign in to comment.