Skip to content

Commit

Permalink
Showing 6 changed files with 29 additions and 33 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -33,6 +33,7 @@
- PR #546 Remove CUDA driver linking and correct NVTX macro.
- PR #569 Correct `device_scalar::set_value` to pass host value by reference to avoid copying from invalid value
- PR #559 Fix `align_down` to only change unaligned values.
- PR #577 Fix CMake `LOGGING_LEVEL` issue which caused verbose logging / performance regression.


# RMM 0.15.0 (26 Aug 2020)
47 changes: 20 additions & 27 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -87,21 +87,6 @@ if(PER_THREAD_DEFAULT_STREAM)
add_compile_definitions(CUDA_API_PER_THREAD_DEFAULT_STREAM)
endif(PER_THREAD_DEFAULT_STREAM)

###################################################################################################
# add gtest

if(BUILD_TESTS)
include(CTest)
add_subdirectory(tests)
endif(BUILD_TESTS)

###################################################################################################
# add google benchmark

if(BUILD_BENCHMARKS)
add_subdirectory(benchmarks)
endif(BUILD_BENCHMARKS)

###################################################################################################
# library targets

@@ -129,20 +114,28 @@ endif(CUDA_STATIC_RUNTIME)
target_link_libraries(rmm INTERFACE spdlog::spdlog_header_only)

###################################################################################################
# Set a default logging level if none was specified
# Set logging level. Must go before including gtests and benchmarks.

set(DEFAULT_LOGGING_LEVEL "INFO")
set(RMM_LOGGING_LEVEL "INFO" CACHE STRING "Choose the logging level.")
# Set the possible values of build type for cmake-gui
set_property(CACHE RMM_LOGGING_LEVEL PROPERTY STRINGS
"TRACE" "DEBUG" "INFO" "WARN" "ERROR" "CRITICAL" "OFF")
message(STATUS "RMM_LOGGING_LEVEL = '${RMM_LOGGING_LEVEL}'.")

if(NOT LOGGING_LEVEL)
message(STATUS "Setting logging level to '${DEFAULT_LOGGING_LEVEL}' since none specified.")
set(LOGGING_LEVEL "${DEFAULT_LOGGING_LEVEL}" CACHE
STRING "Choose the logging level." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE LOGGING_LEVEL PROPERTY STRINGS
"TRACE" "DEBUG" "INFO" "WARN" "ERROR" "CRITICAL" "OFF")
else()
message(STATUS "Setting logging level to '${LOGGING_LEVEL}'")
endif(NOT LOGGING_LEVEL)
###################################################################################################
# add gtest

if(BUILD_TESTS)
include(CTest)
add_subdirectory(tests)
endif(BUILD_TESTS)

###################################################################################################
# add google benchmark

if(BUILD_BENCHMARKS)
add_subdirectory(benchmarks)
endif(BUILD_BENCHMARKS)

###################################################################################################
# install targets
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -407,15 +407,15 @@ information can show when errors occur, when additional memory is allocated from
etc. The default log file is `rmm_log.txt` in the current working directory, but the environment
variable `RMM_DEBUG_LOG_FILE` can be set to specify the path and file name.

There is a CMake configuration variable `LOGGING_LEVEL`, which can be set to enable compilation of
more detailed logging. The default is `INFO`. Available levels are `TRACE`, `DEBUG`, `INFO`, `WARN`,
`ERROR`, `CRITICAL`.
There is a CMake configuration variable `RMM_LOGGING_LEVEL`, which can be set to enable compilation
of more detailed logging. The default is `INFO`. Available levels are `TRACE`, `DEBUG`, `INFO`,
`WARN`, `ERROR`, `CRITICAL` and `OFF`.

The log relies on the [spdlog](https://github.com/gabime/spdlog.git) library.

Note that to see logging below the `INFO` level, the C++ application must also call
`rmm::logger().set_level()`, e.g. to enable all levels of logging down to `TRACE`, call
`rmm::logger().set_level(spdlog::level::trace)`.
`rmm::logger().set_level(spdlog::level::trace)` (and compile with `-DRMM_LOGGING_LEVEL=TRACE`).

Note that debug logging is different from the CSV memory allocation logging provided by
`rmm::mr::logging_resource_adapter`. The latter is for logging a history of allocation /
2 changes: 1 addition & 1 deletion benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ function(ConfigureBench CMAKE_BENCH_NAME CMAKE_BENCH_SRC)
RUNTIME_OUTPUT_DIRECTORY "${RMM_BINARY_DIR}/gbenchmarks")

target_compile_definitions(${CMAKE_BENCH_NAME} PUBLIC
SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_${LOGGING_LEVEL})
"SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_${RMM_LOGGING_LEVEL}")
endfunction(ConfigureBench)

###################################################################################################
2 changes: 2 additions & 0 deletions include/rmm/logger.hpp
Original file line number Diff line number Diff line change
@@ -58,12 +58,14 @@ struct logger_wrapper {
{
logger_.set_pattern("[%6t][%H:%M:%S:%f][%-6l] %v");
logger_.flush_on(spdlog::level::warn);
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_INFO
#ifdef CUDA_API_PER_THREAD_DEFAULT_STREAM
logger_.info("----- RMM LOG BEGIN [PTDS ENABLED] -----");
#else
logger_.info("----- RMM LOG BEGIN [PTDS DISABLED] -----");
#endif
logger_.flush();
#endif
}
};

2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ function(ConfigureTest CMAKE_TEST_NAME CMAKE_TEST_SRC)
RUNTIME_OUTPUT_DIRECTORY "${RMM_BINARY_DIR}/gtests")

target_compile_definitions(${CMAKE_TEST_NAME} PUBLIC
SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_${LOGGING_LEVEL})
"SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_${RMM_LOGGING_LEVEL}")

add_test(NAME ${CMAKE_TEST_NAME} COMMAND ${CMAKE_TEST_NAME})
endfunction(ConfigureTest)

0 comments on commit 6cc497a

Please sign in to comment.