Skip to content

Commit

Permalink
merge promotion/amd-mainline-open/2022.07.02 into amd-mainline
Browse files Browse the repository at this point in the history
For Bulk Promotion for ROCm 5.3

Merge remote-tracking branch 'gerritgit/promotion/amd-mainline/2022.07.02' into HEAD

Change-Id: Ia63984d47eca1b9615c3f4b783b8e86effc88338
  • Loading branch information
David Salinas authored and David Salinas committed Jul 28, 2022
2 parents 61e348b + 0059e9c commit 2ab347f
Show file tree
Hide file tree
Showing 60 changed files with 1,633 additions and 359 deletions.
14 changes: 1 addition & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.16.8)

project(hipify-clang)

include(GNUInstallDirs)
find_package(LLVM REQUIRED CONFIG PATHS ${CMAKE_PREFIX_PATH})

message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}:")
Expand Down Expand Up @@ -127,19 +128,6 @@ if(UNIX)
include(hipify-backward-compat.cmake)
endif()
set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/rocm" CACHE PATH "HIP Package Installation Path")
#TODO: To be removed
#In jenkins and docker build , hipify need to be installed in /opt/rocm.
#Currently build script passes /opt/rocm/hip as install path
#Workaround for removing same, till prototype changes are merged
if(CPACK_PACKAGING_INSTALL_PREFIX)
string(FIND ${CPACK_PACKAGING_INSTALL_PREFIX} "/opt/rocm" ROCMDIR_FOUND)
if(NOT ${ROCMDIR_FOUND} MATCHES "-1")
get_filename_component(DEST_DIR ${CPACK_PACKAGING_INSTALL_PREFIX} NAME)
if(DEST_DIR STREQUAL "hip")
get_filename_component(CPACK_PACKAGING_INSTALL_PREFIX ${CPACK_PACKAGING_INSTALL_PREFIX} DIRECTORY)
endif()#end of DEST_DIR check
endif()#end of rocm dir check
endif()
set(BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/packages/hipify-clang)
configure_file(packaging/hipify-clang.txt ${BUILD_DIR}/CMakeLists.txt @ONLY)
configure_file(${CMAKE_SOURCE_DIR}/LICENSE.txt ${BUILD_DIR}/LICENSE.txt @ONLY)
Expand Down
289 changes: 150 additions & 139 deletions README.md

Large diffs are not rendered by default.

145 changes: 99 additions & 46 deletions bin/hipify-perl

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions doc/markdown/CUB_API_supported_by_HIP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# CUB API supported by HIP

## **1. CUB Data types**

|**CUDA**|**A**|**D**|**R**|**HIP**|**A**|**D**|**R**|**E**|
|:--|:-:|:-:|:-:|:--|:-:|:-:|:-:|:-:|
|`CUB_CPP_DIALECT`| | | | | | | | |
|`CUB_INCLUDE_DEVICE_CODE`| | | | | | | | |
|`CUB_INCLUDE_HOST_CODE`| | | | | | | | |
|`CUB_IS_DEVICE_CODE`| | | | | | | | |
|`CUB_IS_HOST_CODE`| | | | | | | | |
|`CUB_LOG_SMEM_BANKS`| | | | | | | | |
|`CUB_LOG_WARP_THREADS`| | | | | | | | |
|`CUB_MAX`| | | |`CUB_MAX`| | | | |
|`CUB_MAX_DEVICES`| | | | | | | | |
|`CUB_MIN`| | | |`CUB_MIN`|2.5.0| | | |
|`CUB_NAMESPACE_BEGIN`| | | |`BEGIN_HIPCUB_NAMESPACE`|2.5.0| | | |
|`CUB_NAMESPACE_END`| | | |`END_HIPCUB_NAMESPACE`|2.5.0| | | |
|`CUB_PREFER_CONFLICT_OVER_PADDING`| | | | | | | | |
|`CUB_PTX_ARCH`| | | |`HIPCUB_ARCH`|2.5.0| | | |
|`CUB_PTX_LOG_SMEM_BANKS`| | | | | | | | |
|`CUB_PTX_LOG_WARP_THREADS`| | | | | | | | |
|`CUB_PTX_PREFER_CONFLICT_OVER_PADDING`| | | | | | | | |
|`CUB_PTX_SMEM_BANKS`| | | | | | | | |
|`CUB_PTX_SUBSCRIPTION_FACTOR`| | | | | | | | |
|`CUB_PTX_WARP_THREADS`| | | |`HIPCUB_WARP_THREADS`|2.5.0| | | |
|`CUB_RUNTIME_ENABLED`| | | | | | | | |
|`CUB_RUNTIME_FUNCTION`| | | |`HIPCUB_RUNTIME_FUNCTION`|2.5.0| | | |
|`CUB_SMEM_BANKS`| | | | | | | | |
|`CUB_STDERR`| | | |`HIPCUB_STDERR`|2.5.0| | | |
|`CUB_SUBSCRIPTION_FACTOR`| | | | | | | | |
|`CUB_USE_COOPERATIVE_GROUPS`| | | | | | | | |
|`CubDebug`| | | |`HipcubDebug`|2.5.0| | | |
|`CubDebugExit`| | | | | | | | |
|`_CubLog`| | | |`_HipcubLog`|2.5.0| | | |


