Skip to content

Commit b5e5014

Browse files
committed
Fix tests
Signed-off-by: cyy <[email protected]>
1 parent 065772f commit b5e5014

File tree

2 files changed

+3
-23
lines changed

2 files changed

+3
-23
lines changed

libkineto/CMakeLists.txt

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,7 @@ set(KINETO_COMPILE_OPTIONS "-DKINETO_NAMESPACE=libkineto")
122122
list(APPEND KINETO_COMPILE_OPTIONS "-DFMT_HEADER_ONLY")
123123
list(APPEND KINETO_COMPILE_OPTIONS "-DENABLE_IPC_FABRIC")
124124
list(APPEND KINETO_COMPILE_OPTIONS)
125-
if(NOT MSVC)
126-
list(APPEND KINETO_COMPILE_OPTIONS "-std=c++17")
127-
else()
128-
list(APPEND KINETO_COMPILE_OPTIONS "/std:c++17")
125+
if(MSVC)
129126
list(APPEND KINETO_COMPILE_OPTIONS "-DWIN32_LEAN_AND_MEAN")
130127
list(APPEND KINETO_COMPILE_OPTIONS "-DNOGDI")
131128
endif()
@@ -147,24 +144,6 @@ endif()
147144
target_compile_options(kineto_base PRIVATE "${KINETO_COMPILE_OPTIONS}")
148145
target_compile_options(kineto_api PRIVATE "${KINETO_COMPILE_OPTIONS}")
149146

150-
if(NOT TARGET fmt)
151-
if(NOT FMT_SOURCE_DIR)
152-
set(FMT_SOURCE_DIR "${LIBKINETO_THIRDPARTY_DIR}/fmt"
153-
CACHE STRING "fmt source directory from submodules")
154-
endif()
155-
156-
# Build FMT.
157-
# FMT and some other libraries use BUILD_SHARED_LIBS to control
158-
# the library type.
159-
# Save and restore the value after configuring FMT
160-
set(TEMP_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
161-
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE)
162-
set(FMT_LIBRARY_TYPE static CACHE STRING "Set lib type to static")
163-
add_subdirectory("${FMT_SOURCE_DIR}" "${LIBKINETO_BINARY_DIR}/fmt")
164-
set_property(TARGET fmt PROPERTY POSITION_INDEPENDENT_CODE ON)
165-
set(BUILD_SHARED_LIBS ${TEMP_BUILD_SHARED_LIBS} CACHE BOOL "Build shared libs" FORCE)
166-
endif()
167-
168147
set(FMT_INCLUDE_DIR "${FMT_SOURCE_DIR}/include")
169148
message(STATUS "Kineto: FMT_SOURCE_DIR = ${FMT_SOURCE_DIR}")
170149
message(STATUS "Kineto: FMT_INCLUDE_DIR = ${FMT_INCLUDE_DIR}")
@@ -231,6 +210,7 @@ else()
231210
message(FATAL_ERROR "Unsupported library type ${KINETO_LIBRARY_TYPE}")
232211
endif()
233212
target_link_libraries(kineto kineto_base kineto_api)
213+
target_link_libraries(kineto $<BUILD_INTERFACE:fmt::fmt-header-only>)
234214

235215
if(NOT LIBKINETO_NOROCTRACER)
236216
find_library(ROCTRACER_LIBRARY NAMES libroctracer64.so HINTS

libkineto/test/CuptiProfilerApiTest.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333

3434
using namespace KINETO_NAMESPACE;
3535

36-
static int numRanges = 1;
3736

3837
using Type = double;
3938

@@ -219,6 +218,7 @@ bool runTestWithUserRange(
219218
bool async = false) {
220219
// create a CUPTI range based profiling profiler
221220
// this configures the counter data as well
221+
constexpr int numRanges = 1;
222222
CuptiRangeProfilerOptions opts{
223223
.metricNames = metricNames,
224224
.deviceId = deviceNum,

0 commit comments

Comments
 (0)