Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7edb162
upgrade for protobuf v30 on Windows
apwojcik May 4, 2026
3cba518
update licenses
apwojcik May 4, 2026
76b408e
Merge branch 'develop' into protobuf-v30
causten May 6, 2026
7b72158
Merge branch 'develop' into protobuf-v30
apwojcik May 7, 2026
c063a85
upgrade to use clang-cl
apwojcik May 7, 2026
374d2f2
update licenses
apwojcik May 7, 2026
3bf5a82
Merge branch 'develop' into protobuf-v30
apwojcik May 7, 2026
9d035ca
add missing PRIVATE
apwojcik May 7, 2026
872bc70
add missing setup functions
apwojcik May 7, 2026
1fb8cea
incorporate review feedback
apwojcik May 11, 2026
6de38aa
Merge branch 'develop' into protobuf-v30
apwojcik May 11, 2026
7bb41fe
Revert "update licenses"
apwojcik May 11, 2026
b913f89
Revert "add missing setup functions"
apwojcik May 11, 2026
4915986
revert changes
apwojcik May 11, 2026
57e39cc
revert more changes
apwojcik May 11, 2026
27b9335
revert even more changes
apwojcik May 11, 2026
c676017
the last revert of changes
apwojcik May 11, 2026
bd5129c
update licenses
apwojcik May 11, 2026
a252dfc
Merge branch 'develop' into protobuf-v30
apwojcik May 11, 2026
9863ffc
Merge branch 'develop' into protobuf-v30
apwojcik May 11, 2026
80a8abc
incorporate review feedback
apwojcik May 11, 2026
d58875f
revert update licenses
apwojcik May 11, 2026
150dc52
Merge branch 'develop' into protobuf-v30
apwojcik May 12, 2026
63f7267
change to MIGRAPHX_MSVC_STATIC_RUNTIME
apwojcik May 12, 2026
20e5a2b
Update CMakeLists.txt
apwojcik May 13, 2026
32ffe71
Merge branch 'develop' into protobuf-v30
apwojcik May 13, 2026
6ba9a91
Merge branch 'develop' into protobuf-v30
apwojcik May 14, 2026
2fc9406
incorporate review feedback
apwojcik May 14, 2026
59ed1a8
Merge branch 'develop' into protobuf-v30
apwojcik May 14, 2026
67a5fbc
incorporate review feedback
apwojcik May 14, 2026
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
15 changes: 14 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ endif()
list(APPEND CMAKE_PREFIX_PATH /opt/rocm /opt/rocm/llvm $ENV{ROCM_PATH} $ENV{HIP_PATH})
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

cmake_policy(SET CMP0091 NEW)

project(migraphx LANGUAGES C CXX)
include(CTest)

Expand All @@ -58,6 +60,18 @@ detect_package_backend()
find_package(ROCmCMakeBuildTools REQUIRED)
find_package(Threads REQUIRED)

include(CMakeDependentOption)

cmake_dependent_option(MIGRAPHX_MSVC_STATIC_RUNTIME "" OFF "WIN32" OFF)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you add the description, like "Link MSVC runtime library statically instead of dynamically" instead of leaving blank?


if(NOT MIGRAPHX_MSVC_STATIC_RUNTIME)
set(MIGRAPHX_MSVC_RUNTIME_SUFFIX "DLL")
endif()

if(NOT CMAKE_MSVC_RUNTIME_LIBRARY)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>${MIGRAPHX_MSVC_RUNTIME_SUFFIX}")
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
option(MIGRAPHX_USE_BINSKIM_COMPLIANT_COMPILE_FLAGS "Prepare MIGraphX for BinSkim Binary Analyzer" OFF)
option(MIGRAPHX_USE_SPECTRE_MITIGATED_LIBRARIES "Use Spectre-mitigated libraries" OFF)
Expand Down Expand Up @@ -94,7 +108,6 @@ endif()

# By default build shared libraries
option(BUILD_SHARED_LIBS "Create shared libraries" ON)

