-
Notifications
You must be signed in to change notification settings - Fork 147
Enable building on Windows with necessary modifications #2167
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
base: develop
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,6 +78,22 @@ endif() | |
|
|
||
| # Target compile definitions | ||
| if(NOT BUILD_CUDA) | ||
| if (WIN32) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No - I don't see why this is win32 guarded. |
||
| find_package(msgpack-cxx REQUIRED) | ||
|
|
||
| target_compile_definitions(hipblaslt PUBLIC -DTENSILE_MSGPACK=1) | ||
| get_target_property(msgpack_inc msgpack-cxx INTERFACE_INCLUDE_DIRECTORIES) | ||
|
|
||
| if(DEFINED msgpack_inc) | ||
| # include C++ headers manually | ||
| # External header includes included as system files | ||
| target_include_directories(hipblaslt | ||
| SYSTEM PRIVATE $<BUILD_INTERFACE:${msgpack_inc}> | ||
| ) | ||
|
|
||
| target_link_libraries(hipblaslt PRIVATE TensileHost shlwapi) | ||
| endif() | ||
| endif() | ||
|
|
||
| if( BUILD_SHARED_LIBS ) | ||
| target_link_libraries( hipblaslt PRIVATE TensileHost ) | ||
|
|
@@ -207,6 +223,10 @@ set_target_properties(hipblaslt PROPERTIES CXX_VISIBILITY_PRESET "hidden" VISIBI | |
| set_target_properties(hipblaslt PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/staging") | ||
| set_target_propertieS(hipblaslt PROPERTIES DEBUG_POSTFIX "-d") | ||
|
|
||
| if (WIN32 AND BUILD_CLIENTS) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cannot land things like this anymore. This is not win32 generally but related to the expectations of your build system. |
||
| add_custom_command( TARGET hipblaslt POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/staging/$<TARGET_FILE_NAME:hipblaslt> ${PROJECT_BINARY_DIR}/clients/staging/$<TARGET_FILE_NAME:hipblaslt> ) | ||
| endif() | ||
|
|
||
| # TODO ?? | ||
| # Following boost conventions of prefixing 'lib' on static built libraries | ||
| if(NOT BUILD_SHARED_LIBS) | ||
|
|
@@ -239,7 +259,7 @@ install( | |
|
|
||
| if ( NOT BUILD_CUDA ) | ||
| if (WIN32) | ||
| set( HIPBLASLT_TENSILE_LIBRARY_DIR "\${CPACK_PACKAGING_INSTALL_PREFIX}hipblaslt/bin" CACHE PATH "path to tensile library" ) | ||
| set( HIPBLASLT_TENSILE_LIBRARY_DIR "\${CPACK_PACKAGING_INSTALL_PREFIX}/bin/hipblaslt" CACHE PATH "path to tensile library" ) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fyi - we're aligning these libraries to ask be based on the posix paths. The hipBLASLt host code has already been updated to use lib as the location for all platforms. |
||
| else() | ||
| set( HIPBLASLT_TENSILE_LIBRARY_DIR "\${CPACK_PACKAGING_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}/hipblaslt" CACHE PATH "path to tensile library" ) | ||
| endif() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,17 +80,17 @@ foreach(arch IN LISTS archs) | |
| ${CMAKE_CURRENT_BINARY_DIR}/A_H_H_256_4_${arch}.s | ||
| ${CMAKE_CURRENT_BINARY_DIR}/A_H_S_256_4_${arch}.s | ||
| ${CMAKE_CURRENT_BINARY_DIR}/A_S_H_256_4_${arch}.s | ||
| COMMAND ${python_launch_prefix} LayerNormGenerator.py -o ${CMAKE_CURRENT_BINARY_DIR}/L_256_4_1_${arch}.s -w 256 -c 4 --sweep-once 1 --arch ${arch} | ||
| COMMAND ${python_launch_prefix} LayerNormGenerator.py -o ${CMAKE_CURRENT_BINARY_DIR}/L_256_4_0_${arch}.s -w 256 -c 4 --sweep-once 0 --arch ${arch} | ||
| COMMAND ${python_launch_prefix} SoftmaxGenerator.py -o ${CMAKE_CURRENT_BINARY_DIR}/S_8_32_${arch}.s -m 8 -n 32 --arch ${arch} | ||
| COMMAND ${python_launch_prefix} SoftmaxGenerator.py -o ${CMAKE_CURRENT_BINARY_DIR}/S_16_16_${arch}.s -m 16 -n 16 --arch ${arch} | ||
| COMMAND ${python_launch_prefix} SoftmaxGenerator.py -o ${CMAKE_CURRENT_BINARY_DIR}/S_4_64_${arch}.s -m 4 -n 64 --arch ${arch} | ||
| COMMAND ${python_launch_prefix} SoftmaxGenerator.py -o ${CMAKE_CURRENT_BINARY_DIR}/S_2_128_${arch}.s -m 2 -n 128 --arch ${arch} | ||
| COMMAND ${python_launch_prefix} SoftmaxGenerator.py -o ${CMAKE_CURRENT_BINARY_DIR}/S_1_256_${arch}.s -m 1 -n 256 --arch ${arch} | ||
| COMMAND ${python_launch_prefix} AMaxGenerator.py -o ${CMAKE_CURRENT_BINARY_DIR}/A_S_S_256_4_${arch}.s -t S -d S -w 256 -c 4 --arch ${arch} | ||
| COMMAND ${python_launch_prefix} AMaxGenerator.py -o ${CMAKE_CURRENT_BINARY_DIR}/A_H_H_256_4_${arch}.s -t H -d H -w 256 -c 4 --arch ${arch} | ||
| COMMAND ${python_launch_prefix} AMaxGenerator.py -o ${CMAKE_CURRENT_BINARY_DIR}/A_H_S_256_4_${arch}.s -t H -d S -w 256 -c 4 --arch ${arch} | ||
| COMMAND ${python_launch_prefix} AMaxGenerator.py -o ${CMAKE_CURRENT_BINARY_DIR}/A_S_H_256_4_${arch}.s -t S -d H -w 256 -c 4 --arch ${arch} | ||
| COMMAND ${CMAKE_COMMAND} -E env ${python_launch_prefix} LayerNormGenerator.py -o ${CMAKE_CURRENT_BINARY_DIR}/L_256_4_1_${arch}.s -w 256 -c 4 --sweep-once 1 --arch ${arch} | ||
| COMMAND ${CMAKE_COMMAND} -E env ${python_launch_prefix} LayerNormGenerator.py -o ${CMAKE_CURRENT_BINARY_DIR}/L_256_4_0_${arch}.s -w 256 -c 4 --sweep-once 0 --arch ${arch} | ||
| COMMAND ${CMAKE_COMMAND} -E env ${python_launch_prefix} SoftmaxGenerator.py -o ${CMAKE_CURRENT_BINARY_DIR}/S_8_32_${arch}.s -m 8 -n 32 --arch ${arch} | ||
| COMMAND ${CMAKE_COMMAND} -E env ${python_launch_prefix} SoftmaxGenerator.py -o ${CMAKE_CURRENT_BINARY_DIR}/S_16_16_${arch}.s -m 16 -n 16 --arch ${arch} | ||
| COMMAND ${CMAKE_COMMAND} -E env ${python_launch_prefix} SoftmaxGenerator.py -o ${CMAKE_CURRENT_BINARY_DIR}/S_4_64_${arch}.s -m 4 -n 64 --arch ${arch} | ||
| COMMAND ${CMAKE_COMMAND} -E env ${python_launch_prefix} SoftmaxGenerator.py -o ${CMAKE_CURRENT_BINARY_DIR}/S_2_128_${arch}.s -m 2 -n 128 --arch ${arch} | ||
| COMMAND ${CMAKE_COMMAND} -E env ${python_launch_prefix} SoftmaxGenerator.py -o ${CMAKE_CURRENT_BINARY_DIR}/S_1_256_${arch}.s -m 1 -n 256 --arch ${arch} | ||
| COMMAND ${CMAKE_COMMAND} -E env ${python_launch_prefix} AMaxGenerator.py -o ${CMAKE_CURRENT_BINARY_DIR}/A_S_S_256_4_${arch}.s -t S -d S -w 256 -c 4 --arch ${arch} | ||
| COMMAND ${CMAKE_COMMAND} -E env ${python_launch_prefix} AMaxGenerator.py -o ${CMAKE_CURRENT_BINARY_DIR}/A_H_H_256_4_${arch}.s -t H -d H -w 256 -c 4 --arch ${arch} | ||
| COMMAND ${CMAKE_COMMAND} -E env ${python_launch_prefix} AMaxGenerator.py -o ${CMAKE_CURRENT_BINARY_DIR}/A_H_S_256_4_${arch}.s -t H -d S -w 256 -c 4 --arch ${arch} | ||
| COMMAND ${CMAKE_COMMAND} -E env ${python_launch_prefix} AMaxGenerator.py -o ${CMAKE_CURRENT_BINARY_DIR}/A_S_H_256_4_${arch}.s -t S -d H -w 256 -c 4 --arch ${arch} | ||
| COMMENT "Creating Layer Norm, Softmax and Amax Assembly for ${arch}" | ||
| WORKING_DIRECTORY ${ops_path} | ||
| ) | ||
|
|
@@ -101,10 +101,10 @@ foreach(arch IN LISTS archs) | |
| ${CMAKE_CURRENT_BINARY_DIR}/A_S_S_B8N_256_4_${arch}.s | ||
| ${CMAKE_CURRENT_BINARY_DIR}/A_S_H_F8N_256_4_${arch}.s | ||
| ${CMAKE_CURRENT_BINARY_DIR}/A_S_H_B8N_256_4_${arch}.s | ||
| COMMAND ${python_launch_prefix} AMaxGenerator.py --is-scale -o ${CMAKE_CURRENT_BINARY_DIR}/A_S_S_F8N_256_4_${arch}.s -t S -d S -s F8N -w 256 -c 4 --arch ${arch} | ||
| COMMAND ${python_launch_prefix} AMaxGenerator.py --is-scale -o ${CMAKE_CURRENT_BINARY_DIR}/A_S_S_B8N_256_4_${arch}.s -t S -d S -s B8N -w 256 -c 4 --arch ${arch} | ||
| COMMAND ${python_launch_prefix} AMaxGenerator.py --is-scale -o ${CMAKE_CURRENT_BINARY_DIR}/A_S_H_F8N_256_4_${arch}.s -t S -d H -s F8N -w 256 -c 4 --arch ${arch} | ||
| COMMAND ${python_launch_prefix} AMaxGenerator.py --is-scale -o ${CMAKE_CURRENT_BINARY_DIR}/A_S_H_B8N_256_4_${arch}.s -t S -d H -s B8N -w 256 -c 4 --arch ${arch} | ||
| COMMAND ${CMAKE_COMMAND} -E env ${python_launch_prefix} AMaxGenerator.py --is-scale -o ${CMAKE_CURRENT_BINARY_DIR}/A_S_S_F8N_256_4_${arch}.s -t S -d S -s F8N -w 256 -c 4 --arch ${arch} | ||
| COMMAND ${CMAKE_COMMAND} -E env ${python_launch_prefix} AMaxGenerator.py --is-scale -o ${CMAKE_CURRENT_BINARY_DIR}/A_S_S_B8N_256_4_${arch}.s -t S -d S -s B8N -w 256 -c 4 --arch ${arch} | ||
| COMMAND ${CMAKE_COMMAND} -E env ${python_launch_prefix} AMaxGenerator.py --is-scale -o ${CMAKE_CURRENT_BINARY_DIR}/A_S_H_F8N_256_4_${arch}.s -t S -d H -s F8N -w 256 -c 4 --arch ${arch} | ||
| COMMAND ${CMAKE_COMMAND} -E env ${python_launch_prefix} AMaxGenerator.py --is-scale -o ${CMAKE_CURRENT_BINARY_DIR}/A_S_H_B8N_256_4_${arch}.s -t S -d H -s B8N -w 256 -c 4 --arch ${arch} | ||
| COMMENT "Creating Extra Amax Assembly for gfx942" | ||
| WORKING_DIRECTORY ${ops_path} | ||
| ) | ||
|
|
@@ -123,10 +123,10 @@ foreach(arch IN LISTS archs) | |
| ${CMAKE_CURRENT_BINARY_DIR}/A_S_S_B8_256_4_${arch}.s | ||
| ${CMAKE_CURRENT_BINARY_DIR}/A_S_H_F8_256_4_${arch}.s | ||
| ${CMAKE_CURRENT_BINARY_DIR}/A_S_H_B8_256_4_${arch}.s | ||
| COMMAND ${python_launch_prefix} AMaxGenerator.py --is-scale -o ${CMAKE_CURRENT_BINARY_DIR}/A_S_S_F8_256_4_${arch}.s -t S -d S -s F8 -w 256 -c 4 --arch ${arch} | ||
| COMMAND ${python_launch_prefix} AMaxGenerator.py --is-scale -o ${CMAKE_CURRENT_BINARY_DIR}/A_S_S_B8_256_4_${arch}.s -t S -d S -s B8 -w 256 -c 4 --arch ${arch} | ||
| COMMAND ${python_launch_prefix} AMaxGenerator.py --is-scale -o ${CMAKE_CURRENT_BINARY_DIR}/A_S_H_F8_256_4_${arch}.s -t S -d H -s F8 -w 256 -c 4 --arch ${arch} | ||
| COMMAND ${python_launch_prefix} AMaxGenerator.py --is-scale -o ${CMAKE_CURRENT_BINARY_DIR}/A_S_H_B8_256_4_${arch}.s -t S -d H -s B8 -w 256 -c 4 --arch ${arch} | ||
| COMMAND ${CMAKE_COMMAND} -E env ${python_launch_prefix} AMaxGenerator.py --is-scale -o ${CMAKE_CURRENT_BINARY_DIR}/A_S_S_F8_256_4_${arch}.s -t S -d S -s F8 -w 256 -c 4 --arch ${arch} | ||
| COMMAND ${CMAKE_COMMAND} -E env ${python_launch_prefix} AMaxGenerator.py --is-scale -o ${CMAKE_CURRENT_BINARY_DIR}/A_S_S_B8_256_4_${arch}.s -t S -d S -s B8 -w 256 -c 4 --arch ${arch} | ||
| COMMAND ${CMAKE_COMMAND} -E env ${python_launch_prefix} AMaxGenerator.py --is-scale -o ${CMAKE_CURRENT_BINARY_DIR}/A_S_H_F8_256_4_${arch}.s -t S -d H -s F8 -w 256 -c 4 --arch ${arch} | ||
| COMMAND ${CMAKE_COMMAND} -E env ${python_launch_prefix} AMaxGenerator.py --is-scale -o ${CMAKE_CURRENT_BINARY_DIR}/A_S_H_B8_256_4_${arch}.s -t S -d H -s B8 -w 256 -c 4 --arch ${arch} | ||
| COMMENT "Creating Extra Amax Assembly for gfx950" | ||
| WORKING_DIRECTORY ${ops_path} | ||
| ) | ||
|
|
@@ -142,21 +142,31 @@ foreach(arch IN LISTS archs) | |
| DEPENDS ExtOpObj_${arch} | ||
| OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/extop_${arch}.co | ||
| COMMAND ${CMAKE_CXX_COMPILER};-target;amdgcn-amdhsa;-Xlinker;$<TARGET_OBJECTS:ExtOpObj_${arch}>;-o;${CMAKE_CURRENT_BINARY_DIR}/extop_${arch}.co | ||
| COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_BINARY_DIR}/extop_${arch}.co" "${PROJECT_BINARY_DIR}/Tensile/library/" | ||
| COMMENT "Creating extop_${arch}" | ||
| COMMAND_EXPAND_LISTS | ||
| ) | ||
| add_custom_target(ExtOpLibrary_${arch} ALL | ||
| DEPENDS ${dat_depends} ${CMAKE_CURRENT_BINARY_DIR}/extop_${arch}.co | ||
| COMMAND ${python_launch_prefix} ExtOpCreateLibrary.py --src=${CMAKE_CURRENT_BINARY_DIR} --co=${CMAKE_CURRENT_BINARY_DIR}/extop_${arch}.co --output=${CMAKE_CURRENT_BINARY_DIR} --arch=${arch} | ||
| COMMAND ${CMAKE_COMMAND} -E env ${python_launch_prefix} ExtOpCreateLibrary.py --src=${CMAKE_CURRENT_BINARY_DIR} --co=${CMAKE_CURRENT_BINARY_DIR}/extop_${arch}.co --output=${CMAKE_CURRENT_BINARY_DIR} --arch=${arch} | ||
| COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_BINARY_DIR}/hipblasltExtOpLibrary.dat" "${PROJECT_BINARY_DIR}/Tensile/library/" | ||
| COMMENT "Creating hipblasltExtOpLibrary.dat" | ||
| WORKING_DIRECTORY ${ops_path} | ||
| ) | ||
| list(APPEND dat_depends "ExtOpLibrary_${arch}") | ||
| endforeach() | ||
|
|
||
| add_custom_target(ExtOpCp ALL | ||
| DEPENDS ${dat_depends} TENSILE_LIBRARY_TARGET | ||
| COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_BINARY_DIR}/*.co" ${PROJECT_BINARY_DIR}/Tensile/library | ||
| COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_BINARY_DIR}/*.dat" ${PROJECT_BINARY_DIR}/Tensile/library | ||
| COMMENT "Copying ExtOp Library" | ||
| ) | ||
| add_custom_target(ExtOpCp ALL | ||
| DEPENDS ${dat_depends} TENSILE_LIBRARY_TARGET | ||
| COMMENT "Copying .co and .dat files" | ||
| ) | ||
|
|
||
| file(GLOB FILES_TO_COPY "${CMAKE_CURRENT_BINARY_DIR}/*.co" "${CMAKE_CURRENT_BINARY_DIR}/*.dat") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand how this can work: the glob will be evaluated at configure time but it is trying to find files that are generated at build time. I think this will only work after the first build, which would be wrong. |
||
|
|
||
| foreach(file ${FILES_TO_COPY}) | ||
| add_custom_command( | ||
| TARGET ExtOpCp POST_BUILD | ||
| COMMAND ${CMAKE_COMMAND} -E copy "${file}" "${PROJECT_BINARY_DIR}/Tensile/library/" | ||
| COMMENT "Copying ${file} to ${PROJECT_BINARY_DIR}/Tensile/library/" | ||
| ) | ||
| endforeach() | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, we can't land changes like this anymore. It is never appropriate to be copying files from system32 or using a platform gate to move files around by absolute path. Getting these things lined up is a job for whatever is building this project, not just something to be done unconditionally here.