Skip to content

Commit e8cc75a

Browse files
Enable offload-compress for Windows if avaliable (#3521)
1 parent d7497d2 commit e8cc75a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

library/src/tensor_operation_instance/gpu/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
22
# SPDX-License-Identifier: MIT
33

4+
include(CheckCXXCompilerFlag)
5+
6+
# We need to pass '-x hip' since check_cxx_compiler_flag assumes c++ and not HIP.
7+
check_cxx_compiler_flag("--offload-compress -x hip" CXX_COMPILER_SUPPORTS_OFFLOAD_COMPRESS)
8+
49
function(add_instance_library INSTANCE_NAME)
510
message(DEBUG "adding instance ${INSTANCE_NAME}")
611
set(result 1)
@@ -192,8 +197,9 @@ function(add_instance_library INSTANCE_NAME)
192197
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
193198
target_compile_options(${INSTANCE_NAME} PRIVATE -gsplit-dwarf)
194199
endif()
200+
195201
# flags to compress the library
196-
if(NOT DISABLE_OFFLOAD_COMPRESS AND NOT WIN32 AND ${hip_VERSION_FLAT} GREATER 600241132)
202+
if(NOT DISABLE_OFFLOAD_COMPRESS AND CXX_COMPILER_SUPPORTS_OFFLOAD_COMPRESS)
197203
message(DEBUG "Adding --offload-compress flag for ${INSTANCE_NAME}")
198204
target_compile_options(${INSTANCE_NAME} PRIVATE --offload-compress)
199205
endif()

0 commit comments

Comments
 (0)