\*A - Added; D - Deprecated; R - Removed; E - Experimental
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,7 @@ Unsupported
|`libraryPropertyType`|8.0| | | | | | | |
|`libraryPropertyType_t`|8.0| | | | | | | |
|`surfaceReference`| | | |`surfaceReference`|1.9.0| | | |
|`textureReference`| | | |`textureReference`|1.6.0| | | |

## **37. Execution Control [REMOVED]**

Expand Down
12 changes: 6 additions & 6 deletions doc/markdown/CUSPARSE_API_supported_by_HIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@
|`cusparseCooAoSGet`|10.2|11.2| |`hipsparseCooAoSGet`|4.1.0| | | |
|`cusparseCooGet`|10.1| | |`hipsparseCooGet`|4.1.0| | | |
|`cusparseCooSetPointers`|11.1| | |`hipsparseCooSetPointers`|4.2.0| | | |
|`cusparseCooSetStridedBatch`|11.0| | | | | | | |
|`cusparseCooSetStridedBatch`|11.0| | |`hipsparseCooSetStridedBatch`|5.2.0| | | |
|`cusparseCreateBlockedEll`|11.2| | |`hipsparseCreateBlockedEll`|4.5.0| | | |
|`cusparseCreateCoo`|10.1| | |`hipsparseCreateCoo`|4.1.0| | | |
|`cusparseCreateCooAoS`|10.2|11.2| |`hipsparseCreateCooAoS`|4.1.0| | | |
Expand All @@ -801,7 +801,7 @@
|`cusparseCscSetPointers`|11.1| | |`hipsparseCscSetPointers`|4.2.0| | | |
|`cusparseCsrGet`|10.2| | |`hipsparseCsrGet`|4.1.0| | | |
|`cusparseCsrSetPointers`|11.0| | |`hipsparseCsrSetPointers`|4.1.0| | | |
|`cusparseCsrSetStridedBatch`|11.0| | | | | | | |
|`cusparseCsrSetStridedBatch`|11.0| | |`hipsparseCsrSetStridedBatch`|5.2.0| | | |
|`cusparseDenseToSparse_analysis`|11.1| | |`hipsparseDenseToSparse_analysis`|4.2.0| | | |
|`cusparseDenseToSparse_bufferSize`|11.1| | |`hipsparseDenseToSparse_bufferSize`|4.2.0| | | |
|`cusparseDenseToSparse_convert`|11.1| | |`hipsparseDenseToSparse_convert`|4.2.0| | | |
Expand All @@ -810,9 +810,9 @@
|`cusparseDestroySpMat`|10.1| | |`hipsparseDestroySpMat`|4.1.0| | | |
|`cusparseDestroySpVec`|10.2| | |`hipsparseDestroySpVec`|4.1.0| | | |
|`cusparseDnMatGet`|10.1| | |`hipsparseDnMatGet`|4.2.0| | | |
|`cusparseDnMatGetStridedBatch`|10.1| | | | | | | |
|`cusparseDnMatGetStridedBatch`|10.1| | |`hipsparseDnMatGetStridedBatch`|5.2.0| | | |
|`cusparseDnMatGetValues`|10.2| | |`hipsparseDnMatGetValues`|4.2.0| | | |
|`cusparseDnMatSetStridedBatch`|10.1| | | | | | | |
|`cusparseDnMatSetStridedBatch`|10.1| | |`hipsparseDnMatSetStridedBatch`|5.2.0| | | |
|`cusparseDnMatSetValues`|10.2| | |`hipsparseDnMatSetValues`|4.2.0| | | |
|`cusparseDnVecGet`|10.2| | |`hipsparseDnVecGet`|4.1.0| | | |
|`cusparseDnVecGetValues`|10.2| | |`hipsparseDnVecGetValues`|4.1.0| | | |
Expand Down Expand Up @@ -845,11 +845,11 @@
|`cusparseSpMatGetIndexBase`|10.1| | |`hipsparseSpMatGetIndexBase`|4.1.0| | | |
|`cusparseSpMatGetNumBatches`|10.1| |10.2| | | | | |
|`cusparseSpMatGetSize`|11.0| | |`hipsparseSpMatGetSize`|4.1.0| | | |
|`cusparseSpMatGetStridedBatch`|10.2| | | | | | | |
|`cusparseSpMatGetStridedBatch`|10.2| | |`hipsparseSpMatGetStridedBatch`|5.2.0| | | |
|`cusparseSpMatGetValues`|10.2| | |`hipsparseSpMatGetValues`|4.1.0| | | |
|`cusparseSpMatSetAttribute`|11.3| | |`hipsparseSpMatSetAttribute`|4.5.0| | | |
|`cusparseSpMatSetNumBatches`|10.1| |10.2| | | | | |
|`cusparseSpMatSetStridedBatch`|10.2| | | | | | | |
|`cusparseSpMatSetStridedBatch`|10.2| | |`hipsparseSpMatSetStridedBatch`|5.2.0| | | |
|`cusparseSpMatSetValues`|10.2| | |`hipsparseSpMatSetValues`|4.1.0| | | |
|`cusparseSpSM_analysis`|11.3| | |`hipsparseSpSM_analysis`|4.5.0| | | |
|`cusparseSpSM_bufferSize`|11.3| | |`hipsparseSpSM_bufferSize`|4.5.0| | | |
Expand Down
6 changes: 3 additions & 3 deletions hipify-backward-compat.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function(create_binary_symlink)
add_custom_target(link_${file_name} ALL
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E create_symlink
../../bin/${file_name} ${HIPIFY_WRAPPER_BIN_DIR}/${file_name})
../../${CMAKE_INSTALL_BINDIR}/${file_name} ${HIPIFY_WRAPPER_BIN_DIR}/${file_name})
endforeach()
#create softlink for private scripts
file(GLOB binary_files ${CMAKE_SOURCE_DIR}/bin/find*)
Expand All @@ -48,15 +48,15 @@ function(create_binary_symlink)
add_custom_target(link_${file_name} ALL
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E create_symlink
../../libexec/hipify/${file_name} ${HIPIFY_WRAPPER_BIN_DIR}/${file_name})
../../${CMAKE_INSTALL_LIBEXECDIR}/hipify/${file_name} ${HIPIFY_WRAPPER_BIN_DIR}/${file_name})
endforeach()

