Skip to content

Commit

Permalink
Merge pull request CHIP-SPV#172 from CHIP-SPV/fix-activemask-test
Browse files Browse the repository at this point in the history
Fix a test failed after switching to C++-based hipcc
  • Loading branch information
pvelesko authored Oct 2, 2022
2 parents 55b5104 + f6b78ec commit 2889288
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
11 changes: 8 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,14 @@ enable_testing()
add_subdirectory(HIP/tests/catch catch)
add_subdirectory(tests/cuda)
add_subdirectory(./samples samples)
set(HIPCC_BUILD_PATH "${CMAKE_BINARY_DIR}/bin")
add_subdirectory(HIPCC)
# Make CHIP depend on devicelib_bc and LLVMHipPasses for
# convenience. The CHIP module itself does not depend on these but
# HIP program compilation does.
add_dependencies(CHIP devicelib_bc LLVMHipPasses)
add_dependencies(samples CHIP)
add_dependencies(CHIP hipcc.bin)
add_dependencies(CHIP hipcc.bin hipconfig.bin)

add_subdirectory(bin)

Expand Down Expand Up @@ -499,9 +500,13 @@ file(WRITE "${PROJECT_BINARY_DIR}/share/.hipInfo" ${_hipInfo_build})
install(FILES ${PROJECT_BINARY_DIR}/share/.hipInfo_install
DESTINATION ${SHARE_INSTALL_DIR} RENAME .hipInfo)

# Copy over includes for hipcc to work in the build dir
file(COPY ${CMAKE_SOURCE_DIR}/include DESTINATION ${CMAKE_BINARY_DIR})
file(COPY ${CMAKE_SOURCE_DIR}/HIP/include/hip DESTINATION ${CMAKE_BINARY_DIR}/include)

# Copy hipconfig, hipvars, etc to bin
install(FILES ${CMAKE_BINARY_DIR}/HIPCC/hipcc.bin DESTINATION ${BIN_INSTALL_DIR} RENAME hipcc PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ)
install(FILES ${CMAKE_BINARY_DIR}/HIPCC/hipconfig.bin DESTINATION ${BIN_INSTALL_DIR} RENAME hipconfig PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ)
install(FILES ${CMAKE_BINARY_DIR}/bin/hipcc.bin DESTINATION ${BIN_INSTALL_DIR} RENAME hipcc PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ)
install(FILES ${CMAKE_BINARY_DIR}/bin/hipconfig.bin DESTINATION ${BIN_INSTALL_DIR} RENAME hipconfig PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ)

set(CHIP_CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR})
set(CHIP_CMAKE_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR})
Expand Down
2 changes: 1 addition & 1 deletion HIPCC
3 changes: 2 additions & 1 deletion bin/cuspvc-build.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@

export HIP_PLATFORM=spirv
export PATH=@CLANG_BIN_DIR@:@CMAKE_BINARY_DIR@/bin:$PATH
hipcc @CHIP_INCLUDES@ "$@"
export HIP_PATH=@CMAKE_BINARY_DIR@
hipcc.bin @CHIP_INCLUDES@ "$@"
1 change: 1 addition & 0 deletions bin/cuspvc-install.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#=============================================================================

export HIP_PLATFORM=spirv
export HIP_PATH=@CMAKE_INSTALL_PREFIX@
# Set PATH for locating hipcc and clang.
export PATH=@CLANG_BIN_DIR@:@CMAKE_INSTALL_PREFIX@/bin:$PATH
hipcc -I@CMAKE_INSTALL_PREFIX@/include/cuspv "$@"
4 changes: 3 additions & 1 deletion tests/cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ function(add_compile_test)
endfunction()

add_compile_test(NAME activemask SOURCES activemask.cu
COMPILE_OPTIONS -fsyntax-only)
# '-c' option is a kludge fix for C++ based hipcc. This test worked
# without the option with the previous perl-based hipcc.
COMPILE_OPTIONS "-fsyntax-only -c")
set_tests_properties(activemask PROPERTIES
PASS_REGULAR_EXPRESSION "error: '__activemask' is unavailable: unsupported in CHIP-SPV")

0 comments on commit 2889288

Please sign in to comment.