Skip to content

Commit

Permalink
merge amd-mainline into release/rocm-rel-6.2
Browse files Browse the repository at this point in the history
[SWDEV-477134][HIPIFY] Missing support for Math Consts

Dedicated to the 6.2.1 release

Change-Id: I4363ebad7e9227de6979e82c4eaea11561f35a91
  • Loading branch information
emankov committed Aug 1, 2024
2 parents c4696fc + 4823e50 commit fed2ff1
Show file tree
Hide file tree
Showing 36 changed files with 2,907 additions and 1,147 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
Documentation for HIPIFY is available at
[https://rocmdocs.amd.com/projects/HIPIFY/en/latest/](https://rocmdocs.amd.com/projects/HIPIFY/en/latest/).

## HIPIFY for ROCm 6.2.1

### Additions

* CUDA 12.5.1 support
* cuDNN 9.2.1 support
* LLVM 18.1.8 support
* `hipBLAS` 64-bit APIs support
* Support for Math Constants `math_constants.h`

## HIPIFY for ROCm 6.2.0

### Additions
Expand Down
77 changes: 52 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ else()
endif()

message(STATUS "HIPIFY config:")
message(STATUS " - Build hipify-clang : ${HIPIFY_BUILD}")
message(STATUS " - Test hipify-clang : ${HIPIFY_TEST}")
message(STATUS " - Is part of HIP SDK : ${HIPIFY_INCLUDE_IN_HIP_SDK}")
message(STATUS " - Build hipify-clang : ${HIPIFY_BUILD}")
message(STATUS " - Test hipify-clang : ${HIPIFY_TEST}")
message(STATUS " - Is part of HIP SDK : ${HIPIFY_INCLUDE_IN_HIP_SDK}")
message(STATUS " - Install clang headers : ${HIPIFY_INSTALL_CLANG_HEADERS}")

if(HIPIFY_INCLUDE_IN_HIP_SDK)
Expand All @@ -38,10 +38,10 @@ else()
find_package(LLVM REQUIRED CONFIG PATHS ${CMAKE_PREFIX_PATH})

message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}:")
message(STATUS " - CMake module path : ${LLVM_CMAKE_DIR}")
message(STATUS " - Clang include path : ${CLANG_INCLUDE_DIRS}")
message(STATUS " - LLVM Include path : ${LLVM_INCLUDE_DIRS}")
message(STATUS " - Binary path : ${LLVM_TOOLS_BINARY_DIR}")
message(STATUS " - CMake module path : ${LLVM_CMAKE_DIR}")
message(STATUS " - Clang include path : ${CLANG_INCLUDE_DIRS}")
message(STATUS " - LLVM Include path : ${LLVM_INCLUDE_DIRS}")
message(STATUS " - Binary path : ${LLVM_TOOLS_BINARY_DIR}")
endif()

list(APPEND CMAKE_MODULE_PATH ${LLVM_CMAKE_DIR})
Expand Down Expand Up @@ -279,12 +279,12 @@ if(HIPIFY_CLANG_TESTS OR HIPIFY_CLANG_TESTS_ONLY)
require_program(lit)
require_program(FileCheck)

set(CUDA_TOOLKIT_ROOT_DIR OFF CACHE PATH "Path to CUDA Toolkit to use in hipify-clang unit testing")
set(CUDA_SDK_ROOT_DIR OFF CACHE PATH "Path to CUDA Toolkit Samples")
set(CUDA_DNN_ROOT_DIR OFF CACHE PATH "Path to cuDNN")
set(CUDA_CUB_ROOT_DIR OFF CACHE PATH "Path to CUB")
set(CUDA_TOOLKIT_ROOT_DIR "" CACHE PATH "Path to CUDA Toolkit to use in hipify-clang unit testing")
set(CUDA_SDK_ROOT_DIR "" CACHE PATH "Path to CUDA Toolkit Samples")
set(CUDA_DNN_ROOT_DIR "" CACHE PATH "Path to cuDNN")
set(CUDA_CUB_ROOT_DIR "" CACHE PATH "Path to CUB")

if(DEFINED CUDA_TOOLKIT_ROOT_DIR AND NOT CUDA_TOOLKIT_ROOT_DIR MATCHES "OFF")
if(NOT CUDA_TOOLKIT_ROOT_DIR STREQUAL "" AND NOT CUDA_TOOLKIT_ROOT_DIR MATCHES "OFF")
if(NOT DEFINED CUDAToolkit_ROOT OR CUDAToolkit_ROOT MATCHES "OFF")
set(CUDAToolkit_ROOT "${CUDA_TOOLKIT_ROOT_DIR}")
endif()
Expand All @@ -295,10 +295,10 @@ if(HIPIFY_CLANG_TESTS OR HIPIFY_CLANG_TESTS_ONLY)
endif()