#symlink for hipify-clang
set(file_name "hipify-clang")
add_custom_target(link_${file_name} ALL
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E create_symlink
../../bin/${file_name} ${HIPIFY_WRAPPER_BIN_DIR}/${file_name})
../../${CMAKE_INSTALL_BINDIR}/${file_name} ${HIPIFY_WRAPPER_BIN_DIR}/${file_name})
endfunction()
# Create symlink to binaries
create_binary_symlink()
Expand Down
20 changes: 10 additions & 10 deletions packaging/hipify-clang.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
cmake_minimum_required(VERSION 3.6.3)
project(hipify-clang)

install(PROGRAMS @HIPIFY_INSTALL_PATH@/hipify-clang DESTINATION bin)
install(DIRECTORY @HIPIFY_INSTALL_PATH@/include/ DESTINATION include/hipify)
install(PROGRAMS @HIPIFY_INSTALL_PATH@/hipify-perl DESTINATION bin)
install(PROGRAMS @HIPIFY_INSTALL_PATH@/findcode.sh DESTINATION libexec/hipify)
install(PROGRAMS @HIPIFY_INSTALL_PATH@/finduncodep.sh DESTINATION libexec/hipify)
install(PROGRAMS @HIPIFY_INSTALL_PATH@/hipconvertinplace-perl.sh DESTINATION bin)
install(PROGRAMS @HIPIFY_INSTALL_PATH@/hipconvertinplace.sh DESTINATION bin)
install(PROGRAMS @HIPIFY_INSTALL_PATH@/hipexamine-perl.sh DESTINATION bin)
install(PROGRAMS @HIPIFY_INSTALL_PATH@/hipexamine.sh DESTINATION bin)
install(PROGRAMS @HIPIFY_INSTALL_PATH@/hipify-clang DESTINATION @CMAKE_INSTALL_BINDIR@)
install(DIRECTORY @HIPIFY_INSTALL_PATH@/include/ DESTINATION @CMAKE_INSTALL_INCLUDEDIR@/hipify)
install(PROGRAMS @HIPIFY_INSTALL_PATH@/hipify-perl DESTINATION @CMAKE_INSTALL_BINDIR@)
install(PROGRAMS @HIPIFY_INSTALL_PATH@/findcode.sh DESTINATION @CMAKE_INSTALL_LIBEXECDIR@/hipify)
install(PROGRAMS @HIPIFY_INSTALL_PATH@/finduncodep.sh DESTINATION @CMAKE_INSTALL_LIBEXECDIR@/hipify)
install(PROGRAMS @HIPIFY_INSTALL_PATH@/hipconvertinplace-perl.sh DESTINATION @CMAKE_INSTALL_BINDIR@)
install(PROGRAMS @HIPIFY_INSTALL_PATH@/hipconvertinplace.sh DESTINATION @CMAKE_INSTALL_BINDIR@)
install(PROGRAMS @HIPIFY_INSTALL_PATH@/hipexamine-perl.sh DESTINATION @CMAKE_INSTALL_BINDIR@)
install(PROGRAMS @HIPIFY_INSTALL_PATH@/hipexamine.sh DESTINATION @CMAKE_INSTALL_BINDIR@)
set (FILE_REORG_BACKWARD_COMPATIBILITY "@FILE_REORG_BACKWARD_COMPATIBILITY@")
if(FILE_REORG_BACKWARD_COMPATIBILITY)
install(DIRECTORY @PROJECT_BINARY_DIR@/wrapper_dir/bin DESTINATION hip)
Expand All @@ -33,7 +33,7 @@ set(CPACK_SET_DESTDIR TRUE)
set(CPACK_INSTALL_PREFIX @CPACK_PACKAGING_INSTALL_PREFIX@)
set(CPACK_GENERATOR "TGZ;DEB;RPM")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt")
install(FILES ${CPACK_RESOURCE_FILE_LICENSE} DESTINATION share/doc/${CPACK_PACKAGE_NAME})
install(FILES ${CPACK_RESOURCE_FILE_LICENSE} DESTINATION @CMAKE_INSTALL_DOCDIR@)

