File tree Expand file tree Collapse file tree
library/src/tensor_operation_instance/gpu Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+
49function (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 ()
You can’t perform that action at this time.
0 commit comments