option(MIGRAPHX_STRIP_SYMBOLS "Strip symbols in release mode" OFF)

# Strip symbols for release
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# THE SOFTWARE.
#####################################################################################
abseil/abseil-cpp@20250512.0 -DABSL_ENABLE_INSTALL=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DABSL_MSVC_STATIC_RUNTIME=Off
google/protobuf@v30.0 -DCMAKE_POSITION_INDEPENDENT_CODE=On -Dprotobuf_BUILD_TESTS=Off -Dprotobuf_MSVC_STATIC_RUNTIME=Off -DCMAKE_POLICY_VERSION_MINIMUM=3.5
google/protobuf@v30.0 -DCMAKE_POSITION_INDEPENDENT_CODE=On -Dprotobuf_BUILD_TESTS=Off -Dprotobuf_BUILD_SHARED_LIBS=Off -Dprotobuf_MSVC_STATIC_RUNTIME=Off -Dprotobuf_BUILD_LIBPROTOC=On -Dprotobuf_BUILD_PROTOC_BINARIES=On -Dprotobuf_BUILD_PROTOBUF_BINARIES=On -DCMAKE_POLICY_VERSION_MINIMUM=3.5
nlohmann/json@v3.8.0 -DCMAKE_POLICY_VERSION_MINIMUM=3.5
pybind/pybind11@3e9dfa2866941655c56877882565e7577de6fc7b --build
msgpack/msgpack-c@cpp-3.3.0 -DMSGPACK_BUILD_TESTS=Off -DMSGPACK_BUILD_EXAMPLES=Off -DCMAKE_POLICY_VERSION_MINIMUM=3.5
Expand Down
7 changes: 2 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,6 @@ target_sources(migraphx PRIVATE ${BUILDER_SRCS})
if(WIN32)
# Due to compilation crashing, we need to use type-erased matchers on Windows.
target_compile_definitions(migraphx PUBLIC MIGRAPHX_USE_TYPE_ERASED_MATCHERS=1)
target_compile_options(migraphx PUBLIC "-mno-ms-bitfields")
# Due to BinSkim errors EnableControlFlowGuard
target_compile_options(migraphx PUBLIC "SHELL:-Xclang -cfguard")
endif()

configure_file(version.h.in include/migraphx/version.h)
Expand Down Expand Up @@ -349,7 +346,7 @@ endif()
target_link_libraries(migraphx PUBLIC Threads::Threads)

if(MIGRAPHX_USE_EIGEN)
find_package(Eigen3)
find_package(Eigen3 QUIET)
if(Eigen3_FOUND)
target_compile_definitions(migraphx PUBLIC MIGRAPHX_USE_EIGEN=1)
target_compile_definitions(migraphx PRIVATE EIGEN_MPL2_ONLY)
Expand Down Expand Up @@ -383,7 +380,7 @@ target_link_libraries(migraphx PRIVATE SQLite::SQLite3)

# See: https://github.com/msgpack/msgpack-c/wiki/Q%26A#how-to-support-both-msgpack-c-c-version-5x-and-6x-
# Prefer 6.x (msgpack-cxx)
find_package(msgpack-cxx)
find_package(msgpack-cxx QUIET)
if(msgpack-cxx_FOUND)
message(STATUS "Found msgpack-cxx (>=6.x)")
else()
Expand Down
9 changes: 4 additions & 5 deletions src/onnx/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#####################################################################################
# The MIT License (MIT)
#
# Copyright (c) 2015-2025 Advanced Micro Devices, Inc. All rights reserved.
# Copyright (c) 2015-2026 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand All @@ -26,15 +26,14 @@ find_package(protobuf QUIET CONFIG)
if(protobuf_FOUND)
add_library(onnx-proto STATIC)
protobuf_generate(TARGET onnx-proto PROTOS onnx.proto)
target_include_directories(onnx-proto SYSTEM PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${PROTOBUF_INCLUDE_DIR})
target_link_libraries(onnx-proto PRIVATE ${PROTOBUF_LIBRARY})
target_link_libraries(onnx-proto PRIVATE protobuf::libprotobuf)
target_include_directories(onnx-proto SYSTEM PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(onnx-proto PUBLIC protobuf::libprotobuf)
else()
find_package(Protobuf REQUIRED)
protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS onnx.proto)
add_library(onnx-proto STATIC ${PROTO_SRCS})
target_include_directories(onnx-proto SYSTEM PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${PROTOBUF_INCLUDE_DIR})
target_link_libraries(onnx-proto PRIVATE ${PROTOBUF_LIBRARY})
target_link_libraries(onnx-proto PUBLIC ${PROTOBUF_LIBRARY})
endif()