#Make proper version for appending
#Default Value is 99999, setting it first
Expand Down
38 changes: 36 additions & 2 deletions src/ArgParse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,47 @@ cl::opt<std::string> DocFormat("doc-format",
cl::cat(ToolTemplateCategory));

cl::opt<bool> Experimental("experimental",
cl::desc("HIPIFY experimentally supported APIs"),
cl::desc("HIP APIs that are experimentally supported"),
cl::value_desc("experimental"),
cl::cat(ToolTemplateCategory));

cl::opt<bool> CudaKernelExecutionSyntax("cuda-kernel-execution-syntax",
cl::desc("Do not transform CUDA kernel launches"),
cl::desc("Keep CUDA kernel launch syntax (default)"),
cl::value_desc("cuda-kernel-execution-syntax"),
cl::init(true),
cl::cat(ToolTemplateCategory));

cl::opt<bool> HipKernelExecutionSyntax("hip-kernel-execution-syntax",
cl::desc("Transform CUDA kernel launch syntax to a regular HIP function call (overrides \"--cuda-kernel-execution-syntax\")"),
cl::value_desc("hip-kernel-execution-syntax"),
cl::cat(ToolTemplateCategory));

cl::extrahelp CommonHelp(ct::CommonOptionsParser::HelpMessage);