message(STATUS "Initial CUDA to configure:")
message(STATUS " - CUDA Toolkit path : ${CUDA_TOOLKIT_ROOT_DIR}")
message(STATUS " - CUDA Samples path : ${CUDA_SDK_ROOT_DIR}")
message(STATUS " - cuDNN path : ${CUDA_DNN_ROOT_DIR}")
message(STATUS " - CUB path : ${CUDA_CUB_ROOT_DIR}")
message(STATUS " - CUDA Toolkit path : ${CUDA_TOOLKIT_ROOT_DIR}")
message(STATUS " - CUDA Samples path : ${CUDA_SDK_ROOT_DIR}")
message(STATUS " - cuDNN path : ${CUDA_DNN_ROOT_DIR}")
message(STATUS " - CUB path : ${CUDA_CUB_ROOT_DIR}")

if(${CMAKE_VERSION} VERSION_LESS "3.27.0")
find_package(CUDA REQUIRED)
Expand All @@ -313,19 +313,46 @@ if(HIPIFY_CLANG_TESTS OR HIPIFY_CLANG_TESTS_ONLY)
set(CUDA_TOOLKIT_ROOT_DIR "${CUDAToolkit_LIBRARY_ROOT}")
endif()

if(WIN32 AND CUDA_VERSION VERSION_LESS "11.6" AND CUDA_SDK_ROOT_DIR STREQUAL "OFF" AND NOT CUDA_TOOLKIT_ROOT_DIR MATCHES "OFF")
set(NVCUDASAMPLES "NVCUDASAMPLES${CUDA_VERSION_MAJOR}_${CUDA_VERSION_MINOR}_ROOT")
if(DEFINED ENV{${NVCUDASAMPLES}})
set(CUDA_SDK_ROOT_DIR "$ENV{${NVCUDASAMPLES}}")
string(REPLACE "\\" "/" CUDA_SDK_ROOT_DIR ${CUDA_SDK_ROOT_DIR})
if(CUDA_SDK_ROOT_DIR STREQUAL "")
if(WIN32)
if(CUDA_VERSION VERSION_LESS "11.6")
set(NVCUDASAMPLES "NVCUDASAMPLES${CUDA_VERSION_MAJOR}_${CUDA_VERSION_MINOR}_ROOT")
if(DEFINED ENV{${NVCUDASAMPLES}})
set(CUDA_SDK_ROOT_DIR "$ENV{${NVCUDASAMPLES}}")
string(REPLACE "\\" "/" CUDA_SDK_ROOT_DIR ${CUDA_SDK_ROOT_DIR})
endif()
endif()
elseif(UNIX)
if(NOT CUDA_TOOLKIT_ROOT_DIR STREQUAL "" AND NOT CUDA_TOOLKIT_ROOT_DIR STREQUAL "OFF" AND CUDA_VERSION VERSION_LESS "10.1")
set(CUDA_SDK_ROOT_DIR "${CUDA_TOOLKIT_ROOT_DIR}/samples")
endif()
endif()
endif()
if(CUDA_SDK_ROOT_DIR STREQUAL "")
set(CUDA_SDK_ROOT_DIR OFF)
endif()

if(CUDA_DNN_ROOT_DIR STREQUAL "")
set(CUDA_DNN_ROOT_DIR OFF)
endif()

if(CUDA_CUB_ROOT_DIR STREQUAL "")
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.0")
if(WIN32 OR (UNIX AND CUDA_VERSION VERSION_LESS "11.4" OR CUDA_VERSION VERSION_GREATER_EQUAL "11.6"))
set(CUDA_CUB_ROOT_DIR "${CUDA_TOOLKIT_ROOT_DIR}/include/cub")
else()
set(CUDA_CUB_ROOT_DIR OFF)
endif()
else()
set(CUDA_CUB_ROOT_DIR OFF)
endif()
endif()

message(STATUS "Found CUDA config:")
message(STATUS " - CUDA Toolkit path : ${CUDA_TOOLKIT_ROOT_DIR}")
message(STATUS " - CUDA Samples path : ${CUDA_SDK_ROOT_DIR}")
message(STATUS " - cuDNN path : ${CUDA_DNN_ROOT_DIR}")
message(STATUS " - CUB path : ${CUDA_CUB_ROOT_DIR}")
message(STATUS " - CUDA Toolkit path : ${CUDA_TOOLKIT_ROOT_DIR}")
message(STATUS " - CUDA Samples path : ${CUDA_SDK_ROOT_DIR}")
message(STATUS " - cuDNN path : ${CUDA_DNN_ROOT_DIR}")
message(STATUS " - CUB path : ${CUDA_CUB_ROOT_DIR}")

if((CUDA_VERSION VERSION_LESS "7.0") OR (LLVM_PACKAGE_VERSION VERSION_LESS "3.8") OR
(CUDA_VERSION VERSION_GREATER "7.5" AND LLVM_PACKAGE_VERSION VERSION_LESS "4.0") OR
Expand Down
Loading

0 comments on commit fed2ff1

Please sign in to comment.