if(MSVC)
Expand Down
4 changes: 3 additions & 1 deletion src/targets/fpga/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#####################################################################################
# The MIT License (MIT)
#
# Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All rights reserved.
# Copyright (c) 2015-2026 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -35,6 +35,8 @@ rocm_set_soversion(migraphx_fpga ${MIGRAPHX_SO_VERSION})
rocm_clang_tidy_check(migraphx_fpga)
target_link_libraries(migraphx_fpga migraphx)

migraphx_generate_export_header(migraphx_fpga)

rocm_install_targets(
PRIVATE
TARGETS migraphx_fpga
Expand Down
13 changes: 7 additions & 6 deletions src/targets/gpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,6 @@ if(NOT MIGRAPHX_USE_COMPOSABLEKERNEL)
${CMAKE_CURRENT_SOURCE_DIR}/jit/ck_gemm_softmax_gemm.cpp)
endif()

if(MIGRAPHX_USE_MIOPEN)
set(MIOPEN_SRCS abs.cpp)
endif()

add_library(migraphx_gpu
analyze_streams.cpp
allocation_model.cpp
Expand Down Expand Up @@ -184,7 +180,6 @@ add_library(migraphx_gpu
prefuse_ops.cpp
prepare_mlir.cpp
prepare_reduce.cpp
perfdb.cpp
pooling.cpp
problem_cache.cpp
rocblas.cpp
Expand All @@ -195,9 +190,15 @@ add_library(migraphx_gpu
topk.cpp
write_literals.cpp
${JIT_GPU_SRCS}
${MIOPEN_SRCS}
)

if(MIGRAPHX_USE_MIOPEN)
target_sources(migraphx_gpu
PRIVATE
abs.cpp
perfdb.cpp)
endif()

set_target_properties(migraphx_gpu PROPERTIES EXPORT_NAME gpu)
migraphx_generate_export_header(migraphx_gpu)

Expand Down
10 changes: 4 additions & 6 deletions src/tf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#####################################################################################
# The MIT License (MIT)
#
# Copyright (c) 2015-2025 Advanced Micro Devices, Inc. All rights reserved.
# Copyright (c) 2015-2026 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand All @@ -27,7 +27,7 @@ if(protobuf_FOUND)
add_library(tf-proto STATIC ${PROTO_SRCS})
protobuf_generate(
TARGET tf-proto
PROTOS
PROTOS
graph.proto
node_def.proto
attr_value.proto
Expand All @@ -39,9 +39,8 @@ if(protobuf_FOUND)
op_def.proto
versions.proto
)
target_include_directories(tf-proto SYSTEM PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${PROTOBUF_INCLUDE_DIR})
target_link_libraries(tf-proto PRIVATE ${PROTOBUF_LIBRARY})
target_link_libraries(tf-proto PRIVATE protobuf::libprotobuf)
target_include_directories(tf-proto SYSTEM PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(tf-proto PUBLIC protobuf::libprotobuf)
else()
find_package(Protobuf REQUIRED)
protobuf_generate_cpp(
Expand Down Expand Up @@ -86,4 +85,3 @@ rocm_install_targets(
PRIVATE
TARGETS migraphx_tf
)

Loading