const std::vector<std::string> hipifyOptions {
std::string(PrintStatsCSV.ArgStr),
std::string(PrintStats.ArgStr),
std::string(SkipExcludedPPConditionalBlocks.ArgStr),
std::string(HipKernelExecutionSyntax.ArgStr),
std::string(CudaKernelExecutionSyntax.ArgStr),
std::string(GeneratePerl.ArgStr),
std::string(GeneratePython.ArgStr),
std::string(TranslateToRoc.ArgStr),
std::string(GenerateMarkdown.ArgStr),
std::string(GenerateCSV.ArgStr),
std::string(NoBackup.ArgStr),
std::string(NoOutput.ArgStr),
std::string(Inplace.ArgStr),
std::string(Examine.ArgStr),
std::string(SaveTemps.ArgStr),
std::string(DocFormat.ArgStr),
std::string(Experimental.ArgStr),
};

const std::vector<std::string> hipifyOptionsWithTwoArgs {
std::string(OutputDir.ArgStr),
std::string(OutputHipifyPerlDir.ArgStr),
std::string(OutputPythonMapDir.ArgStr),
std::string(OutputStatsFilename.ArgStr),
std::string(TemporaryDir.ArgStr),
};
3 changes: 3 additions & 0 deletions src/ArgParse.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,6 @@ extern cl::opt<bool> GenerateCSV;
extern cl::opt<std::string> DocFormat;
extern cl::opt<bool> Experimental;
extern cl::opt<bool> CudaKernelExecutionSyntax;
extern cl::opt<bool> HipKernelExecutionSyntax;
extern const std::vector<std::string> hipifyOptions;
extern const std::vector<std::string> hipifyOptionsWithTwoArgs;
6 changes: 4 additions & 2 deletions src/CUDA2HIP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ const std::map<llvm::StringRef, hipCounter> &CUDA_RENAMES_MAP() {
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());
ret.insert(CUDA_CUB_TYPE_NAME_MAP.begin(), CUDA_CUB_TYPE_NAME_MAP.end());
ret.insert(CUDA_CUB_FUNCTION_MAP.begin(), CUDA_CUB_FUNCTION_MAP.end());
ret.insert(CUDA_RTC_TYPE_NAME_MAP.begin(), CUDA_RTC_TYPE_NAME_MAP.end());
ret.insert(CUDA_RTC_FUNCTION_MAP.begin(), CUDA_RTC_FUNCTION_MAP.end());
return ret;
Expand All @@ -122,7 +124,6 @@ const std::map<llvm::StringRef, cudaAPIversions> &CUDA_VERSIONS_MAP() {
ret.insert(CUDA_DRIVER_FUNCTION_VER_MAP.begin(), CUDA_DRIVER_FUNCTION_VER_MAP.end());
ret.insert(CUDA_RUNTIME_TYPE_NAME_VER_MAP.begin(), CUDA_RUNTIME_TYPE_NAME_VER_MAP.end());
ret.insert(CUDA_RUNTIME_FUNCTION_VER_MAP.begin(), CUDA_RUNTIME_FUNCTION_VER_MAP.end());
ret.insert(CUDA_RUNTIME_FUNCTION_VER_MAP.begin(), CUDA_RUNTIME_FUNCTION_VER_MAP.end());
ret.insert(CUDA_COMPLEX_TYPE_NAME_VER_MAP.begin(), CUDA_COMPLEX_TYPE_NAME_VER_MAP.end());
ret.insert(CUDA_COMPLEX_FUNCTION_VER_MAP.begin(), CUDA_COMPLEX_FUNCTION_VER_MAP.end());
ret.insert(CUDA_BLAS_TYPE_NAME_VER_MAP.begin(), CUDA_BLAS_TYPE_NAME_VER_MAP.end());
Expand All @@ -140,6 +141,7 @@ const std::map<llvm::StringRef, cudaAPIversions> &CUDA_VERSIONS_MAP() {
ret.insert(CUDA_DEVICE_TYPE_NAME_VER_MAP.begin(), CUDA_DEVICE_TYPE_NAME_VER_MAP.end());
ret.insert(CUDA_DEVICE_FUNCTION_VER_MAP.begin(), CUDA_DEVICE_FUNCTION_VER_MAP.end());
ret.insert(CUDA_CUB_TYPE_NAME_VER_MAP.begin(), CUDA_CUB_TYPE_NAME_VER_MAP.end());
ret.insert(CUDA_CUB_FUNCTION_VER_MAP.begin(), CUDA_CUB_FUNCTION_VER_MAP.end());
ret.insert(CUDA_RTC_TYPE_NAME_VER_MAP.begin(), CUDA_RTC_TYPE_NAME_VER_MAP.end());
ret.insert(CUDA_RTC_FUNCTION_VER_MAP.begin(), CUDA_RTC_FUNCTION_VER_MAP.end());
return ret;
Expand All @@ -154,7 +156,6 @@ const std::map<llvm::StringRef, hipAPIversions> &HIP_VERSIONS_MAP() {
ret.insert(HIP_DRIVER_FUNCTION_VER_MAP.begin(), HIP_DRIVER_FUNCTION_VER_MAP.end());
ret.insert(HIP_RUNTIME_TYPE_NAME_VER_MAP.begin(), HIP_RUNTIME_TYPE_NAME_VER_MAP.end());
ret.insert(HIP_RUNTIME_FUNCTION_VER_MAP.begin(), HIP_RUNTIME_FUNCTION_VER_MAP.end());
ret.insert(HIP_RUNTIME_FUNCTION_VER_MAP.begin(), HIP_RUNTIME_FUNCTION_VER_MAP.end());
ret.insert(HIP_COMPLEX_TYPE_NAME_VER_MAP.begin(), HIP_COMPLEX_TYPE_NAME_VER_MAP.end());
ret.insert(HIP_COMPLEX_FUNCTION_VER_MAP.begin(), HIP_COMPLEX_FUNCTION_VER_MAP.end());
ret.insert(HIP_BLAS_TYPE_NAME_VER_MAP.begin(), HIP_BLAS_TYPE_NAME_VER_MAP.end());
Expand All @@ -172,6 +173,7 @@ const std::map<llvm::StringRef, hipAPIversions> &HIP_VERSIONS_MAP() {
ret.insert(HIP_DEVICE_TYPE_NAME_VER_MAP.begin(), HIP_DEVICE_TYPE_NAME_VER_MAP.end());
ret.insert(HIP_DEVICE_FUNCTION_VER_MAP.begin(), HIP_DEVICE_FUNCTION_VER_MAP.end());
ret.insert(HIP_CUB_TYPE_NAME_VER_MAP.begin(), HIP_CUB_TYPE_NAME_VER_MAP.end());
ret.insert(HIP_CUB_FUNCTION_VER_MAP.begin(), HIP_CUB_FUNCTION_VER_MAP.end());
ret.insert(HIP_RTC_TYPE_NAME_VER_MAP.begin(), HIP_RTC_TYPE_NAME_VER_MAP.end());
ret.insert(HIP_RTC_FUNCTION_VER_MAP.begin(), HIP_RTC_FUNCTION_VER_MAP.end());
return ret;
Expand Down
11 changes: 9 additions & 2 deletions src/CUDA2HIP.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,16 @@ extern const std::map<llvm::StringRef, hipCounter> CUDA_SPARSE_FUNCTION_MAP;
extern const std::map<llvm::StringRef, hipCounter> CUDA_CAFFE2_TYPE_NAME_MAP;
// Maps the names of CUDA CAFFE2 API functions to the corresponding HIP functions
extern const std::map<llvm::StringRef, hipCounter> CUDA_CAFFE2_FUNCTION_MAP;
// Maps the names of CUDA Device functions to the corresponding HIP functions
extern const std::map<llvm::StringRef, hipCounter> CUDA_DEVICE_FUNCTION_MAP;
// Maps the names of CUDA Device types to the corresponding HIP types
extern const std::map<llvm::StringRef, hipCounter> CUDA_DEVICE_TYPE_NAME_MAP;
// Maps the names of CUDA Device functions to the corresponding HIP functions
extern const std::map<llvm::StringRef, hipCounter> CUDA_DEVICE_FUNCTION_MAP;
// Maps the names of CUDA CUB API types to the corresponding HIP types
extern const std::map<llvm::StringRef, hipCounter> CUDA_CUB_TYPE_NAME_MAP;
// Maps the names of CUDA CUB API functions to the corresponding HIP functions
extern const std::map<llvm::StringRef, hipCounter> CUDA_CUB_FUNCTION_MAP;
// Maps the names of CUDA CUB namespaces to the corresponding HIP namespaces
extern const std::map<llvm::StringRef, hipCounter> CUDA_CUB_NAMESPACE_MAP;
// Maps the names of CUDA RTC API types to the corresponding HIP types
extern const std::map<llvm::StringRef, hipCounter> CUDA_RTC_TYPE_NAME_MAP;
// Maps the names of CUDA RTC API functions to the corresponding HIP functions
Expand Down Expand Up @@ -109,6 +113,7 @@ extern const std::map<llvm::StringRef, cudaAPIversions> CUDA_CAFFE2_FUNCTION_VER
extern const std::map<llvm::StringRef, cudaAPIversions> CUDA_DEVICE_TYPE_NAME_VER_MAP;
extern const std::map<llvm::StringRef, cudaAPIversions> CUDA_DEVICE_FUNCTION_VER_MAP;
extern const std::map<llvm::StringRef, cudaAPIversions> CUDA_CUB_TYPE_NAME_VER_MAP;
extern const std::map<llvm::StringRef, cudaAPIversions> CUDA_CUB_FUNCTION_VER_MAP;
extern const std::map<llvm::StringRef, cudaAPIversions> CUDA_RTC_TYPE_NAME_VER_MAP;
extern const std::map<llvm::StringRef, cudaAPIversions> CUDA_RTC_FUNCTION_VER_MAP;

Expand Down Expand Up @@ -139,6 +144,7 @@ extern const std::map<llvm::StringRef, hipAPIversions> HIP_CAFFE2_FUNCTION_VER_M
extern const std::map<llvm::StringRef, hipAPIversions> HIP_DEVICE_TYPE_NAME_VER_MAP;
extern const std::map<llvm::StringRef, hipAPIversions> HIP_DEVICE_FUNCTION_VER_MAP;
extern const std::map<llvm::StringRef, hipAPIversions> HIP_CUB_TYPE_NAME_VER_MAP;
extern const std::map<llvm::StringRef, hipAPIversions> HIP_CUB_FUNCTION_VER_MAP;
extern const std::map<llvm::StringRef, hipAPIversions> HIP_RTC_TYPE_NAME_VER_MAP;
extern const std::map<llvm::StringRef, hipAPIversions> HIP_RTC_FUNCTION_VER_MAP;

Expand All @@ -158,3 +164,4 @@ extern const std::map<unsigned int, llvm::StringRef> CUDA_FFT_API_SECTION_MAP;
extern const std::map<unsigned int, llvm::StringRef> CUDA_SPARSE_API_SECTION_MAP;
extern const std::map<unsigned int, llvm::StringRef> CUDA_DEVICE_FUNCTION_API_SECTION_MAP;
extern const std::map<unsigned int, llvm::StringRef> CUDA_RTC_API_SECTION_MAP;
extern const std::map<unsigned int, llvm::StringRef> CUDA_CUB_API_SECTION_MAP;
33 changes: 33 additions & 0 deletions src/CUDA2HIP_CUB_API_functions.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
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 the names of CUDA CUB API functions to the corresponding HIP functions
const std::map<llvm::StringRef, hipCounter> CUDA_CUB_FUNCTION_MAP {
};

const std::map<llvm::StringRef, cudaAPIversions> CUDA_CUB_FUNCTION_VER_MAP {
};

const std::map<llvm::StringRef, hipAPIversions> HIP_CUB_FUNCTION_VER_MAP {
};
Loading

0 comments on commit 2ab347f

Please sign in to comment.