Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: cleanup outdated code #2349

Merged
merged 6 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,6 @@ enable_clang_tidy(
"\.hpp$"
EXTRA_ARGS
-DMIOPEN_USE_CLANG_TIDY

)
include(CppCheck)
enable_cppcheck(
Expand Down Expand Up @@ -788,5 +787,5 @@ add_subdirectory(test)
add_subdirectory(speedtests)
add_subdirectory(utils)
if(MIOPEN_ENABLE_FIN)
add_subdirectory(fin)
add_subdirectory(fin)
endif()
2 changes: 1 addition & 1 deletion speedtests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function(add_speedtest_executable TEST_NAME)
separate_arguments(MIOPEN_TEST_FLAGS_ARGS UNIX_COMMAND ${MIOPEN_TEST_FLAGS})
target_link_libraries(${TEST_NAME} MIOpen)
target_include_directories(${TEST_NAME} PRIVATE ../test)
endfunction(add_speedtest_executable)
endfunction()

foreach(TEST ${TESTS})
get_filename_component(BASE_NAME ${TEST} NAME_WE)
Expand Down
22 changes: 3 additions & 19 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ configure_file("${PROJECT_SOURCE_DIR}/include/miopen/config.h.in" "${PROJECT_BIN
# configure a header file to pass the CMake version settings to the source, and package the header files in the output archive
configure_file( "${PROJECT_SOURCE_DIR}/include/miopen/version.h.in" "${PROJECT_BINARY_DIR}/include/miopen/version.h" )


if(BUILD_FILE_REORG_BACKWARD_COMPATIBILITY)
#Copy header to Build Dir for generating backward compatibility
configure_file( "${PROJECT_SOURCE_DIR}/include/miopen/miopen.h" "${PROJECT_BINARY_DIR}/include/miopen/miopen.h" )
Expand All @@ -60,16 +59,11 @@ message( STATUS "CMAKE_BUILD_TYPE= ${CMAKE_BUILD_TYPE}" )
# This is incremented when the ABI to the library changes
set( MIOpen_SOVERSION 1.0 )


function(add_kernels FILE_NAME VAR_PREFIX VAR_SUFFIX KERNEL_FILES)
set(INIT_KERNELS_LIST)
set(KERNELS_DECLS)
foreach(KERNEL_FILE ${KERNEL_FILES})
if("${CMAKE_VERSION}" VERSION_LESS 3.0)
configure_file(${KERNEL_FILE} ${KERNEL_FILE}.delete)
else()
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${KERNEL_FILE})
endif()
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${KERNEL_FILE})
get_filename_component(KERNEL_FILENAME ${KERNEL_FILE} NAME)
get_filename_component(BASE_NAME ${KERNEL_FILE} NAME_WE)
string(TOUPPER "${BASE_NAME}" KEY_NAME)
Expand Down Expand Up @@ -667,23 +661,13 @@ clang_tidy_check(MIOpen)

function(target_internal_library TARGET)
target_link_libraries(${TARGET} PRIVATE ${ARGN})
set(PASS_ARGS debug optimized)
set(DEPS)
foreach(DEP ${ARGN})
if(DEP IN_LIST PASS_ARGS)
list(APPEND DEPS ${DEP})
else()
list(APPEND DEPS $<BUILD_INTERFACE:${DEP}>)
endif()
endforeach()
target_link_libraries(${TARGET} INTERFACE ${DEPS})
Comment on lines -695 to -704
Copy link
Contributor

@atamazov atamazov Sep 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pfultz2 Do we no longer need this patch for "debug" and "optimized"? I am not quite confident with this stuff.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping @pfultz2 and @JehandadKhan for review

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it isnt used anymore. I think this was used before we could use boost cmake targets.

target_link_libraries(${TARGET} INTERFACE $<BUILD_INTERFACE:${ARGN}>)
endfunction()

target_include_directories(MIOpen PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/include>
)

set(MIOPEN_CK_LINK_FLAGS)
if(MIOPEN_USE_COMPOSABLEKERNEL)
set(MIOPEN_CK_LINK_FLAGS composable_kernel::device_operations hip::host)
endif()
Expand Down Expand Up @@ -824,7 +808,7 @@ endif()
if(NOT WIN32 AND NOT APPLE)
find_library(LIBRT rt)
if(LIBRT)
MESSAGE(STATUS "Librt: " ${LIBRT})
message(STATUS "Librt: " ${LIBRT})
target_internal_library(MIOpen ${LIBRT})
endif()
endif()
Expand Down
1 change: 0 additions & 1 deletion src/composable_kernel/host/host_tensor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ target_include_directories(host_tensor SYSTEM PUBLIC $<BUILD_INTERFACE:${HALF_IN
target_link_libraries(host_tensor PRIVATE hip::device)
target_link_libraries(host_tensor INTERFACE hip::host)

target_compile_features(host_tensor PUBLIC)
set_target_properties(host_tensor PROPERTIES POSITION_INDEPENDENT_CODE ON)

install(TARGETS host_tensor LIBRARY DESTINATION lib)
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ function(add_test_executable TEST_NAME)
else()
target_link_libraries(${TEST_NAME} MIOpen)
endif()
endfunction(add_test_executable)
endfunction()

set(MIOPEN_TEST_SANITIZERS)
foreach(SANTIZER address thread)
Expand Down