Skip to content

Commit

Permalink
[HIPIFY][ROCm#675][ROCm#677][SOLVER][feature][doc] cuSOLVER support -…
Browse files Browse the repository at this point in the history
… Step 6 - Documentation

+ Three Solver-related `CUDA2HIP` documents are generated now:
  `CUSOLVER_API_supported_by_HIP.md`
  `CUSOLVER_API_supported_by_ROC.md`
  `CUSOLVER_API_supported_by_HIP_and_ROC.md`
+ All HIP and ROC APIs are `Experimental` for now despite their versions

[ToDo]
+ Populate `README.md` (`supported_apis.md`) with links to `SOLVER CUDA2HIP` documentation
+ Remove `Experimental` mark after finishing with `SOLVER` support in HIPIFY tools
  • Loading branch information
emankov committed Nov 11, 2023
1 parent 777273a commit b5538de
Show file tree
Hide file tree
Showing 8 changed files with 266 additions and 0 deletions.
23 changes: 23 additions & 0 deletions bin/hipify-perl
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,17 @@ my %removed_funcs = (
);

my %experimental_funcs = (
"cusolverStatus_t" => "6.0.0",
"cusolverEigType_t" => "6.0.0",
"cusolverDnSgetrs" => "6.0.0",
"cusolverDnSgetrf_bufferSize" => "6.0.0",
"cusolverDnSgetrf" => "6.0.0",
"cusolverDnHandle_t" => "6.0.0",
"cusolverDnDgetrs" => "6.0.0",
"cusolverDnDgetrf_bufferSize" => "6.0.0",
"cusolverDnDgetrf" => "6.0.0",
"cusolverDnDestroy" => "6.0.0",
"cusolverDnCreate" => "6.0.0",
"cudaGraphExternalSemaphoresWaitNodeSetParams" => "6.0.0",
"cudaGraphExternalSemaphoresWaitNodeGetParams" => "6.0.0",
"cudaGraphExternalSemaphoresSignalNodeSetParams" => "6.0.0",
Expand All @@ -1099,6 +1110,18 @@ my %experimental_funcs = (
"cuGraphAddExternalSemaphoresWaitNode" => "6.0.0",
"cuGraphAddExternalSemaphoresSignalNode" => "6.0.0",
"CU_DEVICE_ATTRIBUTE_HOST_REGISTER_SUPPORTED" => "6.0.0",
"CUSOLVER_STATUS_SUCCESS" => "6.0.0",
"CUSOLVER_STATUS_NOT_SUPPORTED" => "6.0.0",
"CUSOLVER_STATUS_NOT_INITIALIZED" => "6.0.0",
"CUSOLVER_STATUS_MAPPING_ERROR" => "6.0.0",
"CUSOLVER_STATUS_INVALID_VALUE" => "6.0.0",
"CUSOLVER_STATUS_INTERNAL_ERROR" => "6.0.0",
"CUSOLVER_STATUS_EXECUTION_FAILED" => "6.0.0",
"CUSOLVER_STATUS_ARCH_MISMATCH" => "6.0.0",
"CUSOLVER_STATUS_ALLOC_FAILED" => "6.0.0",
"CUSOLVER_EIG_TYPE_3" => "6.0.0",
"CUSOLVER_EIG_TYPE_2" => "6.0.0",
"CUSOLVER_EIG_TYPE_1" => "6.0.0",
"CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st" => "6.0.0",
"CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2" => "6.0.0",
"CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1" => "6.0.0",
Expand Down
58 changes: 58 additions & 0 deletions docs/tables/CUSOLVER_API_supported_by_HIP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# CUSOLVER API supported by HIP

## **1. CUSOLVER Data types**

|**CUDA**|**A**|**D**|**C**|**R**|**HIP**|**A**|**D**|**C**|**R**|**E**|
|:--|:-:|:-:|:-:|:-:|:--|:-:|:-:|:-:|:-:|:-:|
|`CUSOLVER_EIG_TYPE_1`|8.0| | | |`HIPSOLVER_EIG_TYPE_1`|4.5.0| | | |6.0.0|
|`CUSOLVER_EIG_TYPE_2`|8.0| | | |`HIPSOLVER_EIG_TYPE_2`|4.5.0| | | |6.0.0|
|`CUSOLVER_EIG_TYPE_3`|8.0| | | |`HIPSOLVER_EIG_TYPE_3`|4.5.0| | | |6.0.0|
|`CUSOLVER_STATUS_ALLOC_FAILED`| | | | |`HIPSOLVER_STATUS_ALLOC_FAILED`|4.5.0| | | |6.0.0|
|`CUSOLVER_STATUS_ARCH_MISMATCH`| | | | |`HIPSOLVER_STATUS_ARCH_MISMATCH`|4.5.0| | | |6.0.0|
|`CUSOLVER_STATUS_EXECUTION_FAILED`| | | | |`HIPSOLVER_STATUS_EXECUTION_FAILED`|4.5.0| | | |6.0.0|
|`CUSOLVER_STATUS_INTERNAL_ERROR`| | | | |`HIPSOLVER_STATUS_INTERNAL_ERROR`|4.5.0| | | |6.0.0|
|`CUSOLVER_STATUS_INVALID_LICENSE`| | | | | | | | | | |
|`CUSOLVER_STATUS_INVALID_VALUE`| | | | |`HIPSOLVER_STATUS_INVALID_VALUE`|4.5.0| | | |6.0.0|
|`CUSOLVER_STATUS_INVALID_WORKSPACE`|11.0| | | | | | | | | |
|`CUSOLVER_STATUS_IRS_INFOS_NOT_DESTROYED`|11.0| | | | | | | | | |
|`CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`|10.2| | | | | | | | | |
|`CUSOLVER_STATUS_IRS_INTERNAL_ERROR`|10.2| | | | | | | | | |
|`CUSOLVER_STATUS_IRS_MATRIX_SINGULAR`|11.0| | | | | | | | | |
|`CUSOLVER_STATUS_IRS_NOT_SUPPORTED`|10.2| | | | | | | | | |
|`CUSOLVER_STATUS_IRS_NRHS_NOT_SUPPORTED_FOR_REFINE_GMRES`|10.2| | | | | | | | | |
|`CUSOLVER_STATUS_IRS_OUT_OF_RANGE`|10.2| | | | | | | | | |
|`CUSOLVER_STATUS_IRS_PARAMS_INVALID`|10.2| | | | | | | | | |
|`CUSOLVER_STATUS_IRS_PARAMS_INVALID_MAXITER`|11.0| | | | | | | | | |
|`CUSOLVER_STATUS_IRS_PARAMS_INVALID_PREC`|11.0| | | | | | | | | |
|`CUSOLVER_STATUS_IRS_PARAMS_INVALID_REFINE`|11.0| | | | | | | | | |
|`CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`|10.2| | | | | | | | | |
|`CUSOLVER_STATUS_MAPPING_ERROR`| | | | |`HIPSOLVER_STATUS_MAPPING_ERROR`|4.5.0| | | |6.0.0|
|`CUSOLVER_STATUS_MATRIX_TYPE_NOT_SUPPORTED`| | | | | | | | | | |
|`CUSOLVER_STATUS_NOT_INITIALIZED`| | | | |`HIPSOLVER_STATUS_NOT_INITIALIZED`|4.5.0| | | |6.0.0|
|`CUSOLVER_STATUS_NOT_SUPPORTED`| | | | |`HIPSOLVER_STATUS_NOT_SUPPORTED`|4.5.0| | | |6.0.0|
|`CUSOLVER_STATUS_SUCCESS`| | | | |`HIPSOLVER_STATUS_SUCCESS`|4.5.0| | | |6.0.0|
|`CUSOLVER_STATUS_ZERO_PIVOT`| | | | |`HIPSOLVER_STATUS_ZERO_PIVOT`| | | | | |
|`cusolverDnHandle_t`| | | | |`hipsolverHandle_t`|4.5.0| | | |6.0.0|
|`cusolverEigType_t`|8.0| | | |`hipsolverEigType_t`|4.5.0| | | |6.0.0|
|`cusolverStatus_t`| | | | |`hipsolverStatus_t`|4.5.0| | | |6.0.0|

## **2. CUSOLVER Function Reference**

|**CUDA**|**A**|**D**|**C**|**R**|**HIP**|**A**|**D**|**C**|**R**|**E**|
|:--|:-:|:-:|:-:|:-:|:--|:-:|:-:|:-:|:-:|:-:|
|`cusolverDnCreate`| | | | |`hipsolverDnCreate`|5.1.0| | | |6.0.0|
|`cusolverDnCreateParams`|11.0| | | | | | | | | |
|`cusolverDnDestroy`| | | | |`hipsolverDnDestroy`|5.1.0| | | |6.0.0|
|`cusolverDnDgetrf`| | | | |`hipsolverDnDgetrf`|5.1.0| | | |6.0.0|
|`cusolverDnDgetrf_bufferSize`| | | | |`hipsolverDnDgetrf_bufferSize`|5.1.0| | | |6.0.0|
|`cusolverDnDgetrs`| | | | |`hipsolverDnDgetrs`|5.1.0| | | |6.0.0|
|`cusolverDnSetAdvOptions`|11.0| | | | | | | | | |
|`cusolverDnSgetrf`| | | | |`hipsolverDnSgetrf`|5.1.0| | | |6.0.0|
|`cusolverDnSgetrf_bufferSize`| | | | |`hipsolverDnSgetrf_bufferSize`|5.1.0| | | |6.0.0|
|`cusolverDnSgetrs`| | | | |`hipsolverDnSgetrs`|5.1.0| | | |6.0.0|
|`cusolverDnXgetrf`|11.1| | | | | | | | | |
|`cusolverDnXgetrf_bufferSize`|11.1| | | | | | | | | |
|`cusolverDnXgetrs`|11.1| | | | | | | | | |


\*A - Added; D - Deprecated; C - Changed; R - Removed; E - Experimental
58 changes: 58 additions & 0 deletions docs/tables/CUSOLVER_API_supported_by_HIP_and_ROC.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# CUSOLVER API supported by HIP and ROC

## **1. CUSOLVER Data types**

|**CUDA**|**A**|**D**|**C**|**R**|**HIP**|**A**|**D**|**C**|**R**|**E**|**ROC**|**A**|**D**|**C**|**R**|**E**|
|:--|:-:|:-:|:-:|:-:|:--|:-:|:-:|:-:|:-:|:-:|:--|:-:|:-:|:-:|:-:|:-:|
|`CUSOLVER_EIG_TYPE_1`|8.0| | | |`HIPSOLVER_EIG_TYPE_1`|4.5.0| | | |6.0.0|`rocblas_eform_ax`|4.2.0| | | |6.0.0|
|`CUSOLVER_EIG_TYPE_2`|8.0| | | |`HIPSOLVER_EIG_TYPE_2`|4.5.0| | | |6.0.0|`rocblas_eform_abx`|4.2.0| | | |6.0.0|
|`CUSOLVER_EIG_TYPE_3`|8.0| | | |`HIPSOLVER_EIG_TYPE_3`|4.5.0| | | |6.0.0|`rocblas_eform_bax`|4.2.0| | | |6.0.0|
|`CUSOLVER_STATUS_ALLOC_FAILED`| | | | |`HIPSOLVER_STATUS_ALLOC_FAILED`|4.5.0| | | |6.0.0|`rocblas_status_memory_error`|5.6.0| | | |6.0.0|
|`CUSOLVER_STATUS_ARCH_MISMATCH`| | | | |`HIPSOLVER_STATUS_ARCH_MISMATCH`|4.5.0| | | |6.0.0|`rocblas_status_arch_mismatch`|5.7.0| | | |6.0.0|
|`CUSOLVER_STATUS_EXECUTION_FAILED`| | | | |`HIPSOLVER_STATUS_EXECUTION_FAILED`|4.5.0| | | |6.0.0|`rocblas_status_not_implemented`|1.5.0| | | |6.0.0|
|`CUSOLVER_STATUS_INTERNAL_ERROR`| | | | |`HIPSOLVER_STATUS_INTERNAL_ERROR`|4.5.0| | | |6.0.0|`rocblas_status_internal_error`|1.5.0| | | |6.0.0|
|`CUSOLVER_STATUS_INVALID_LICENSE`| | | | | | | | | | | | | | | | |
|`CUSOLVER_STATUS_INVALID_VALUE`| | | | |`HIPSOLVER_STATUS_INVALID_VALUE`|4.5.0| | | |6.0.0|`rocblas_status_invalid_value`|3.5.0| | | |6.0.0|
|`CUSOLVER_STATUS_INVALID_WORKSPACE`|11.0| | | | | | | | | | | | | | | |
|`CUSOLVER_STATUS_IRS_INFOS_NOT_DESTROYED`|11.0| | | | | | | | | | | | | | | |
|`CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`|10.2| | | | | | | | | | | | | | | |
|`CUSOLVER_STATUS_IRS_INTERNAL_ERROR`|10.2| | | | | | | | | | | | | | | |
|`CUSOLVER_STATUS_IRS_MATRIX_SINGULAR`|11.0| | | | | | | | | | | | | | | |
|`CUSOLVER_STATUS_IRS_NOT_SUPPORTED`|10.2| | | | | | | | | | | | | | | |
|`CUSOLVER_STATUS_IRS_NRHS_NOT_SUPPORTED_FOR_REFINE_GMRES`|10.2| | | | | | | | | | | | | | | |
|`CUSOLVER_STATUS_IRS_OUT_OF_RANGE`|10.2| | | | | | | | | | | | | | | |
|`CUSOLVER_STATUS_IRS_PARAMS_INVALID`|10.2| | | | | | | | | | | | | | | |
|`CUSOLVER_STATUS_IRS_PARAMS_INVALID_MAXITER`|11.0| | | | | | | | | | | | | | | |
|`CUSOLVER_STATUS_IRS_PARAMS_INVALID_PREC`|11.0| | | | | | | | | | | | | | | |
|`CUSOLVER_STATUS_IRS_PARAMS_INVALID_REFINE`|11.0| | | | | | | | | | | | | | | |
|`CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`|10.2| | | | | | | | | | | | | | | |
|`CUSOLVER_STATUS_MAPPING_ERROR`| | | | |`HIPSOLVER_STATUS_MAPPING_ERROR`|4.5.0| | | |6.0.0|`rocblas_status_not_implemented`|1.5.0| | | |6.0.0|
|`CUSOLVER_STATUS_MATRIX_TYPE_NOT_SUPPORTED`| | | | | | | | | | | | | | | | |
|`CUSOLVER_STATUS_NOT_INITIALIZED`| | | | |`HIPSOLVER_STATUS_NOT_INITIALIZED`|4.5.0| | | |6.0.0|`rocblas_status_invalid_handle`|5.6.0| | | |6.0.0|
|`CUSOLVER_STATUS_NOT_SUPPORTED`| | | | |`HIPSOLVER_STATUS_NOT_SUPPORTED`|4.5.0| | | |6.0.0|`rocblas_status_not_implemented`|1.5.0| | | |6.0.0|
|`CUSOLVER_STATUS_SUCCESS`| | | | |`HIPSOLVER_STATUS_SUCCESS`|4.5.0| | | |6.0.0|`rocblas_status_success`|3.0.0| | | |6.0.0|
|`CUSOLVER_STATUS_ZERO_PIVOT`| | | | |`HIPSOLVER_STATUS_ZERO_PIVOT`| | | | | |`rocblas_status_not_implemented`|1.5.0| | | |6.0.0|
|`cusolverDnHandle_t`| | | | |`hipsolverHandle_t`|4.5.0| | | |6.0.0|`rocblas_handle`|1.5.0| | | |6.0.0|
|`cusolverEigType_t`|8.0| | | |`hipsolverEigType_t`|4.5.0| | | |6.0.0|`rocblas_eform`|4.2.0| | | |6.0.0|
|`cusolverStatus_t`| | | | |`hipsolverStatus_t`|4.5.0| | | |6.0.0|`rocblas_status`|3.0.0| | | |6.0.0|

## **2. CUSOLVER Function Reference**

|**CUDA**|**A**|**D**|**C**|**R**|**HIP**|**A**|**D**|**C**|**R**|**E**|**ROC**|**A**|**D**|**C**|**R**|**E**|
|:--|:-:|:-:|:-:|:-:|:--|:-:|:-:|:-:|:-:|:-:|:--|:-:|:-:|:-:|:-:|:-:|
|`cusolverDnCreate`| | | | |`hipsolverDnCreate`|5.1.0| | | |6.0.0|`rocblas_create_handle`| | | | | |
|`cusolverDnCreateParams`|11.0| | | | | | | | | | | | | | | |
|`cusolverDnDestroy`| | | | |`hipsolverDnDestroy`|5.1.0| | | |6.0.0|`rocblas_destroy_handle`| | | | | |
|`cusolverDnDgetrf`| | | | |`hipsolverDnDgetrf`|5.1.0| | | |6.0.0| | | | | | |
|`cusolverDnDgetrf_bufferSize`| | | | |`hipsolverDnDgetrf_bufferSize`|5.1.0| | | |6.0.0| | | | | | |
|`cusolverDnDgetrs`| | | | |`hipsolverDnDgetrs`|5.1.0| | | |6.0.0| | | | | | |
|`cusolverDnSetAdvOptions`|11.0| | | | | | | | | | | | | | | |
|`cusolverDnSgetrf`| | | | |`hipsolverDnSgetrf`|5.1.0| | | |6.0.0| | | | | | |
|`cusolverDnSgetrf_bufferSize`| | | | |`hipsolverDnSgetrf_bufferSize`|5.1.0| | | |6.0.0| | | | | | |
|`cusolverDnSgetrs`| | | | |`hipsolverDnSgetrs`|5.1.0| | | |6.0.0| | | | | | |
|`cusolverDnXgetrf`|11.1| | | | | | | | | | | | | | | |
|`cusolverDnXgetrf_bufferSize`|11.1| | | | | | | | | | | | | | | |
|`cusolverDnXgetrs`|11.1| | | | | | | | | | | | | | | |


\*A - Added; D - Deprecated; C - Changed; R - Removed; E - Experimental
58 changes: 58 additions & 0 deletions docs/tables/CUSOLVER_API_supported_by_ROC.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# CUSOLVER API supported by ROC

## **1. CUSOLVER Data types**

|**CUDA**|**A**|**D**|**C**|**R**|**ROC**|**A**|**D**|**C**|**R**|**E**|
|:--|:-:|:-:|:-:|:-:|:--|:-:|:-:|:-:|:-:|:-:|
|`CUSOLVER_EIG_TYPE_1`|8.0| | | |`rocblas_eform_ax`|4.2.0| | | |6.0.0|
|`CUSOLVER_EIG_TYPE_2`|8.0| | | |`rocblas_eform_abx`|4.2.0| | | |6.0.0|
|`CUSOLVER_EIG_TYPE_3`|8.0| | | |`rocblas_eform_bax`|4.2.0| | | |6.0.0|
|`CUSOLVER_STATUS_ALLOC_FAILED`| | | | |`rocblas_status_memory_error`|5.6.0| | | |6.0.0|
|`CUSOLVER_STATUS_ARCH_MISMATCH`| | | | |`rocblas_status_arch_mismatch`|5.7.0| | | |6.0.0|
|`CUSOLVER_STATUS_EXECUTION_FAILED`| | | | |`rocblas_status_not_implemented`|1.5.0| | | |6.0.0|
|`CUSOLVER_STATUS_INTERNAL_ERROR`| | | | |`rocblas_status_internal_error`|1.5.0| | | |6.0.0|
|`CUSOLVER_STATUS_INVALID_LICENSE`| | | | | | | | | | |
|`CUSOLVER_STATUS_INVALID_VALUE`| | | | |`rocblas_status_invalid_value`|3.5.0| | | |6.0.0|
|`CUSOLVER_STATUS_INVALID_WORKSPACE`|11.0| | | | | | | | | |
|`CUSOLVER_STATUS_IRS_INFOS_NOT_DESTROYED`|11.0| | | | | | | | | |
|`CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED`|10.2| | | | | | | | | |
|`CUSOLVER_STATUS_IRS_INTERNAL_ERROR`|10.2| | | | | | | | | |
|`CUSOLVER_STATUS_IRS_MATRIX_SINGULAR`|11.0| | | | | | | | | |
|`CUSOLVER_STATUS_IRS_NOT_SUPPORTED`|10.2| | | | | | | | | |
|`CUSOLVER_STATUS_IRS_NRHS_NOT_SUPPORTED_FOR_REFINE_GMRES`|10.2| | | | | | | | | |
|`CUSOLVER_STATUS_IRS_OUT_OF_RANGE`|10.2| | | | | | | | | |
|`CUSOLVER_STATUS_IRS_PARAMS_INVALID`|10.2| | | | | | | | | |
|`CUSOLVER_STATUS_IRS_PARAMS_INVALID_MAXITER`|11.0| | | | | | | | | |
|`CUSOLVER_STATUS_IRS_PARAMS_INVALID_PREC`|11.0| | | | | | | | | |
|`CUSOLVER_STATUS_IRS_PARAMS_INVALID_REFINE`|11.0| | | | | | | | | |
|`CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED`|10.2| | | | | | | | | |
|`CUSOLVER_STATUS_MAPPING_ERROR`| | | | |`rocblas_status_not_implemented`|1.5.0| | | |6.0.0|
|`CUSOLVER_STATUS_MATRIX_TYPE_NOT_SUPPORTED`| | | | | | | | | | |
|`CUSOLVER_STATUS_NOT_INITIALIZED`| | | | |`rocblas_status_invalid_handle`|5.6.0| | | |6.0.0|
|`CUSOLVER_STATUS_NOT_SUPPORTED`| | | | |`rocblas_status_not_implemented`|1.5.0| | | |6.0.0|
|`CUSOLVER_STATUS_SUCCESS`| | | | |`rocblas_status_success`|3.0.0| | | |6.0.0|
|`CUSOLVER_STATUS_ZERO_PIVOT`| | | | |`rocblas_status_not_implemented`|1.5.0| | | |6.0.0|
|`cusolverDnHandle_t`| | | | |`rocblas_handle`|1.5.0| | | |6.0.0|
|`cusolverEigType_t`|8.0| | | |`rocblas_eform`|4.2.0| | | |6.0.0|
|`cusolverStatus_t`| | | | |`rocblas_status`|3.0.0| | | |6.0.0|

## **2. CUSOLVER Function Reference**

|**CUDA**|**A**|**D**|**C**|**R**|**ROC**|**A**|**D**|**C**|**R**|**E**|
|:--|:-:|:-:|:-:|:-:|:--|:-:|:-:|:-:|:-:|:-:|
|`cusolverDnCreate`| | | | |`rocblas_create_handle`| | | | | |
|`cusolverDnCreateParams`|11.0| | | | | | | | | |
|`cusolverDnDestroy`| | | | |`rocblas_destroy_handle`| | | | | |
|`cusolverDnDgetrf`| | | | | | | | | | |
|`cusolverDnDgetrf_bufferSize`| | | | | | | | | | |
|`cusolverDnDgetrs`| | | | | | | | | | |
|`cusolverDnSetAdvOptions`|11.0| | | | | | | | | |
|`cusolverDnSgetrf`| | | | | | | | | | |
|`cusolverDnSgetrf_bufferSize`| | | | | | | | | | |
|`cusolverDnSgetrs`| | | | | | | | | | |
|`cusolverDnXgetrf`|11.1| | | | | | | | | |
|`cusolverDnXgetrf_bufferSize`|11.1| | | | | | | | | |
|`cusolverDnXgetrs`|11.1| | | | | | | | | |


\*A - Added; D - Deprecated; C - Changed; R - Removed; E - Experimental
4 changes: 4 additions & 0 deletions src/CUDA2HIP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ const std::map<llvm::StringRef, cudaAPIversions> &CUDA_VERSIONS_MAP() {
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());
ret.insert(CUDA_SOLVER_TYPE_NAME_VER_MAP.begin(), CUDA_SOLVER_TYPE_NAME_VER_MAP.end());
ret.insert(CUDA_SOLVER_FUNCTION_VER_MAP.begin(), CUDA_SOLVER_FUNCTION_VER_MAP.end());
return ret;
}

Expand Down Expand Up @@ -187,5 +189,7 @@ const std::map<llvm::StringRef, hipAPIversions> &HIP_VERSIONS_MAP() {
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());
ret.insert(HIP_SOLVER_TYPE_NAME_VER_MAP.begin(), HIP_SOLVER_TYPE_NAME_VER_MAP.end());
ret.insert(HIP_SOLVER_FUNCTION_VER_MAP.begin(), HIP_SOLVER_FUNCTION_VER_MAP.end());
return ret;
}
5 changes: 5 additions & 0 deletions src/CUDA2HIP.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ extern const std::map<llvm::StringRef, cudaAPIversions> CUDA_CUB_TYPE_NAME_VER_M
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;
extern const std::map<llvm::StringRef, cudaAPIversions> CUDA_SOLVER_TYPE_NAME_VER_MAP;
extern const std::map<llvm::StringRef, cudaAPIversions> CUDA_SOLVER_FUNCTION_VER_MAP;

/**
* The union of all the above CUDA maps.
Expand Down Expand Up @@ -154,6 +156,8 @@ 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;
extern const std::map<llvm::StringRef, hipAPIversions> HIP_SOLVER_TYPE_NAME_VER_MAP;
extern const std::map<llvm::StringRef, hipAPIversions> HIP_SOLVER_FUNCTION_VER_MAP;

/**
* The union of all the above HIP maps.
Expand All @@ -172,6 +176,7 @@ 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;
extern const std::map<unsigned int, llvm::StringRef> CUDA_SOLVER_API_SECTION_MAP;

namespace driver {
enum CUDA_DRIVER_API_SECTIONS {
Expand Down
55 changes: 55 additions & 0 deletions src/CUDA2HIP_Doc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ namespace doc {
const string sROCBLAS_csv = sROCBLAS + csv_ext;
const string sCUBLAS = "CUBLAS";

const string sSOLVER = "CUSOLVER_API_supported_by_HIP";
const string sSOLVER_md = sSOLVER + md_ext;
const string sSOLVER_csv = sSOLVER + csv_ext;
const string sSOLVER_and_ROC_md = sSOLVER + sandROC + md_ext;
const string sSOLVER_and_ROC_csv = sSOLVER + sandROC + csv_ext;
const string sROCSOLVER = "CUSOLVER_API_supported_by_ROC";
const string sROCSOLVER_md = sROCSOLVER + md_ext;
const string sROCSOLVER_csv = sROCSOLVER + csv_ext;
const string sCUSOLVER = "CUSOLVER";

const string sRAND = "CURAND_API_supported_by_HIP";
const string sRAND_md = sRAND + md_ext;
const string sRAND_csv = sRAND + csv_ext;
Expand Down Expand Up @@ -580,6 +590,47 @@ namespace doc {
}
};

class SOLVER : public DOC {
public:
SOLVER(const string& outDir) : DOC(outDir) { hasROC = true; }
virtual ~SOLVER() {}
protected:
const sectionMap& getSections() const override { return CUDA_SOLVER_API_SECTION_MAP; }
const functionMap& getFunctions() const override { return CUDA_SOLVER_FUNCTION_MAP; }
const typeMap& getTypes() const override { return CUDA_SOLVER_TYPE_NAME_MAP; }
const versionMap& getFunctionVersions() const override { return CUDA_SOLVER_FUNCTION_VER_MAP; }
const hipVersionMap& getHipFunctionVersions() const override { return HIP_SOLVER_FUNCTION_VER_MAP; }
const versionMap& getTypeVersions() const override { return CUDA_SOLVER_TYPE_NAME_VER_MAP; }
const hipVersionMap& getHipTypeVersions() const override { return HIP_SOLVER_TYPE_NAME_VER_MAP; }
const string& getName() const override { return sCUSOLVER; }
const string& getSecondAPI() const override { return sROC; }
const string& getJointAPI() const override { return sHIPandROC; }
const string& getFileName(docType format) const override {
switch (format) {
case none:
default: return sEmpty;
case md: return roc == joint ? sSOLVER_and_ROC_md : sSOLVER_md;
case csv: return roc == joint ? sSOLVER_and_ROC_csv : sSOLVER_csv;
}
}
};

class ROCSOLVER : public SOLVER {
public:
ROCSOLVER(const string& outDir) : SOLVER(outDir) { hasROC = false; isROC = true; }
virtual ~ROCSOLVER() {}
protected:
const string& getAPI() const override { return sROC; }
const string& getFileName(docType format) const override {
switch (format) {
case none:
default: return sEmpty;
case md: return sROCSOLVER_md;
case csv: return sROCSOLVER_csv;
}
}
};

class RAND: public DOC {
public:
RAND(const string &outDir): DOC(outDir) {}
Expand Down Expand Up @@ -818,12 +869,16 @@ namespace doc {
BLAS blas(sOut);
docs.addDoc(&blas);
ROCBLAS rocblas(sOut);
SOLVER solver(sOut);
docs.addDoc(&solver);
ROCSOLVER rocsolver(sOut);
MIOPEN miopen(sOut);
ROCSPARSE rocsparse(sOut);
if (docRoc == separate) {
docs.addDoc(&rocblas);
docs.addDoc(&miopen);
docs.addDoc(&rocsparse);
docs.addDoc(&rocsolver);
}
RAND rand(sOut);
docs.addDoc(&rand);
Expand Down
5 changes: 5 additions & 0 deletions src/CUDA2HIP_SOLVER_API_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,8 @@ const std::map<llvm::StringRef, hipAPIversions> HIP_SOLVER_FUNCTION_VER_MAP {
{"hipsolverDnDgetrs", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
{"hipsolverDnSgetrs", {HIP_5010, HIP_0, HIP_0, HIP_LATEST}},
};

const std::map<unsigned int, llvm::StringRef> CUDA_SOLVER_API_SECTION_MAP {
{1, "CUSOLVER Data types"},
{2, "CUSOLVER Function Reference"},
};

0 comments on commit b5538de

Please sign in to comment.