diff --git a/hipamd/hipify-clang/CMakeLists.txt b/hipamd/hipify-clang/CMakeLists.txt
deleted file mode 100644
index 875b5dad74..0000000000
--- a/hipamd/hipify-clang/CMakeLists.txt
+++ /dev/null
@@ -1,198 +0,0 @@
-cmake_minimum_required(VERSION 3.5.1)
-
-project(hipify-clang)
-
-if (MSVC AND MSVC_VERSION VERSION_LESS "1900")
- message(SEND_ERROR "hipify-clang could be built by Visual Studio 14 2015 or higher.")
- return()
-endif()
-
-find_package(LLVM REQUIRED)
-message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}:")
-message(STATUS " - CMake module path: ${LLVM_CMAKE_DIR}")
-message(STATUS " - Include path : ${LLVM_INCLUDE_DIRS}")
-message(STATUS " - Binary path : ${LLVM_TOOLS_BINARY_DIR}")
-
-option(HIPIFY_CLANG_TESTS "Build the tests for hipify-clang, if lit is installed" OFF)
-
-list(APPEND CMAKE_MODULE_PATH ${LLVM_CMAKE_DIR})
-include(AddLLVM)
-
-include_directories(${LLVM_INCLUDE_DIRS})
-link_directories(${LLVM_LIBRARY_DIRS})
-add_definitions(${LLVM_DEFINITIONS})
-
-file(GLOB_RECURSE HIPIFY_SOURCES src/*.cpp)
-file(GLOB_RECURSE HIPIFY_HEADERS src/*.h)
-add_llvm_executable(hipify-clang ${HIPIFY_SOURCES} ${HIPIFY_HEADERS})
-
-set(CMAKE_CXX_COMPILER ${LLVM_TOOLS_BINARY_DIR}/clang++)
-set(CMAKE_C_COMPILER ${LLVM_TOOLS_BINARY_DIR}/clang)
-
-# Link against LLVM and CLANG libraries
-target_link_libraries(hipify-clang PRIVATE
- clangASTMatchers
- clangFrontend
- clangTooling
- clangParse
- clangSerialization
- clangSema
- clangEdit
- clangFormat
- clangLex
- clangAnalysis
- clangDriver
- clangAST
- clangToolingCore
- clangRewrite
- clangBasic
- LLVMProfileData
- LLVMSupport
- LLVMMCParser
- LLVMMC
- LLVMBitReader
- LLVMOption
- LLVMCore)
-
-if (LLVM_PACKAGE_VERSION VERSION_GREATER "6.0.1")
- target_link_libraries(hipify-clang PRIVATE clangToolingInclusions)
-endif()
-
-if (LLVM_PACKAGE_VERSION VERSION_GREATER "9.0.1")
- target_link_libraries(hipify-clang PRIVATE LLVMFrontendOpenMP)
-endif()
-
-if (MSVC)
- target_link_libraries(hipify-clang PRIVATE version)
- target_compile_options(hipify-clang PRIVATE "/Od /GR- /EHs- /EHc-")
- set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} /SUBSYSTEM:WINDOWS")
- set(StdCpp "/std:c++")
-else()
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -fno-rtti -fvisibility-inlines-hidden")
- set(StdCpp "-std=c++")
-endif()
-
-if (LLVM_PACKAGE_VERSION VERSION_GREATER "9.0")
- string(APPEND StdCpp "14")
-# MSVC starting from 1900 (VS 2015) supports only the following c++ std values: c++14|c++17|c++latest
-elseif (MSVC)
- set(StdCpp "")
-else()
- string(APPEND StdCpp "11")
-endif()
-
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} ${StdCpp} -DHIPIFY_CLANG_RES=\\\"${LLVM_LIBRARY_DIRS}/clang/${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}\\\"")
-
-set(INSTALL_PATH_DOC_STRING "Installation path for hipify-clang")
-set(HIPIFY_INSTALL_PATH ${CMAKE_INSTALL_PREFIX})
-if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
- if(CMAKE_BUILD_TYPE MATCHES Debug)
- set(HIPIFY_INSTALL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/bin" CACHE PATH ${INSTALL_PATH_DOC_STRING} FORCE)
- elseif(CMAKE_BUILD_TYPE MATCHES Release)
- if (BIN_INSTALL_DIR)
- set(HIPIFY_INSTALL_PATH "${BIN_INSTALL_DIR}" CACHE PATH ${INSTALL_PATH_DOC_STRING} FORCE)
- else()
- set(HIPIFY_INSTALL_PATH "${PROJECT_BINARY_DIR}/bin" CACHE PATH ${INSTALL_PATH_DOC_STRING} FORCE)
- endif()
- else()
- message(FATAL_ERROR "Invalid CMAKE_BUILD_TYPE specified. Valid values are Debug and Release")
- endif()
-elseif(BIN_INSTALL_DIR)
- set(HIPIFY_INSTALL_PATH "${BIN_INSTALL_DIR}" CACHE PATH ${INSTALL_PATH_DOC_STRING} FORCE)
-endif()
-
-install(TARGETS hipify-clang DESTINATION ${HIPIFY_INSTALL_PATH})
-
-install(
- DIRECTORY ${LLVM_DIR}/../../clang/${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}/
- DESTINATION ${HIPIFY_INSTALL_PATH}
- COMPONENT clang-resource-headers
- FILES_MATCHING
- PATTERN "*.h"
- PATTERN "*.modulemap"
- PATTERN "algorithm"
- PATTERN "complex"
- PATTERN "new"
- PATTERN "ppc_wrappers" EXCLUDE
- PATTERN "openmp_wrappers" EXCLUDE)
-
-if (UNIX)
- set(BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/packages/hipify-clang)
- configure_file(packaging/hipify-clang.txt ${BUILD_DIR}/CMakeLists.txt @ONLY)
- add_custom_target(pkg_hipify-clang COMMAND ${CMAKE_COMMAND} .
- COMMAND rm -rf *.deb *.rpm *.tar.gz
- COMMAND make package
- COMMAND cp *.deb ${PROJECT_BINARY_DIR}
- COMMAND cp *.rpm ${PROJECT_BINARY_DIR}
- COMMAND cp *.tar.gz ${PROJECT_BINARY_DIR}
- WORKING_DIRECTORY ${BUILD_DIR})
-
- file(GENERATE OUTPUT ${PROJECT_BINARY_DIR}/fixnames
- CONTENT "pwd; for i in *.deb; do mv \"\$i\" \"\${i/.deb/-amd64.deb}\" ; done
- for i in *.rpm ; do mv \$i \${i/.rpm/.x86_64.rpm} ; done")
-
- add_custom_target(package_hipify-clang
- COMMAND bash ${PROJECT_BINARY_DIR}/fixnames
- WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
- DEPENDS pkg_hipify-clang)
-endif()
-
-if (HIPIFY_CLANG_TESTS)
- find_package(PythonInterp 2.7 REQUIRED)
-
- function (require_program PROGRAM_NAME)
- find_program(FOUND_${PROGRAM_NAME} ${PROGRAM_NAME})
- if (FOUND_${PROGRAM_NAME})
- message(STATUS "Found ${PROGRAM_NAME}: ${FOUND_${PROGRAM_NAME}}")
- else()
- message(SEND_ERROR "Can't find ${PROGRAM_NAME}. Either set HIPIFY_CLANG_TESTS to OFF to disable hipify tests, or install the missing program.")
- endif()
- endfunction()
-
- require_program(lit)
- require_program(FileCheck)
-
- find_package(CUDA REQUIRED)
- 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
- (CUDA_VERSION VERSION_GREATER "8.0" AND LLVM_PACKAGE_VERSION VERSION_LESS "6.0") OR
- (CUDA_VERSION VERSION_GREATER "9.0" AND LLVM_PACKAGE_VERSION VERSION_LESS "7.0") OR
- (CUDA_VERSION VERSION_GREATER "9.2" AND LLVM_PACKAGE_VERSION VERSION_LESS "8.0") OR
- (CUDA_VERSION VERSION_GREATER "10.0" AND LLVM_PACKAGE_VERSION VERSION_LESS "9.0") OR
- (CUDA_VERSION VERSION_GREATER "10.1" AND LLVM_PACKAGE_VERSION VERSION_LESS "10.0"))
- message(SEND_ERROR "CUDA ${CUDA_VERSION} is not supported by LLVM ${LLVM_PACKAGE_VERSION}.")
- if (CUDA_VERSION_MAJOR VERSION_LESS "7")
- message(STATUS "Please install CUDA 7.0 or higher.")
- elseif (CUDA_VERSION_MAJOR VERSION_LESS "8")
- message(STATUS "Please install LLVM + clang 3.8 or higher.")
- elseif (CUDA_VERSION_MAJOR VERSION_LESS "9")
- message(STATUS "Please install LLVM + clang 4.0 or higher.")
- elseif (CUDA_VERSION VERSION_EQUAL "9.0")
- message(STATUS "Please install LLVM + clang 6.0 or higher.")
- elseif (CUDA_VERSION_MAJOR VERSION_LESS "10")
- message(STATUS "Please install LLVM + clang 7.0 or higher.")
- elseif (CUDA_VERSION VERSION_EQUAL "10.0")
- message(STATUS "Please install LLVM + clang 8.0 or higher.")
- elseif (CUDA_VERSION VERSION_EQUAL "10.1")
- message(STATUS "Please install LLVM + clang 9.0 or higher.")
- elseif (CUDA_VERSION VERSION_EQUAL "10.2")
- message(STATUS "Please install LLVM + clang 10.0 or higher.")
- endif()
- endif()
-
- configure_file(
- ${CMAKE_CURRENT_LIST_DIR}/../tests/hipify-clang/lit.site.cfg.in
- ${CMAKE_CURRENT_BINARY_DIR}/tests/hipify-clang/lit.site.cfg
- @ONLY)
-
- add_lit_testsuite(test-hipify "Running HIPify regression tests"
- ${CMAKE_CURRENT_LIST_DIR}/../tests/hipify-clang
- PARAMS site_config=${CMAKE_CURRENT_BINARY_DIR}/tests/hipify-clang/lit.site.cfg
- ARGS -v
- DEPENDS hipify-clang)
-
- add_custom_target(test-hipify-clang)
- add_dependencies(test-hipify-clang test-hipify)
- set_target_properties(test-hipify-clang PROPERTIES FOLDER "Tests")
-endif()
diff --git a/hipamd/hipify-clang/README.md b/hipamd/hipify-clang/README.md
deleted file mode 100644
index 8cdeceace0..0000000000
--- a/hipamd/hipify-clang/README.md
+++ /dev/null
@@ -1,507 +0,0 @@
-# HIPIFY
-### Tools to translate CUDA source code into portable HIP C++ automatically
-## Table of Contents
-
-
-
-- [hipify-clang](#clang)
- * [Dependencies](#dependencies)
- * [Usage](#hipify-clang-usage)
- * [Building](#building)
- * [Testing](#testing)
- * [Linux](#linux)
- * [Windows](#windows)
-- [hipify-perl](#perl)
- * [Usage](#hipify-perl-usage)
- * [Building](#hipify-perl-building)
-- [Supported CUDA APIs](#cuda-apis)
-- [Disclaimer](#disclaimer)
-
-
-
-## hipify-clang
-
-`hipify-clang` is a clang-based tool for translation CUDA sources into HIP sources.
-It translates CUDA source into an abstract syntax tree, which is being traversed by transformation matchers.
-After applying all the matchers, the output HIP source is produced.
-
-**Advantages:**
-
-1. It is a translator; thus, any even very complicated constructs will be parsed successfully, or an error will be reported.
-2. It supports clang options like [`-I`](https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-i-dir), [`-D`](https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-d-macro), [`--cuda-path`](https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-cuda-path), etc.
-3. Seamless support of new CUDA versions as it is clang's responsibility.
-4. Ease in support.
-
-**Disadvantages:**
-
-1. The main advantage is also the main disadvantage: the input CUDA code should be correct; incorrect code wouldn't be translated to HIP.
-2. CUDA should be installed and provided in case of multiple installations by `--cuda-path` option.
-3. All the includes and defines should be provided to transform code successfully.
-
-### hipify-clang: dependencies
-
-`hipify-clang` requires:
-
-1. [**LLVM+CLANG**](http://releases.llvm.org) of at least version [3.8.0](http://releases.llvm.org/download.html#3.8.0); the latest stable and recommended release: [**10.0.0**](http://releases.llvm.org/download.html#10.0.0).
-
-2. [**CUDA**](https://developer.nvidia.com/cuda-downloads) of at least version [7.0](https://developer.nvidia.com/cuda-toolkit-70), the latest supported version is [**10.2**](https://developer.nvidia.com/cuda-downloads).
-
-| **LLVM release version** | **CUDA latest supported version** | **Windows** | **Linux** |
-|:----------------------------------------------------------:|:------------------------------------------------------------------------:|:-----------:|:---------:|
-| [3.8.0](http://releases.llvm.org/download.html#3.8.0) | [7.5](https://developer.nvidia.com/cuda-75-downloads-archive) | + | + |
-| [3.8.1](http://releases.llvm.org/download.html#3.8.1) | [7.5](https://developer.nvidia.com/cuda-75-downloads-archive) | + | + |
-| [3.9.0](http://releases.llvm.org/download.html#3.9.0) | [7.5](https://developer.nvidia.com/cuda-75-downloads-archive) | + | + |
-| [3.9.1](http://releases.llvm.org/download.html#3.9.1) | [7.5](https://developer.nvidia.com/cuda-75-downloads-archive) | + | + |
-| [4.0.0](http://releases.llvm.org/download.html#4.0.0) | [8.0](https://developer.nvidia.com/cuda-80-ga2-download-archive) | + | + |
-| [4.0.1](http://releases.llvm.org/download.html#4.0.1) | [8.0](https://developer.nvidia.com/cuda-80-ga2-download-archive) | + | + |
-| [5.0.0](http://releases.llvm.org/download.html#5.0.0) | [8.0](https://developer.nvidia.com/cuda-80-ga2-download-archive) | + | + |
-| [5.0.1](http://releases.llvm.org/download.html#5.0.1) | [8.0](https://developer.nvidia.com/cuda-80-ga2-download-archive) | + | + |
-| [5.0.2](http://releases.llvm.org/download.html#5.0.2) | [8.0](https://developer.nvidia.com/cuda-80-ga2-download-archive) | + | + |
-| [6.0.0](http://releases.llvm.org/download.html#6.0.0) | [9.0](https://developer.nvidia.com/cuda-90-download-archive) | + | + |
-| [6.0.1](http://releases.llvm.org/download.html#6.0.1) | [9.0](https://developer.nvidia.com/cuda-90-download-archive) | + | + |
-| [7.0.0](http://releases.llvm.org/download.html#7.0.0) | [9.2](https://developer.nvidia.com/cuda-92-download-archive) | -
not working due to
the clang's bug [38811](https://bugs.llvm.org/show_bug.cgi?id=38811)
+
[patch](patches/patch_for_clang_7.0.0_bug_38811.zip)* | -
not working due to
the clang's bug [36384](https://bugs.llvm.org/show_bug.cgi?id=36384) |
-| [7.0.1](http://releases.llvm.org/download.html#7.0.1) | [9.2](https://developer.nvidia.com/cuda-92-download-archive) | -
not working due to
the clang's bug [38811](https://bugs.llvm.org/show_bug.cgi?id=38811)
+
[patch](patches/patch_for_clang_7.0.1_bug_38811.zip)* | -
not working due to
the clang's bug [36384](https://bugs.llvm.org/show_bug.cgi?id=36384) |
-| [7.1.0](http://releases.llvm.org/download.html#7.1.0) | [9.2](https://developer.nvidia.com/cuda-92-download-archive) | -
not working due to
the clang's bug [38811](https://bugs.llvm.org/show_bug.cgi?id=38811)
+
[patch](patches/patch_for_clang_7.1.0_bug_38811.zip)* | -
not working due to
the clang's bug [36384](https://bugs.llvm.org/show_bug.cgi?id=36384) |
-| [8.0.0](http://releases.llvm.org/download.html#8.0.0) | [10.0](https://developer.nvidia.com/cuda-10.0-download-archive) | -
not working due to
the clang's bug [38811](https://bugs.llvm.org/show_bug.cgi?id=38811)
+
[patch](patches/patch_for_clang_8.0.0_bug_38811.zip)* | + |
-| [8.0.1](http://releases.llvm.org/download.html#8.0.1) | [10.0](https://developer.nvidia.com/cuda-10.0-download-archive) | -
not working due to
the clang's bug [38811](https://bugs.llvm.org/show_bug.cgi?id=38811)
+
[patch](patches/patch_for_clang_8.0.1_bug_38811.zip)* | + |
-| [9.0.0](http://releases.llvm.org/download.html#9.0.0) | [10.1](https://developer.nvidia.com/cuda-10.1-download-archive-base) | + | + |
-| [9.0.1](http://releases.llvm.org/download.html#9.0.1) | [10.1](https://developer.nvidia.com/cuda-10.1-download-archive-base) | + | + |
-| [**10.0.0**](http://releases.llvm.org/download.html#10.0.0)| [**10.2**](https://developer.nvidia.com/cuda-downloads) | +
**LATEST STABLE RELEASE** | +
**LATEST STABLE RELEASE** |
-
-`*` Download the patch and unpack it into your `LLVM` distributive directory; a few header files will be overwritten; rebuilding of `LLVM` is not needed.
-
-In most cases, you can get a suitable version of `LLVM+CLANG` with your package manager.
-
-Failing that or having multiple versions of `LLVM`, you can [download a release archive](http://releases.llvm.org/), build or install it, and set
-[CMAKE_PREFIX_PATH](https://cmake.org/cmake/help/v3.5/variable/CMAKE_PREFIX_PATH.html) so `cmake` can find it; for instance: `-DCMAKE_PREFIX_PATH=d:\LLVM\10.0.0\dist`
-
-### hipify-clang: usage
-
-To process a file, `hipify-clang` needs access to the same headers that would be required to compile it with clang.
-
-For example:
-
-```shell
-./hipify-clang square.cu --cuda-path=/usr/local/cuda-10.2 -I /usr/local/cuda-10.2/samples/common/inc
-```
-
-`hipify-clang` arguments are given first, followed by a separator `'--'`, and then the arguments you'd pass to `clang` if you
-were compiling the input file. For example:
-
-```bash
-./hipify-clang cpp17.cu --cuda-path=/usr/local/cuda-10.2 -- -std=c++17
-```
-
-The [Clang manual for compiling CUDA](https://llvm.org/docs/CompileCudaWithLLVM.html#compiling-cuda-code) may be useful.
-
-For a list of `hipify-clang` options, run `hipify-clang --help`.
-
-### hipify-clang: building
-
-Assuming this repository is at `./HIP`:
-
-```bash
-cd hipify-clang
-mkdir build dist
-cd build
-
-cmake \
- -DCMAKE_INSTALL_PREFIX=../dist \
- -DCMAKE_BUILD_TYPE=Release \
- ..
-
-make -j install
-```
-On Windows, the following option should be specified for `cmake` at first place: `-G "Visual Studio 16 2019 Win64"`; the generated `hipify-clang.sln` should be built by `Visual Studio 16 2019` instead of `make.`
-Please, see [hipify-clang: Windows](#windows) for the supported tools for building.
-
-Debug build type `-DCMAKE_BUILD_TYPE=Debug` is also supported and tested; `LLVM+CLANG` should be built in `Debug` mode as well.
-64-bit build mode (`-Thost=x64` on Windows) is also supported; `LLVM+CLANG` should be built in 64-bit mode as well.
-
-The binary can then be found at `./dist/bin/hipify-clang`.
-
-### hipify-clang: testing
-
-`hipify-clang` has unit tests using `LLVM` [`lit`](https://llvm.org/docs/CommandGuide/lit.html)/[`FileCheck`](https://llvm.org/docs/CommandGuide/FileCheck.html).
-
-`LLVM+CLANG` should be built from sources, pre-built binaries are not exhaustive for testing.
-
-**LLVM 9.0.1 or older:**
-
-1. download [`LLVM`](http://releases.llvm.org/9.0.1/llvm-9.0.1.src.tar.xz)+[`CLANG`](http://releases.llvm.org/9.0.1/cfe-9.0.1.src.tar.xz) sources;
-2. build [`LLVM+CLANG`](http://releases.llvm.org/9.0.0/docs/CMake.html):
-
- **Linux**:
- ```bash
- cmake \
- -DCMAKE_INSTALL_PREFIX=../dist \
- -DLLVM_SOURCE_DIR=../llvm \
- -DLLVM_TARGETS_TO_BUILD="X86;NVPTX" \
- -DCMAKE_BUILD_TYPE=Release \
- ../llvm
- make -j install
- ```
- **Windows**:
- ```shell
- cmake \
- -G "Visual Studio 16 2019" \
- -A x64 \
- -DCMAKE_INSTALL_PREFIX=../dist \
- -DLLVM_SOURCE_DIR=../llvm \
- -DLLVM_TARGETS_TO_BUILD="NVPTX" \
- -DCMAKE_BUILD_TYPE=Release \
- -Thost=x64 \
- ../llvm
- ```
-Run `Visual Studio 16 2019`, open the generated `LLVM.sln`, build all, build project `INSTALL`.
-
-**LLVM 10.0.0 or newer:**
-
-1. download [`LLVM project`](https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/llvm-project-10.0.0.tar.xz) sources;
-2. build [`LLVM project`](http://llvm.org/docs/CMake.html):
-
- **Linux**:
- ```bash
- cmake \
- -DCMAKE_INSTALL_PREFIX=../dist \
- -DLLVM_SOURCE_DIR=../llvm-project \
- -DLLVM_TARGETS_TO_BUILD="X86;NVPTX" \
- -DLLVM_ENABLE_PROJECTS="clang" \
- -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON
- -DCMAKE_BUILD_TYPE=Release \
- ../llvm-project/llvm
- make -j install
- ```
- **Windows**:
- ```shell
- cmake \
- -G "Visual Studio 16 2019" \
- -A x64 \
- -DCMAKE_INSTALL_PREFIX=../dist \
- -DLLVM_SOURCE_DIR=../llvm-project \
- -DLLVM_TARGETS_TO_BUILD="NVPTX" \
- -DLLVM_ENABLE_PROJECTS="clang" \
- -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON
- -DCMAKE_BUILD_TYPE=Release \
- -Thost=x64 \
- ../llvm-project/llvm
- ```
-Run `Visual Studio 16 2019`, open the generated `LLVM.sln`, build all, build project `INSTALL`.
-
-3. Ensure [`CUDA`](https://developer.nvidia.com/cuda-toolkit-archive) of minimum version 7.0 is installed.
-
- * Having multiple CUDA installations to choose a particular version the `DCUDA_TOOLKIT_ROOT_DIR` option should be specified:
-
- - ***Linux***: `-DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-10.2`
-
- - ***Windows***: `-DCUDA_TOOLKIT_ROOT_DIR="c:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2"`
-
- `-DCUDA_SDK_ROOT_DIR="c:/ProgramData/NVIDIA Corporation/CUDA Samples/v10.2"`
-
-4. Ensure [`cuDNN`](https://developer.nvidia.com/rdp/cudnn-archive) of the version corresponding to CUDA's version is installed.
-
- * Path to cuDNN should be specified by the `CUDA_DNN_ROOT_DIR` option:
-
- - ***Linux***: `-DCUDA_DNN_ROOT_DIR=/srv/CUDNN/cudnn-10.2-v7.6.5.32`
-
- - ***Windows***: `-DCUDA_DNN_ROOT_DIR=d:/CUDNN/cudnn-10.2-windows10-x64-v7.6.5.32`
-
-5. Ensure [`CUB`](https://github.com/NVlabs/cub) of the version corresponding to CUDA's version is installed.
-
- * Path to CUB should be specified by the `CUDA_CUB_ROOT_DIR` option:
-
- - ***Linux***: `-DCUDA_CUB_ROOT_DIR=/srv/git/CUB`
-
- - ***Windows***: `-DCUDA_CUB_ROOT_DIR=d:/GIT/cub`
-
-5. Ensure [`python`](https://www.python.org/downloads) of minimum required version 2.7 is installed.
-
-6. Ensure `lit` and `FileCheck` are installed - these are distributed with `LLVM`.
-
- * Install `lit` into `python`:
-
- - ***Linux***: `python /srv/git/LLVM/10.0.0/llvm/utils/lit/setup.py install`
-
- - ***Windows***: `python d:/LLVM/10.0.0/llvm/utils/lit/setup.py install`
-
- * Starting with LLVM 6.0.1 path to `llvm-lit` python script should be specified by the `LLVM_EXTERNAL_LIT` option:
-
- - ***Linux***: `-DLLVM_EXTERNAL_LIT=/srv/git/LLVM/10.0.0/build/bin/llvm-lit`
-
- - ***Windows***: `-DLLVM_EXTERNAL_LIT=d:/LLVM/10.0.0/build/Release/bin/llvm-lit.py`
-
- * `FileCheck`:
-
- - ***Linux***: copy from `/srv/git/LLVM/10.0.0/build/bin/` to `CMAKE_INSTALL_PREFIX/dist/bin`
-
- - ***Windows***: copy from `d:/LLVM/10.0.0/build/Release/bin` to `CMAKE_INSTALL_PREFIX/dist/bin`
-
- - Or specify the path to `FileCheck` in `CMAKE_INSTALL_PREFIX` option
-
-7. Set `HIPIFY_CLANG_TESTS` option turned on: `-DHIPIFY_CLANG_TESTS=1`.
-
-8. Build and run tests:
-
-### hipify-clang: Linux
-
-On Linux the following configurations are tested:
-
-Ubuntu 14: LLVM 5.0.0 - 6.0.1, CUDA 7.0 - 9.0, cudnn-5.0.5 - cudnn-7.6.5.32
-
-Ubuntu 16-18: LLVM 8.0.0 - 10.0.0, CUDA 8.0 - 10.2, cudnn-5.1.10 - cudnn-7.6.5.32
-
-Minimum build system requirements for the above configurations:
-
-Python 2.7, cmake 3.5.1, GNU C/C++ 5.4.0.
-
-Here is an example of building `hipify-clang` with testing support on `Ubuntu 16.04`:
-
-```bash
-cmake
- -DHIPIFY_CLANG_TESTS=1 \
- -DCMAKE_BUILD_TYPE=Release \
- -DCMAKE_INSTALL_PREFIX=../dist \
- -DCMAKE_PREFIX_PATH=/srv/git/LLVM/10.0.0/dist \
- -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-10.2 \
- -DCUDA_DNN_ROOT_DIR=/srv/CUDNN/cudnn-10.2-v7.6.5.32 \
- -DCUDA_CUB_ROOT_DIR=/srv/git/CUB \
- -DLLVM_EXTERNAL_LIT=/srv/git/LLVM/10.0.0/build/bin/llvm-lit \
- ..
-```
-*A corresponding successful output:*
-```shell
--- The C compiler identification is GNU 7.4.0
--- The CXX compiler identification is GNU 7.4.0
--- Check for working C compiler: /usr/bin/cc
--- Check for working C compiler: /usr/bin/cc -- works
--- Detecting C compiler ABI info
--- Detecting C compiler ABI info - done
--- Detecting C compile features
--- Detecting C compile features - done
--- Check for working CXX compiler: /usr/bin/c++
--- Check for working CXX compiler: /usr/bin/c++ -- works
--- Detecting CXX compiler ABI info
--- Detecting CXX compiler ABI info - done
--- Detecting CXX compile features
--- Detecting CXX compile features - done
--- Found LLVM 10.0.0:
--- - CMake module path: /srv/git/LLVM/10.0.0/dist/lib/cmake/llvm
--- - Include path : /srv/git/LLVM/10.0.0/dist/include
--- - Binary path : /srv/git/LLVM/10.0.0/dist/bin
--- Linker detection: GNU ld
--- Found PythonInterp: /usr/bin/python2.7 (found suitable version "2.7.12", minimum required is "2.7")
--- Found lit: /usr/local/bin/lit
--- Found FileCheck: /srv/git/LLVM/10.0.0/dist/bin/FileCheck
--- Looking for pthread.h
--- Looking for pthread.h - found
--- Looking for pthread_create
--- Looking for pthread_create - not found
--- Looking for pthread_create in pthreads
--- Looking for pthread_create in pthreads - not found
--- Looking for pthread_create in pthread
--- Looking for pthread_create in pthread - found
--- Found Threads: TRUE
--- Found CUDA: /usr/local/cuda-10.2 (found version "10.2")
--- Configuring done
--- Generating done
--- Build files have been written to: /srv/git/HIP/hipify-clang/build
-```
-```shell
-make test-hipify
-```
-*A corresponding successful output:*
-```shell
-Running HIPify regression tests
-========================================
-CUDA 10.2 - will be used for testing
-LLVM 10.0.0 - will be used for testing
-x86_64 - Platform architecture
-Linux 5.2.0 - Platform OS
-64 - hipify-clang binary bitness
-64 - python 2.7.12 binary bitness
-========================================
--- Testing: 69 tests, 12 threads --
-PASS: hipify :: unit_tests/casts/reinterpret_cast.cu (1 of 69)
-PASS: hipify :: unit_tests/device/math_functions.cu (2 of 69)
-PASS: hipify :: unit_tests/device/atomics.cu (3 of 69)
-PASS: hipify :: unit_tests/headers/headers_test_01.cu (4 of 69)
-PASS: hipify :: unit_tests/device/device_symbols.cu (5 of 69)
-PASS: hipify :: unit_tests/headers/headers_test_02.cu (6 of 69)
-PASS: hipify :: unit_tests/headers/headers_test_03.cu (7 of 69)
-PASS: hipify :: unit_tests/headers/headers_test_05.cu (8 of 69)
-PASS: hipify :: unit_tests/headers/headers_test_04.cu (9 of 69)
-PASS: hipify :: unit_tests/headers/headers_test_07.cu (10 of 69)
-PASS: hipify :: unit_tests/headers/headers_test_06.cu (11 of 69)
-PASS: hipify :: unit_tests/headers/headers_test_11.cu (12 of 69)
-PASS: hipify :: unit_tests/headers/headers_test_10.cu (13 of 69)
-PASS: hipify :: unit_tests/headers/headers_test_08.cu (14 of 69)
-PASS: hipify :: unit_tests/kernel_launch/kernel_launch_01.cu (15 of 69)
-PASS: hipify :: unit_tests/libraries/CAFFE2/caffe2_02.cu (16 of 69)
-PASS: hipify :: unit_tests/headers/headers_test_09.cu (17 of 69)
-PASS: hipify :: unit_tests/libraries/CAFFE2/caffe2_01.cu (18 of 69)
-PASS: hipify :: unit_tests/libraries/cuBLAS/cublas_0_based_indexing.cu (19 of 69)
-PASS: hipify :: unit_tests/libraries/cuBLAS/cublas_1_based_indexing.cu (20 of 69)
-PASS: hipify :: unit_tests/libraries/CUB/cub_03.cu (21 of 69)
-PASS: hipify :: unit_tests/libraries/CUB/cub_01.cu (22 of 69)
-PASS: hipify :: unit_tests/libraries/CUB/cub_02.cu (23 of 69)
-PASS: hipify :: unit_tests/libraries/cuBLAS/cublas_sgemm_matrix_multiplication.cu (24 of 69)
-PASS: hipify :: unit_tests/libraries/cuBLAS/rocBLAS/cublas_0_based_indexing_rocblas.cu (25 of 69)
-PASS: hipify :: unit_tests/libraries/cuBLAS/rocBLAS/cublas_1_based_indexing_rocblas.cu (26 of 69)
-PASS: hipify :: unit_tests/libraries/cuBLAS/rocBLAS/cublas_sgemm_matrix_multiplication_rocblas.cu (27 of 69)
-PASS: hipify :: unit_tests/libraries/cuComplex/cuComplex_Julia.cu (28 of 69)
-PASS: hipify :: unit_tests/libraries/cuDNN/cudnn_softmax.cu (29 of 69)
-PASS: hipify :: unit_tests/libraries/cuFFT/simple_cufft.cu (30 of 69)
-PASS: hipify :: unit_tests/libraries/cuDNN/cudnn_convolution_forward.cu (31 of 69)
-PASS: hipify :: unit_tests/libraries/cuRAND/poisson_api_example.cu (32 of 69)
-PASS: hipify :: unit_tests/libraries/cuRAND/benchmark_curand_generate.cpp (33 of 69)
-PASS: hipify :: unit_tests/libraries/cuSPARSE/cuSPARSE_01.cu (34 of 69)
-PASS: hipify :: unit_tests/libraries/cuSPARSE/cuSPARSE_02.cu (35 of 69)
-PASS: hipify :: unit_tests/libraries/cuRAND/benchmark_curand_kernel.cpp (36 of 69)
-PASS: hipify :: unit_tests/libraries/cuSPARSE/cuSPARSE_03.cu (37 of 69)
-PASS: hipify :: unit_tests/libraries/cuSPARSE/cuSPARSE_04.cu (38 of 69)
-PASS: hipify :: unit_tests/libraries/cuSPARSE/cuSPARSE_05.cu (39 of 69)
-PASS: hipify :: unit_tests/libraries/cuSPARSE/cuSPARSE_06.cu (40 of 69)
-PASS: hipify :: unit_tests/libraries/cuSPARSE/cuSPARSE_07.cu (41 of 69)
-PASS: hipify :: unit_tests/libraries/cuSPARSE/cuSPARSE_08.cu (42 of 69)
-PASS: hipify :: unit_tests/libraries/cuSPARSE/cuSPARSE_09.cu (43 of 69)
-PASS: hipify :: unit_tests/libraries/cuSPARSE/cuSPARSE_10.cu (44 of 69)
-PASS: hipify :: unit_tests/libraries/cuSPARSE/cuSPARSE_11.cu (45 of 69)
-PASS: hipify :: unit_tests/namespace/ns_kernel_launch.cu (46 of 69)
-PASS: hipify :: unit_tests/libraries/cuSPARSE/cuSPARSE_12.cu (47 of 69)
-PASS: hipify :: unit_tests/pp/pp_if_else_conditionals.cu (48 of 69)
-PASS: hipify :: unit_tests/pp/pp_if_else_conditionals_01.cu (49 of 69)
-PASS: hipify :: unit_tests/pp/pp_if_else_conditionals_01_LLVM_10.cu (50 of 69)
-PASS: hipify :: unit_tests/pp/pp_if_else_conditionals_LLVM_10.cu (51 of 69)
-PASS: hipify :: unit_tests/samples/2_Cookbook/11_texture_driver/tex2dKernel.cpp (52 of 69)
-PASS: hipify :: unit_tests/samples/2_Cookbook/0_MatrixTranspose/MatrixTranspose.cpp (53 of 69)
-PASS: hipify :: unit_tests/samples/2_Cookbook/11_texture_driver/texture2dDrv.cpp (54 of 69)
-PASS: hipify :: unit_tests/samples/2_Cookbook/1_hipEvent/hipEvent.cpp (55 of 69)
-PASS: hipify :: unit_tests/samples/2_Cookbook/13_occupancy/occupancy.cpp (56 of 69)
-PASS: hipify :: unit_tests/samples/2_Cookbook/2_Profiler/Profiler.cpp (57 of 69)
-PASS: hipify :: unit_tests/samples/MallocManaged.cpp (58 of 69)
-PASS: hipify :: unit_tests/samples/2_Cookbook/7_streams/stream.cpp (59 of 69)
-PASS: hipify :: unit_tests/samples/2_Cookbook/8_peer2peer/peer2peer.cpp (60 of 69)
-PASS: hipify :: unit_tests/samples/allocators.cu (61 of 69)
-PASS: hipify :: unit_tests/samples/coalescing.cu (62 of 69)
-PASS: hipify :: unit_tests/samples/axpy.cu (63 of 69)
-PASS: hipify :: unit_tests/samples/dynamic_shared_memory.cu (64 of 69)
-PASS: hipify :: unit_tests/samples/cudaRegister.cu (65 of 69)
-PASS: hipify :: unit_tests/samples/intro.cu (66 of 69)
-PASS: hipify :: unit_tests/samples/square.cu (67 of 69)
-PASS: hipify :: unit_tests/samples/static_shared_memory.cu (68 of 69)
-PASS: hipify :: unit_tests/samples/vec_add.cu (69 of 69)
-Testing Time: 3.23s
- Expected Passes : 69
-[100%] Built target test-hipify
-```
-### hipify-clang: Windows
-
-*Tested configurations:*
-
-| **LLVM** | **CUDA** | **cuDNN** | **Visual Studio** | **cmake** | **Python** |
-|:--------------:|---------:|--------------------:|--------------------------:|----------:|-----------:|
-| 5.0.0 - 5.0.2 | 8.0 | 5.1.10 - 7.1.4.18 | 2017.15.5.2 | 3.5.1 | 3.6.4 |
-| 6.0.0 - 6.0.1 | 9.0 | 7.0.5.15 - 7.6.5.32 | 2017.15.5.5 | 3.6.0 | 3.7.2 |
-| 7.0.0 - 7.1.0 | 9.2 | 7.6.5.32 | 2017.15.9.11 | 3.13.3 | 3.7.3 |
-| 8.0.0 - 8.0.1 | 10.0 | 7.6.5.32 | 2017.15.9.15 | 3.14.2 | 3.7.4 |
-| 9.0.0 - 9.0.1 | 10.1 | 7.6.5.32 | 2017.15.9.20, 2019.16.4.5 | 3.16.4 | 3.8.0 |
-| 10.0.0 | 10.2 | 7.6.5.32 | 2017.15.9.21, 2019.16.5.1 | 3.17.0 | 3.8.2 |
-| 11.0.0git | 10.2 | 7.6.5.32 | 2017.15.9.21, 2019.16.5.1 | 3.17.0 | 3.8.2 |
-
-*Building with testing support on `Windows 10` by `Visual Studio 16 2019`:*
-
-```shell
-cmake
- -G "Visual Studio 16 2019" \
- -A x64 \
- -DHIPIFY_CLANG_TESTS=1 \
- -DCMAKE_BUILD_TYPE=Release \
- -DCMAKE_INSTALL_PREFIX=../dist \
- -DCMAKE_PREFIX_PATH=d:/LLVM/10.0.0/dist \
- -DCUDA_TOOLKIT_ROOT_DIR="c:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2" \
- -DCUDA_SDK_ROOT_DIR="c:/ProgramData/NVIDIA Corporation/CUDA Samples/v10.2" \
- -DCUDA_DNN_ROOT_DIR=d:/CUDNN/cudnn-10.2-windows10-x64-v7.6.5.32 \
- -DCUDA_CUB_ROOT_DIR=d:/GIT/cub \
- -DLLVM_EXTERNAL_LIT=d:/LLVM/10.0.0/build/Release/bin/llvm-lit.py \
- -Thost=x64
- ..
-```
-*A corresponding successful output:*
-```shell
--- Found LLVM 10.0.0:
--- - CMake module path: d:/LLVM/10.0.0/dist/lib/cmake/llvm
--- - Include path : d:/LLVM/10.0.0/dist/include
--- - Binary path : d:/LLVM/10.0.0/dist/bin
--- Found PythonInterp: c:/Program Files/Python38/python.exe (found suitable version "3.8.2", minimum required is "3.6")
--- Found lit: c:/Program Files/Python38/Scripts/lit.exe
--- Found FileCheck: d:/LLVM/10.0.0/dist/bin/FileCheck.exe
--- Found CUDA: c:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2 (found version "10.2")
--- Configuring done
--- Generating done
--- Build files have been written to: d:/HIP/hipify-clang/build
-```
-
-Run `Visual Studio 16 2019`, open the generated `hipify-clang.sln`, build project `test-hipify`.
-
-## hipify-perl
-
-`hipify-perl` is autogenerated perl-based script which heavily uses regular expressions.
-
-**Advantages:**
-
-1. Ease in use.
-
-2. It doesn't check the input source CUDA code for correctness.
-
-3. It doesn't have dependencies on 3rd party tools, including CUDA.
-
-**Disadvantages:**
-
-1. Current disability (and difficulty in implementing) of transforming the following constructs:
-
- * macros expansion;
-
- * namespaces:
-
- - redefines of CUDA entities in user namespaces;
-
- - using directive;
-
- * templates (some cases);
-
- * device/host function calls distinguishing;
-
- * header files correct injection;
-
- * complicated argument lists parsing.
-
-2. Difficulties in supporting.
-
-### hipify-perl: usage
-
-```shell
-perl hipify-perl square.cu > square.cu.hip
-```
-
-### hipify-perl: building
-
-To generate `hipify-perl`, run `hipify-clang --perl`. Output directory for the generated `hipify-perl` file might be specified by `--o-hipify-perl-dir` option.
-
-## Supported CUDA APIs
-
-- [Runtime API](../docs/markdown/CUDA_Runtime_API_functions_supported_by_HIP.md)
-- [Driver API](../docs/markdown/CUDA_Driver_API_functions_supported_by_HIP.md)
-- [cuComplex API](../docs/markdown/cuComplex_API_supported_by_HIP.md)
-- [cuBLAS](../docs/markdown/CUBLAS_API_supported_by_HIP.md)
-- [cuRAND](../docs/markdown/CURAND_API_supported_by_HIP.md)
-- [cuDNN](../docs/markdown/CUDNN_API_supported_by_HIP.md)
-- [cuFFT](../docs/markdown/CUFFT_API_supported_by_HIP.md)
-- [cuSPARSE](../docs/markdown/CUSPARSE_API_supported_by_HIP.md)
-
-## Disclaimer
-
-The information contained herein is for informational purposes only, and is subject to change without notice. While every precaution has been taken in the preparation of this document, it may contain technical inaccuracies, omissions and typographical errors, and AMD is under no obligation to update or otherwise correct this information. Advanced Micro Devices, Inc. makes no representations or warranties with respect to the accuracy or completeness of the contents of this document, and assumes no liability of any kind, including the implied warranties of noninfringement, merchantability or fitness for particular purposes, with respect to the operation or use of AMD hardware, software or other products described herein. No license, including implied or arising by estoppel, to any intellectual property rights is granted by this document. Terms and limitations applicable to the purchase or use of AMD's products are as set forth in a signed agreement between the parties or in AMD's Standard Terms and Conditions of Sale.
-
-AMD, the AMD Arrow logo, and combinations thereof are trademarks of Advanced Micro Devices, Inc. Other product names used in this publication are for identification purposes only and may be trademarks of their respective companies.
-
-Copyright (c) 2014-2020 Advanced Micro Devices, Inc. All rights reserved.
diff --git a/hipamd/hipify-clang/packaging/hipify-clang.txt b/hipamd/hipify-clang/packaging/hipify-clang.txt
deleted file mode 100644
index b189eff1e6..0000000000
--- a/hipamd/hipify-clang/packaging/hipify-clang.txt
+++ /dev/null
@@ -1,58 +0,0 @@
-cmake_minimum_required(VERSION 2.8.3)
-project(hipify-clang)
-
-install(PROGRAMS @HIPIFY_INSTALL_PATH@/hipify-clang DESTINATION bin)
-install(DIRECTORY @HIPIFY_INSTALL_PATH@/include DESTINATION bin)
-
-# Check if .hipversion exists(only exists when hipify-clang is built with HIP)
-if(EXISTS "@HIPIFY_INSTALL_PATH@/.hipVersion")
- set(HIP_BUILD "TRUE")
-else()
- set(HIP_BUILD "FALSE")
-endif()
-
-if(${HIP_BUILD})
- file(STRINGS @HIPIFY_INSTALL_PATH@/.hipVersion HipVersion)
- foreach(NameAndValue ${HipVersion})
- # Get variable name
- string(REGEX MATCH "^[^=]+" Name ${NameAndValue})
- # Get the value
- string(REPLACE "${Name}=" "" Value ${NameAndValue})
- # Assign the vale to the variable
- set(${Name} "${Value}")
- endforeach()
-endif()
-
-#############################
-# Packaging steps
-#############################
-set(CPACK_SET_DESTDIR TRUE)
-set(CPACK_INSTALL_PREFIX "/opt/rocm/hip")
-set(CPACK_PACKAGE_NAME "hipify-clang")
-set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "hipify-clang: a clang-based tool to translate CUDA source code into portable HIP C++ automatically")
-set(CPACK_PACKAGE_VENDOR "Advanced Micro Devices, Inc.")
-set(CPACK_PACKAGE_CONTACT "Mankov Evgeny ")
-
-if(${HIP_BUILD})
- set(CPACK_PACKAGE_VERSION ${HIP_VERSION_MAJOR}.${HIP_VERSION_MINOR}.${HIP_VERSION_PATCH})
- set(CPACK_PACKAGE_VERSION_MAJOR ${HIP_VERSION_MAJOR})
- set(CPACK_PACKAGE_VERSION_MINOR ${HIP_VERSION_MINOR})
- set(CPACK_PACKAGE_VERSION_PATCH ${HIP_VERSION_PATCH})
-else()
- set(CPACK_PACKAGE_VERSION @LLVM_VERSION_MAJOR@.@LLVM_VERSION_MINOR@.@LLVM_VERSION_PATCH@)
- set(CPACK_PACKAGE_VERSION_MAJOR @LLVM_VERSION_MAJOR@)
- set(CPACK_PACKAGE_VERSION_MINOR @LLVM_VERSION_MINOR@)
- set(CPACK_PACKAGE_VERSION_PATCH @LLVM_VERSION_PATCH@)
-endif()
-
-set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
-set(CPACK_GENERATOR "TGZ;DEB;RPM")
-set(CPACK_BINARY_DEB "ON")
-set(CPACK_DEBIAN_PACKAGE_DEPENDS "cuda (>= 7.0)")
-set(CPACK_BINARY_RPM "ON")
-set(CPACK_RPM_PACKAGE_ARCHITECTURE "${CMAKE_SYSTEM_PROCESSOR}")
-set(CPACK_RPM_PACKAGE_AUTOREQPROV "NO")
-set(CPACK_RPM_PACKAGE_REQUIRES "cuda >= 7.0")
-set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/opt")
-set(CPACK_SOURCE_GENERATOR "TGZ")
-include(CPack)
diff --git a/hipamd/hipify-clang/patches/patch_for_clang_7.0.0_bug_38811.zip b/hipamd/hipify-clang/patches/patch_for_clang_7.0.0_bug_38811.zip
deleted file mode 100644
index 28205a2645..0000000000
Binary files a/hipamd/hipify-clang/patches/patch_for_clang_7.0.0_bug_38811.zip and /dev/null differ
diff --git a/hipamd/hipify-clang/patches/patch_for_clang_7.0.1_bug_38811.zip b/hipamd/hipify-clang/patches/patch_for_clang_7.0.1_bug_38811.zip
deleted file mode 100644
index fca5bf52e3..0000000000
Binary files a/hipamd/hipify-clang/patches/patch_for_clang_7.0.1_bug_38811.zip and /dev/null differ
diff --git a/hipamd/hipify-clang/patches/patch_for_clang_7.1.0_bug_38811.zip b/hipamd/hipify-clang/patches/patch_for_clang_7.1.0_bug_38811.zip
deleted file mode 100644
index 35bde0cce4..0000000000
Binary files a/hipamd/hipify-clang/patches/patch_for_clang_7.1.0_bug_38811.zip and /dev/null differ
diff --git a/hipamd/hipify-clang/patches/patch_for_clang_8.0.0_bug_38811.zip b/hipamd/hipify-clang/patches/patch_for_clang_8.0.0_bug_38811.zip
deleted file mode 100644
index be1cea6a03..0000000000
Binary files a/hipamd/hipify-clang/patches/patch_for_clang_8.0.0_bug_38811.zip and /dev/null differ
diff --git a/hipamd/hipify-clang/patches/patch_for_clang_8.0.1_bug_38811.zip b/hipamd/hipify-clang/patches/patch_for_clang_8.0.1_bug_38811.zip
deleted file mode 100644
index 16d66a2062..0000000000
Binary files a/hipamd/hipify-clang/patches/patch_for_clang_8.0.1_bug_38811.zip and /dev/null differ
diff --git a/hipamd/hipify-clang/src/ArgParse.cpp b/hipamd/hipify-clang/src/ArgParse.cpp
deleted file mode 100644
index cbf2f941e8..0000000000
--- a/hipamd/hipify-clang/src/ArgParse.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
-Copyright (c) 2015 - present Advanced Micro Devices, Inc. All rights reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-*/
-
-#include "ArgParse.h"
-
-cl::OptionCategory ToolTemplateCategory("CUDA to HIP source translator options");
-
-cl::opt OutputFilename("o",
- cl::desc("Output filename"),
- cl::value_desc("filename"),
- cl::cat(ToolTemplateCategory));
-
-cl::opt OutputDir("o-dir",
- cl::desc("Output directory"),
- cl::value_desc("directory"),
- cl::cat(ToolTemplateCategory));
-
-cl::opt GeneratePerl("perl",
- cl::desc("Generate hipify-perl"),
- cl::value_desc("perl"),
- cl::cat(ToolTemplateCategory));
-
-cl::opt GeneratePython("python",
- cl::desc("Generate hipify-python"),
- cl::value_desc("python"),
- cl::cat(ToolTemplateCategory));
-
-cl::opt OutputHipifyPerlDir("o-hipify-perl-dir",
- cl::desc("Output directory for hipify-perl script"),
- cl::value_desc("directory"),
- cl::cat(ToolTemplateCategory));
-
-cl::opt OutputPythonMapDir("o-python-map-dir",
- cl::desc("Output directory for Python map"),
- cl::value_desc("directory"),
- cl::cat(ToolTemplateCategory));
-
-cl::opt TemporaryDir("temp-dir",
- cl::desc("Temporary directory"),
- cl::value_desc("directory"),
- cl::cat(ToolTemplateCategory));
-
-cl::opt CudaPath("cuda-path",
- cl::desc("CUDA installation path"),
- cl::value_desc("directory"),
- cl::cat(ToolTemplateCategory));
-
-cl::opt SaveTemps("save-temps",
- cl::desc("Save temporary files"),
- cl::value_desc("save-temps"),
- cl::cat(ToolTemplateCategory));
-
-cl::opt Verbose("v",
- cl::desc("Show commands to run and use verbose output"),
- cl::value_desc("v"),
- cl::cat(ToolTemplateCategory));
-
-cl::opt TranslateToRoc("roc",
- cl::desc("Translate to roc instead of hip where it is possible"),
- cl::value_desc("roc"),
- cl::cat(ToolTemplateCategory));
-
-cl::opt Inplace("inplace",
- cl::desc("Modify input file inplace, replacing input with hipified output, save backup in .prehip file"),
- cl::value_desc("inplace"),
- cl::cat(ToolTemplateCategory));
-
-cl::opt NoBackup("no-backup",
- cl::desc("Don't create a backup file for the hipified source"),
- cl::value_desc("no-backup"),
- cl::cat(ToolTemplateCategory));
-
-cl::opt NoOutput("no-output",
- cl::desc("Don't write any translated output to stdout"),
- cl::value_desc("no-output"),
- cl::cat(ToolTemplateCategory));
-
-cl::opt PrintStats("print-stats",
- cl::desc("Print translation statistics"),
- cl::value_desc("print-stats"),
- cl::cat(ToolTemplateCategory));
-
-cl::opt PrintStatsCSV("print-stats-csv",
- cl::desc("Print translation statistics in CSV file"),
- cl::value_desc("print-stats-csv"),
- cl::cat(ToolTemplateCategory));
-
-cl::opt OutputStatsFilename("o-stats",
- cl::desc("Output filename for statistics"),
- cl::value_desc("filename"),
- cl::cat(ToolTemplateCategory));
-
-cl::opt Examine("examine",
- cl::desc("Combines -no-output and -print-stats options"),
- cl::value_desc("examine"),
- cl::cat(ToolTemplateCategory));
-
-cl::opt DashDash(" ",
- cl::desc("Separator between hipify-clang and clang options;\ndon't specify if there are no clang options"),
- cl::ValueDisallowed,
- cl::cat(ToolTemplateCategory));
-
-cl::list IncludeDirs("I",
- cl::desc("Add directory to include search path"),
- cl::value_desc("directory"),
- cl::ZeroOrMore,
- cl::Prefix,
- cl::cat(ToolTemplateCategory));
-
-cl::list MacroNames("D",
- cl::desc("Define to or 1 if omitted"),
- cl::value_desc("macro>= SkipExcludedPPConditionalBlocks("skip-excluded-preprocessor-conditional-blocks",
- cl::desc("Enable default preprocessor behaviour by skipping undefined conditional blocks"),
- cl::value_desc("skip-excluded-preprocessor-conditional-blocks"),
- cl::cat(ToolTemplateCategory));
-
-cl::opt CudaGpuArch("cuda-gpu-arch",
- cl::desc("CUDA GPU architecture (e.g. sm_35);\nmay be specified more than once"),
- cl::value_desc("value"),
- cl::ZeroOrMore,
- cl::Prefix,
- cl::cat(ToolTemplateCategory));
-
-
-cl::extrahelp CommonHelp(ct::CommonOptionsParser::HelpMessage);
diff --git a/hipamd/hipify-clang/src/ArgParse.h b/hipamd/hipify-clang/src/ArgParse.h
deleted file mode 100644
index 84053a036c..0000000000
--- a/hipamd/hipify-clang/src/ArgParse.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-Copyright (c) 2015 - present Advanced Micro Devices, Inc. All rights reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-*/
-
-#pragma once
-
-#include "clang/Tooling/CommonOptionsParser.h"
-#include "llvm/Support/CommandLine.h"
-
-namespace cl = llvm::cl;
-namespace ct = clang::tooling;
-
-extern cl::OptionCategory ToolTemplateCategory;
-extern cl::opt OutputFilename;
-extern cl::opt OutputHipifyPerlDir;
-extern cl::opt OutputPythonMapDir;
-extern cl::opt OutputDir;
-extern cl::opt TemporaryDir;
-extern cl::opt CudaPath;
-extern cl::list IncludeDirs;
-extern cl::list MacroNames;
-extern cl::opt Inplace;
-extern cl::opt SaveTemps;
-extern cl::opt GeneratePerl;
-extern cl::opt GeneratePython;
-extern cl::opt Verbose;
-extern cl::opt NoBackup;
-extern cl::opt NoOutput;
-extern cl::opt PrintStats;
-extern cl::opt PrintStatsCSV;
-extern cl::opt OutputStatsFilename;
-extern cl::opt Examine;
-extern cl::extrahelp CommonHelp;
-extern cl::opt TranslateToRoc;
-extern cl::opt DashDash;
-extern cl::opt SkipExcludedPPConditionalBlocks;
-extern cl::opt CudaGpuArch;
diff --git a/hipamd/hipify-clang/src/CUDA2HIP.cpp b/hipamd/hipify-clang/src/CUDA2HIP.cpp
deleted file mode 100644
index 50f4682af2..0000000000
--- a/hipamd/hipify-clang/src/CUDA2HIP.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
-Copyright (c) 2015 - present Advanced Micro Devices, Inc. All rights reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-*/
-
-#include "CUDA2HIP.h"
-
-// Maps CUDA header names to HIP header names
-const std::map CUDA_INCLUDE_MAP{
- // CUDA includes
- {"cuda.h", {"hip/hip_runtime.h", "", CONV_INCLUDE_CUDA_MAIN_H, API_DRIVER}},
- {"cuda_runtime.h", {"hip/hip_runtime.h", "", CONV_INCLUDE_CUDA_MAIN_H, API_RUNTIME}},
- {"cuda_runtime_api.h", {"hip/hip_runtime_api.h", "", CONV_INCLUDE, API_RUNTIME}},
- {"channel_descriptor.h", {"hip/channel_descriptor.h", "", CONV_INCLUDE, API_RUNTIME}},
- {"device_functions.h", {"hip/device_functions.h", "", CONV_INCLUDE, API_RUNTIME}},
- {"driver_types.h", {"hip/driver_types.h", "", CONV_INCLUDE, API_RUNTIME}},
- {"cuda_fp16.h", {"hip/hip_fp16.h", "", CONV_INCLUDE, API_RUNTIME}},
- {"cuda_texture_types.h", {"hip/hip_texture_types.h", "", CONV_INCLUDE, API_RUNTIME}},
- {"texture_fetch_functions.h", {"", "", CONV_INCLUDE, API_RUNTIME}},
- {"vector_types.h", {"hip/hip_vector_types.h", "", CONV_INCLUDE, API_RUNTIME}},
- {"cuda_profiler_api.h", {"hip/hip_profile.h", "", CONV_INCLUDE, API_RUNTIME}},
- {"cooperative_groups.h", {"hip/hip_cooperative_groups.h", "", CONV_INCLUDE, API_RUNTIME}},
- // cuComplex includes
- {"cuComplex.h", {"hip/hip_complex.h", "", CONV_INCLUDE_CUDA_MAIN_H, API_COMPLEX}},
- // cuBLAS includes
- {"cublas.h", {"hipblas.h", "rocblas.h", CONV_INCLUDE_CUDA_MAIN_H, API_BLAS}},
- {"cublas_v2.h", {"hipblas.h", "rocblas.h", CONV_INCLUDE_CUDA_MAIN_H, API_BLAS}},
- // cuRAND includes
- {"curand.h", {"hiprand.h", "", CONV_INCLUDE_CUDA_MAIN_H, API_RAND}},
- {"curand_kernel.h", {"hiprand_kernel.h", "", CONV_INCLUDE, API_RAND}},
- {"curand_discrete.h", {"hiprand_kernel.h", "", CONV_INCLUDE, API_RAND}},
- {"curand_discrete2.h", {"hiprand_kernel.h", "", CONV_INCLUDE, API_RAND}},
- {"curand_globals.h", {"hiprand_kernel.h", "", CONV_INCLUDE, API_RAND}},
- {"curand_lognormal.h", {"hiprand_kernel.h", "", CONV_INCLUDE, API_RAND}},
- {"curand_mrg32k3a.h", {"hiprand_kernel.h", "", CONV_INCLUDE, API_RAND}},
- {"curand_mtgp32.h", {"hiprand_kernel.h", "", CONV_INCLUDE, API_RAND}},
- {"curand_mtgp32_host.h", {"hiprand_mtgp32_host.h", "", CONV_INCLUDE, API_RAND}},
- {"curand_mtgp32_kernel.h", {"hiprand_kernel.h", "", CONV_INCLUDE, API_RAND}},
- {"curand_mtgp32dc_p_11213.h", {"rocrand_mtgp32_11213.h", "", CONV_INCLUDE, API_RAND}},
- {"curand_normal.h", {"hiprand_kernel.h", "", CONV_INCLUDE, API_RAND}},
- {"curand_normal_static.h", {"hiprand_kernel.h", "", CONV_INCLUDE, API_RAND}},
- {"curand_philox4x32_x.h", {"hiprand_kernel.h", "", CONV_INCLUDE, API_RAND}},
- {"curand_poisson.h", {"hiprand_kernel.h", "", CONV_INCLUDE, API_RAND}},
- {"curand_precalc.h", {"hiprand_kernel.h", "", CONV_INCLUDE, API_RAND}},
- {"curand_uniform.h", {"hiprand_kernel.h", "", CONV_INCLUDE, API_RAND}},
- // cuDNN includes
- {"cudnn.h", {"hipDNN.h", "", CONV_INCLUDE_CUDA_MAIN_H, API_DNN}},
- // cuFFT includes
- {"cufft.h", {"hipfft.h", "", CONV_INCLUDE_CUDA_MAIN_H, API_FFT}},
- // cuSPARSE includes
- {"cusparse.h", {"hipsparse.h", "", CONV_INCLUDE_CUDA_MAIN_H, API_SPARSE}},
- {"cusparse_v2.h", {"hipsparse.h", "", CONV_INCLUDE_CUDA_MAIN_H, API_SPARSE}},
- // CUB includes
- {"cub/cub.cuh", {"hipcub/hipcub.hpp", "", CONV_INCLUDE_CUDA_MAIN_H, API_CUB}},
- // CAFFE2 includes
- {"caffe2/core/common_gpu.h", {"caffe2/core/hip/common_gpu.h", "", CONV_INCLUDE, API_CAFFE2, UNSUPPORTED}},
- {"caffe2/core/context_gpu.h", {"caffe2/core/hip/context_gpu.h", "", CONV_INCLUDE, API_CAFFE2, UNSUPPORTED}},
- {"caffe2/operators/operator_fallback_gpu.h", {"", "", CONV_INCLUDE, API_CAFFE2, UNSUPPORTED}},
- {"caffe2/operators/spatial_batch_norm_op.h", {"caffe2/operators/hip/spatial_batch_norm_op_miopen.hip", "", CONV_INCLUDE, API_CAFFE2}},
- {"caffe2/operators/generate_proposals_op_util_nms_gpu.h", {"", "", CONV_INCLUDE, API_CAFFE2, UNSUPPORTED}},
- {"caffe2/operators/max_pool_with_index_gpu.h", {"", "", CONV_INCLUDE, API_CAFFE2, UNSUPPORTED}},
- {"caffe2/operators/rnn/recurrent_network_executor_gpu.h", {"", "", CONV_INCLUDE, API_CAFFE2, UNSUPPORTED}},
- {"caffe2/utils/math/reduce.cuh", {"caffe2/utils/math/hip/reduce.cuh", "", CONV_INCLUDE, API_CAFFE2, UNSUPPORTED}},
- {"caffe2/operators/gather_op.cuh", {"caffe2/operators/math/gather_op.cuh", "", CONV_INCLUDE, API_CAFFE2, UNSUPPORTED}},
- {"caffe2/core/common_cudnn.h", {"caffe2/core/hip/common_miopen.h", "", CONV_INCLUDE, API_CAFFE2}},
-};
-
-const std::map& CUDA_RENAMES_MAP() {
- static std::map ret;
- if (!ret.empty()) {
- return ret;
- }
- // First run, so compute the union map.
- ret.insert(CUDA_DRIVER_TYPE_NAME_MAP.begin(), CUDA_DRIVER_TYPE_NAME_MAP.end());
- ret.insert(CUDA_DRIVER_FUNCTION_MAP.begin(), CUDA_DRIVER_FUNCTION_MAP.end());
- ret.insert(CUDA_RUNTIME_TYPE_NAME_MAP.begin(), CUDA_RUNTIME_TYPE_NAME_MAP.end());
- ret.insert(CUDA_RUNTIME_FUNCTION_MAP.begin(), CUDA_RUNTIME_FUNCTION_MAP.end());
- ret.insert(CUDA_COMPLEX_TYPE_NAME_MAP.begin(), CUDA_COMPLEX_TYPE_NAME_MAP.end());
- ret.insert(CUDA_COMPLEX_FUNCTION_MAP.begin(), CUDA_COMPLEX_FUNCTION_MAP.end());
- ret.insert(CUDA_BLAS_TYPE_NAME_MAP.begin(), CUDA_BLAS_TYPE_NAME_MAP.end());
- ret.insert(CUDA_BLAS_FUNCTION_MAP.begin(), CUDA_BLAS_FUNCTION_MAP.end());
- ret.insert(CUDA_RAND_TYPE_NAME_MAP.begin(), CUDA_RAND_TYPE_NAME_MAP.end());
- ret.insert(CUDA_RAND_FUNCTION_MAP.begin(), CUDA_RAND_FUNCTION_MAP.end());
- ret.insert(CUDA_DNN_TYPE_NAME_MAP.begin(), CUDA_DNN_TYPE_NAME_MAP.end());
- ret.insert(CUDA_DNN_FUNCTION_MAP.begin(), CUDA_DNN_FUNCTION_MAP.end());
- ret.insert(CUDA_FFT_TYPE_NAME_MAP.begin(), CUDA_FFT_TYPE_NAME_MAP.end());
- ret.insert(CUDA_FFT_FUNCTION_MAP.begin(), CUDA_FFT_FUNCTION_MAP.end());
- ret.insert(CUDA_SPARSE_TYPE_NAME_MAP.begin(), CUDA_SPARSE_TYPE_NAME_MAP.end());
- ret.insert(CUDA_SPARSE_FUNCTION_MAP.begin(), CUDA_SPARSE_FUNCTION_MAP.end());
- ret.insert(CUDA_CAFFE2_TYPE_NAME_MAP.begin(), CUDA_CAFFE2_TYPE_NAME_MAP.end());
- ret.insert(CUDA_CAFFE2_FUNCTION_MAP.begin(), CUDA_CAFFE2_FUNCTION_MAP.end());
- return ret;
-};
diff --git a/hipamd/hipify-clang/src/CUDA2HIP.h b/hipamd/hipify-clang/src/CUDA2HIP.h
deleted file mode 100644
index b02e7f1f3e..0000000000
--- a/hipamd/hipify-clang/src/CUDA2HIP.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
-Copyright (c) 2015 - present Advanced Micro Devices, Inc. All rights reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-*/
-
-#pragma once
-
-#include "llvm/ADT/StringRef.h"
-#include
-#include