From 54fee7abdc9085036641d8adb5576e6497e3f5ce Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Wed, 21 Aug 2019 21:06:20 +0300 Subject: [PATCH] [HIPIFY] CUDA 10.1 Update 2 support --- docs/markdown/CUBLAS_API_supported_by_HIP.md | 5 + docs/markdown/CURAND_API_supported_by_HIP.md | 223 +++++++++--------- .../markdown/CUSPARSE_API_supported_by_HIP.md | 5 + hipify-clang/src/CUDA2HIP_BLAS_API_types.cpp | 7 + hipify-clang/src/CUDA2HIP_RAND_API_types.cpp | 11 +- .../src/CUDA2HIP_SPARSE_API_types.cpp | 6 + 6 files changed, 147 insertions(+), 110 deletions(-) diff --git a/docs/markdown/CUBLAS_API_supported_by_HIP.md b/docs/markdown/CUBLAS_API_supported_by_HIP.md index 62e014c944..56fc2a89ac 100644 --- a/docs/markdown/CUBLAS_API_supported_by_HIP.md +++ b/docs/markdown/CUBLAS_API_supported_by_HIP.md @@ -4,6 +4,11 @@ | **type** | **CUDA** |**CUDA version\***| **HIP** |**HIP value** (if differs) | |-------------:|---------------------------------------------------------------|:----------------:|------------------------------------------------------------|---------------------------| +| define |`CUBLAS_VER_MAJOR` | 10.1 Update 2 | | +| define |`CUBLAS_VER_MINOR` | 10.1 Update 2 | | +| define |`CUBLAS_VER_PATCH` | 10.1 Update 2 | | +| define |`CUBLAS_VER_BUILD` | 10.1 Update 2 | | +| define |`CUBLAS_VERSION` | 10.1 Update 2 | | | enum |***`cublasStatus`*** | |***`hipblasStatus_t`*** | | enum |***`cublasStatus_t`*** | |***`hipblasStatus_t`*** | | 0 |*`CUBLAS_STATUS_SUCCESS`* | |*`HIPBLAS_STATUS_SUCCESS`* | diff --git a/docs/markdown/CURAND_API_supported_by_HIP.md b/docs/markdown/CURAND_API_supported_by_HIP.md index 83c41e59ff..a46a2c1afd 100644 --- a/docs/markdown/CURAND_API_supported_by_HIP.md +++ b/docs/markdown/CURAND_API_supported_by_HIP.md @@ -2,115 +2,120 @@ ## **1. CURAND Data types** -| **type** | **CUDA** | **HIP** | **HIP value** (if differs) | -|-------------:|---------------------------------------------------------------|------------------------------------------------------------|----------------------------| -| enum |***`curandStatus`*** |***`hiprandStatus`*** | -| enum |***`curandStatus_t`*** |***`hiprandStatus_t`*** | -| 0 |*`CURAND_STATUS_SUCCESS`* |*`HIPRAND_STATUS_SUCCESS`* | -| 100 |*`CURAND_STATUS_VERSION_MISMATCH`* |*`HIPRAND_STATUS_VERSION_MISMATCH`* | -| 101 |*`CURAND_STATUS_NOT_INITIALIZED`* |*`HIPRAND_STATUS_NOT_INITIALIZED`* | -| 102 |*`CURAND_STATUS_ALLOCATION_FAILED`* |*`HIPRAND_STATUS_ALLOCATION_FAILED`* | -| 103 |*`CURAND_STATUS_TYPE_ERROR`* |*`HIPRAND_STATUS_TYPE_ERROR`* | -| 104 |*`CURAND_STATUS_OUT_OF_RANGE`* |*`HIPRAND_STATUS_OUT_OF_RANGE`* | -| 105 |*`CURAND_STATUS_LENGTH_NOT_MULTIPLE`* |*`HIPRAND_STATUS_LENGTH_NOT_MULTIPLE`* | -| 106 |*`CURAND_STATUS_DOUBLE_PRECISION_REQUIRED`* |*`HIPRAND_STATUS_DOUBLE_PRECISION_REQUIRED`* | -| 201 |*`CURAND_STATUS_LAUNCH_FAILURE`* |*`HIPRAND_STATUS_LAUNCH_FAILURE`* | -| 202 |*`CURAND_STATUS_PREEXISTING_FAILURE`* |*`HIPRAND_STATUS_PREEXISTING_FAILURE`* | -| 203 |*`CURAND_STATUS_INITIALIZATION_FAILED`* |*`HIPRAND_STATUS_INITIALIZATION_FAILED`* | -| 204 |*`CURAND_STATUS_ARCH_MISMATCH`* |*`HIPRAND_STATUS_ARCH_MISMATCH`* | -| 999 |*`CURAND_STATUS_INTERNAL_ERROR`* |*`HIPRAND_STATUS_INTERNAL_ERROR`* | -| enum |***`curandRngType`*** |***`hiprandRngType`*** | -| enum |***`curandRngType_t`*** |***`hiprandRngType_t`*** | -| 0 |*`CURAND_RNG_TEST`* |*`HIPRAND_RNG_TEST`* | -| 100 |*`CURAND_RNG_PSEUDO_DEFAULT`* |*`HIPRAND_RNG_PSEUDO_DEFAULT`* | 400 | -| 101 |*`CURAND_RNG_PSEUDO_XORWOW`* |*`HIPRAND_RNG_PSEUDO_XORWOW`* | 401 | -| 121 |*`CURAND_RNG_PSEUDO_MRG32K3A`* |*`HIPRAND_RNG_PSEUDO_MRG32K3A`* | 402 | -| 141 |*`CURAND_RNG_PSEUDO_MTGP32`* |*`HIPRAND_RNG_PSEUDO_MTGP32`* | 403 | -| 142 |*`CURAND_RNG_PSEUDO_MT19937`* |*`HIPRAND_RNG_PSEUDO_MT19937`* | 404 | -| 161 |*`CURAND_RNG_PSEUDO_PHILOX4_32_10`* |*`HIPRAND_RNG_PSEUDO_PHILOX4_32_10`* | 405 | -| 200 |*`CURAND_RNG_QUASI_DEFAULT`* |*`HIPRAND_RNG_QUASI_DEFAULT`* | 500 | -| 201 |*`CURAND_RNG_QUASI_SOBOL32`* |*`HIPRAND_RNG_QUASI_SOBOL32`* | 501 | -| 202 |*`CURAND_RNG_QUASI_SCRAMBLED_SOBOL32`* |*`HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL32`* | 502 | -| 203 |*`CURAND_RNG_QUASI_SOBOL64`* |*`HIPRAND_RNG_QUASI_SOBOL64`* | 503 | -| 204 |*`CURAND_RNG_QUASI_SCRAMBLED_SOBOL64`* |*`HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL64`* | 504 | -| enum |***`curandOrdering`*** | | -| enum |***`curandOrdering_t`*** | | -| 100 |*`CURAND_ORDERING_PSEUDO_BEST`* | | -| 101 |*`CURAND_ORDERING_PSEUDO_DEFAULT`* | | -| 102 |*`CURAND_ORDERING_PSEUDO_SEEDED`* | | -| 201 |*`CURAND_ORDERING_QUASI_DEFAULT`* | | -| enum |***`curandDirectionVectorSet`*** | | -| enum |***`curandDirectionVectorSet_t`*** | | -| 101 |*`CURAND_DIRECTION_VECTORS_32_JOEKUO6`* | | -| 102 |*`CURAND_SCRAMBLED_DIRECTION_VECTORS_32_JOEKUO6`* | | -| 103 |*`CURAND_DIRECTION_VECTORS_64_JOEKUO6`* | | -| 104 |*`CURAND_SCRAMBLED_DIRECTION_VECTORS_64_JOEKUO6`* | | -| uint | `curandDirectionVectors32_t` | `hiprandDirectionVectors32_t` | -| uint | `curandDirectionVectors64_t` | | -| struct | `curandGenerator_st` | `hiprandGenerator_st` | -| struct* | `curandGenerator_t` | `hiprandGenerator_t` | -| enum |***`curandOrdering`*** | | -| enum |***`curandOrdering_t`*** | | -| 100 |*`CURAND_ORDERING_PSEUDO_BEST`* | | -| 101 |*`CURAND_ORDERING_PSEUDO_DEFAULT`* | | -| 102 |*`CURAND_ORDERING_PSEUDO_SEEDED`* | | -| 201 |*`CURAND_ORDERING_QUASI_DEFAULT`* | | -| enum |***`curandDirectionVectorSet`*** | | -| enum |***`curandDirectionVectorSet_t`*** | | -| 101 |*`CURAND_DIRECTION_VECTORS_32_JOEKUO6`* | | -| 102 |*`CURAND_SCRAMBLED_DIRECTION_VECTORS_32_JOEKUO6`* | | -| 103 |*`CURAND_DIRECTION_VECTORS_64_JOEKUO6`* | | -| 104 |*`CURAND_SCRAMBLED_DIRECTION_VECTORS_64_JOEKUO6`* | | -| uint | `curandDirectionVectors32_t` | `hiprandDirectionVectors32_t` | -| uint | `curandDirectionVectors64_t` | | -| double | `curandDistribution_st` | | -| double | `curandHistogramM2V_st` | | -| double* | `curandDistribution_t` | | -| double* | `curandHistogramM2V_t` | | -| struct | `curandDistributionShift_st` | | -| struct* | `curandDistributionShift_t` | | -| struct | `curandDistributionM2Shift_st` | | -| struct* | `curandDistributionM2Shift_t` | | -| struct | `curandHistogramM2_st` | | -| struct* | `curandHistogramM2_t` | | -| uint | `curandHistogramM2K_st` | | -| uint* | `curandHistogramM2K_t` | | -| struct | `curandDiscreteDistribution_st` | `hiprandDiscreteDistribution_st` | -| struct* | `curandDiscreteDistribution_t` | `hiprandDiscreteDistribution_t` | -| enum |***`curandMethod`*** | | -| enum |***`curandMethod_t`*** | | -| 0 |*`CURAND_CHOOSE_BEST`* | | -| 1 |*`CURAND_ITR`* | | -| 2 |*`CURAND_KNUTH`* | | -| 3 |*`CURAND_HITR`* | | -| 4 |*`CURAND_M1`* | | -| 5 |*`CURAND_M2`* | | -| 6 |*`CURAND_BINARY_SEARCH`* | | -| 7 |*`CURAND_DISCRETE_GAUSS`* | | -| 8 |*`CURAND_REJECTION`* | | -| 9 |*`CURAND_DEVICE_API`* | | -| 10 |*`CURAND_FAST_REJECTION`* | | -| 11 |*`CURAND_3RD`* | | -| 12 |*`CURAND_DEFINITION`* | | -| 13 |*`CURAND_POISSON`* | | -| struct | `curandStateMtgp32` | `hiprandStateMtgp32` | -| typedef | `curandStateMtgp32_t` | `hiprandStateMtgp32_t` | -| struct | `curandStateScrambledSobol64` | | -| typedef | `curandStateScrambledSobol64_t` | | -| struct | `curandStateSobol64` | | -| typedef | `curandStateSobol64_t` | | -| struct | `curandStateScrambledSobol32` | | -| typedef | `curandStateScrambledSobol32_t` | | -| struct | `curandStateSobol32` | `hiprandStateSobol32` | -| typedef | `curandStateSobol32_t` | `hiprandStateSobol32_t` | -| struct | `curandStateMRG32k3a` | `hiprandStateMRG32k3a` | -| typedef | `curandStateMRG32k3a_t` | `hiprandStateMRG32k3a_t` | -| struct | `curandStatePhilox4_32_10` | `hiprandStatePhilox4_32_10` | -| typedef | `curandStatePhilox4_32_10_t` | `hiprandStatePhilox4_32_10_t` | -| struct | `curandStateXORWOW` | `hiprandStateXORWOW` | -| typedef | `curandStateXORWOW_t` | `hiprandStateXORWOW_t` | -| struct | `curandState` | `hiprandState` | -| typedef | `curandState_t` | `hiprandState_t` | +| **type** | **CUDA** |**CUDA version\***| **HIP** | **HIP value** (if differs) | +|-------------:|---------------------------------------------------------------|:----------------:|------------------------------------------------------------|----------------------------| +| define |`CURAND_VER_MAJOR` | 10.1 Update 2 | | +| define |`CURAND_VER_MINOR` | 10.1 Update 2 | | +| define |`CURAND_VER_PATCH` | 10.1 Update 2 | | +| define |`CURAND_VER_BUILD` | 10.1 Update 2 | | +| define |`CURAND_VERSION` | 10.1 Update 2 | | +| enum |***`curandStatus`*** | |***`hiprandStatus`*** | +| enum |***`curandStatus_t`*** | |***`hiprandStatus_t`*** | +| 0 |*`CURAND_STATUS_SUCCESS`* | |*`HIPRAND_STATUS_SUCCESS`* | +| 100 |*`CURAND_STATUS_VERSION_MISMATCH`* | |*`HIPRAND_STATUS_VERSION_MISMATCH`* | +| 101 |*`CURAND_STATUS_NOT_INITIALIZED`* | |*`HIPRAND_STATUS_NOT_INITIALIZED`* | +| 102 |*`CURAND_STATUS_ALLOCATION_FAILED`* | |*`HIPRAND_STATUS_ALLOCATION_FAILED`* | +| 103 |*`CURAND_STATUS_TYPE_ERROR`* | |*`HIPRAND_STATUS_TYPE_ERROR`* | +| 104 |*`CURAND_STATUS_OUT_OF_RANGE`* | |*`HIPRAND_STATUS_OUT_OF_RANGE`* | +| 105 |*`CURAND_STATUS_LENGTH_NOT_MULTIPLE`* | |*`HIPRAND_STATUS_LENGTH_NOT_MULTIPLE`* | +| 106 |*`CURAND_STATUS_DOUBLE_PRECISION_REQUIRED`* | |*`HIPRAND_STATUS_DOUBLE_PRECISION_REQUIRED`* | +| 201 |*`CURAND_STATUS_LAUNCH_FAILURE`* | |*`HIPRAND_STATUS_LAUNCH_FAILURE`* | +| 202 |*`CURAND_STATUS_PREEXISTING_FAILURE`* | |*`HIPRAND_STATUS_PREEXISTING_FAILURE`* | +| 203 |*`CURAND_STATUS_INITIALIZATION_FAILED`* | |*`HIPRAND_STATUS_INITIALIZATION_FAILED`* | +| 204 |*`CURAND_STATUS_ARCH_MISMATCH`* | |*`HIPRAND_STATUS_ARCH_MISMATCH`* | +| 999 |*`CURAND_STATUS_INTERNAL_ERROR`* | |*`HIPRAND_STATUS_INTERNAL_ERROR`* | +| enum |***`curandRngType`*** | |***`hiprandRngType`*** | +| enum |***`curandRngType_t`*** | |***`hiprandRngType_t`*** | +| 0 |*`CURAND_RNG_TEST`* | |*`HIPRAND_RNG_TEST`* | +| 100 |*`CURAND_RNG_PSEUDO_DEFAULT`* | |*`HIPRAND_RNG_PSEUDO_DEFAULT`* | 400 | +| 101 |*`CURAND_RNG_PSEUDO_XORWOW`* | |*`HIPRAND_RNG_PSEUDO_XORWOW`* | 401 | +| 121 |*`CURAND_RNG_PSEUDO_MRG32K3A`* | |*`HIPRAND_RNG_PSEUDO_MRG32K3A`* | 402 | +| 141 |*`CURAND_RNG_PSEUDO_MTGP32`* | |*`HIPRAND_RNG_PSEUDO_MTGP32`* | 403 | +| 142 |*`CURAND_RNG_PSEUDO_MT19937`* | |*`HIPRAND_RNG_PSEUDO_MT19937`* | 404 | +| 161 |*`CURAND_RNG_PSEUDO_PHILOX4_32_10`* | |*`HIPRAND_RNG_PSEUDO_PHILOX4_32_10`* | 405 | +| 200 |*`CURAND_RNG_QUASI_DEFAULT`* | |*`HIPRAND_RNG_QUASI_DEFAULT`* | 500 | +| 201 |*`CURAND_RNG_QUASI_SOBOL32`* | |*`HIPRAND_RNG_QUASI_SOBOL32`* | 501 | +| 202 |*`CURAND_RNG_QUASI_SCRAMBLED_SOBOL32`* | |*`HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL32`* | 502 | +| 203 |*`CURAND_RNG_QUASI_SOBOL64`* | |*`HIPRAND_RNG_QUASI_SOBOL64`* | 503 | +| 204 |*`CURAND_RNG_QUASI_SCRAMBLED_SOBOL64`* | |*`HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL64`* | 504 | +| enum |***`curandOrdering`*** | | | +| enum |***`curandOrdering_t`*** | | | +| 100 |*`CURAND_ORDERING_PSEUDO_BEST`* | | | +| 101 |*`CURAND_ORDERING_PSEUDO_DEFAULT`* | | | +| 102 |*`CURAND_ORDERING_PSEUDO_SEEDED`* | | | +| 201 |*`CURAND_ORDERING_QUASI_DEFAULT`* | | | +| enum |***`curandDirectionVectorSet`*** | | | +| enum |***`curandDirectionVectorSet_t`*** | | | +| 101 |*`CURAND_DIRECTION_VECTORS_32_JOEKUO6`* | | | +| 102 |*`CURAND_SCRAMBLED_DIRECTION_VECTORS_32_JOEKUO6`* | | | +| 103 |*`CURAND_DIRECTION_VECTORS_64_JOEKUO6`* | | | +| 104 |*`CURAND_SCRAMBLED_DIRECTION_VECTORS_64_JOEKUO6`* | | | +| uint | `curandDirectionVectors32_t` | | `hiprandDirectionVectors32_t` | +| uint | `curandDirectionVectors64_t` | | | +| struct | `curandGenerator_st` | | `hiprandGenerator_st` | +| struct* | `curandGenerator_t` | | `hiprandGenerator_t` | +| enum |***`curandOrdering`*** | | | +| enum |***`curandOrdering_t`*** | | | +| 100 |*`CURAND_ORDERING_PSEUDO_BEST`* | | | +| 101 |*`CURAND_ORDERING_PSEUDO_DEFAULT`* | | | +| 102 |*`CURAND_ORDERING_PSEUDO_SEEDED`* | | | +| 201 |*`CURAND_ORDERING_QUASI_DEFAULT`* | | | +| enum |***`curandDirectionVectorSet`*** | | | +| enum |***`curandDirectionVectorSet_t`*** | | | +| 101 |*`CURAND_DIRECTION_VECTORS_32_JOEKUO6`* | | | +| 102 |*`CURAND_SCRAMBLED_DIRECTION_VECTORS_32_JOEKUO6`* | | | +| 103 |*`CURAND_DIRECTION_VECTORS_64_JOEKUO6`* | | | +| 104 |*`CURAND_SCRAMBLED_DIRECTION_VECTORS_64_JOEKUO6`* | | | +| uint | `curandDirectionVectors32_t` | | `hiprandDirectionVectors32_t` | +| uint | `curandDirectionVectors64_t` | | | +| double | `curandDistribution_st` | | | +| double | `curandHistogramM2V_st` | | | +| double* | `curandDistribution_t` | | | +| double* | `curandHistogramM2V_t` | | | +| struct | `curandDistributionShift_st` | | | +| struct* | `curandDistributionShift_t` | | | +| struct | `curandDistributionM2Shift_st` | | | +| struct* | `curandDistributionM2Shift_t` | | | +| struct | `curandHistogramM2_st` | | | +| struct* | `curandHistogramM2_t` | | | +| uint | `curandHistogramM2K_st` | | | +| uint* | `curandHistogramM2K_t` | | | +| struct | `curandDiscreteDistribution_st` | | `hiprandDiscreteDistribution_st` | +| struct* | `curandDiscreteDistribution_t` | | `hiprandDiscreteDistribution_t` | +| enum |***`curandMethod`*** | | | +| enum |***`curandMethod_t`*** | | | +| 0 |*`CURAND_CHOOSE_BEST`* | | | +| 1 |*`CURAND_ITR`* | | | +| 2 |*`CURAND_KNUTH`* | | | +| 3 |*`CURAND_HITR`* | | | +| 4 |*`CURAND_M1`* | | | +| 5 |*`CURAND_M2`* | | | +| 6 |*`CURAND_BINARY_SEARCH`* | | | +| 7 |*`CURAND_DISCRETE_GAUSS`* | | | +| 8 |*`CURAND_REJECTION`* | | | +| 9 |*`CURAND_DEVICE_API`* | | | +| 10 |*`CURAND_FAST_REJECTION`* | | | +| 11 |*`CURAND_3RD`* | | | +| 12 |*`CURAND_DEFINITION`* | | | +| 13 |*`CURAND_POISSON`* | | | +| struct | `curandStateMtgp32` | | `hiprandStateMtgp32` | +| typedef | `curandStateMtgp32_t` | | `hiprandStateMtgp32_t` | +| struct | `curandStateScrambledSobol64` | | | +| typedef | `curandStateScrambledSobol64_t` | | | +| struct | `curandStateSobol64` | | | +| typedef | `curandStateSobol64_t` | | | +| struct | `curandStateScrambledSobol32` | | | +| typedef | `curandStateScrambledSobol32_t` | | | +| struct | `curandStateSobol32` | | `hiprandStateSobol32` | +| typedef | `curandStateSobol32_t` | | `hiprandStateSobol32_t` | +| struct | `curandStateMRG32k3a` | | `hiprandStateMRG32k3a` | +| typedef | `curandStateMRG32k3a_t` | | `hiprandStateMRG32k3a_t` | +| struct | `curandStatePhilox4_32_10` | | `hiprandStatePhilox4_32_10` | +| typedef | `curandStatePhilox4_32_10_t` | | `hiprandStatePhilox4_32_10_t` | +| struct | `curandStateXORWOW` | | `hiprandStateXORWOW` | +| typedef | `curandStateXORWOW_t` | | `hiprandStateXORWOW_t` | +| struct | `curandState` | | `hiprandState` | +| typedef | `curandState_t` | | `hiprandState_t` | ## **2. Host API Functions** diff --git a/docs/markdown/CUSPARSE_API_supported_by_HIP.md b/docs/markdown/CUSPARSE_API_supported_by_HIP.md index f8a9d27b07..3a25acc20c 100644 --- a/docs/markdown/CUSPARSE_API_supported_by_HIP.md +++ b/docs/markdown/CUSPARSE_API_supported_by_HIP.md @@ -4,6 +4,11 @@ | **type** | **CUDA** |**CUDA version\***| **HIP** | |-------------:|---------------------------------------------------------------|:-----------------|------------------------------------------------------------| +| define |`CUSPARSE_VER_MAJOR` | 10.1 Update 2 | | +| define |`CUSPARSE_VER_MINOR` | 10.1 Update 2 | | +| define |`CUSPARSE_VER_PATCH` | 10.1 Update 2 | | +| define |`CUSPARSE_VER_BUILD` | 10.1 Update 2 | | +| define |`CUSPARSE_VERSION` | 10.1 Update 2 | | | enum |***`cusparseAction_t`*** | |***`hipsparseAction_t`*** | | 0 |*`CUSPARSE_ACTION_SYMBOLIC`* | |*`HIPSPARSE_ACTION_SYMBOLIC`* | | 1 |*`CUSPARSE_ACTION_NUMERIC`* | |*`HIPSPARSE_ACTION_NUMERIC`* | diff --git a/hipify-clang/src/CUDA2HIP_BLAS_API_types.cpp b/hipify-clang/src/CUDA2HIP_BLAS_API_types.cpp index 2e2168efa0..6785b1d41b 100644 --- a/hipify-clang/src/CUDA2HIP_BLAS_API_types.cpp +++ b/hipify-clang/src/CUDA2HIP_BLAS_API_types.cpp @@ -24,6 +24,13 @@ THE SOFTWARE. // Map of all functions const std::map CUDA_BLAS_TYPE_NAME_MAP{ + // Blas defines + {"CUBLAS_VER_MAJOR", {"HIPBLAS_VER_MAJOR", "", CONV_DEFINE, API_BLAS, HIP_UNSUPPORTED}}, + {"CUBLAS_VER_MINOR", {"HIPBLAS_VER_MINOR", "", CONV_DEFINE, API_BLAS, HIP_UNSUPPORTED}}, + {"CUBLAS_VER_PATCH", {"HIPBLAS_VER_PATCH", "", CONV_DEFINE, API_BLAS, HIP_UNSUPPORTED}}, + {"CUBLAS_VER_BUILD", {"HIPBLAS_VER_BUILD", "", CONV_DEFINE, API_BLAS, HIP_UNSUPPORTED}}, + {"CUBLAS_VERSION", {"HIPBLAS_VERSION", "", CONV_DEFINE, API_BLAS, HIP_UNSUPPORTED}}, + // Blas operations {"cublasOperation_t", {"hipblasOperation_t", "rocblas_operation", CONV_TYPE, API_BLAS}}, {"CUBLAS_OP_N", {"HIPBLAS_OP_N", "rocblas_operation_none", CONV_NUMERIC_LITERAL, API_BLAS}}, diff --git a/hipify-clang/src/CUDA2HIP_RAND_API_types.cpp b/hipify-clang/src/CUDA2HIP_RAND_API_types.cpp index e6eae1db69..67ecc93504 100644 --- a/hipify-clang/src/CUDA2HIP_RAND_API_types.cpp +++ b/hipify-clang/src/CUDA2HIP_RAND_API_types.cpp @@ -24,6 +24,14 @@ THE SOFTWARE. // Map of all functions const std::map CUDA_RAND_TYPE_NAME_MAP{ + // RAND defines + {"CURAND_VER_MAJOR", {"HIPRAND_VER_MAJOR", "", CONV_DEFINE, API_RAND, HIP_UNSUPPORTED}}, + {"CURAND_VER_MINOR", {"HIPRAND_VER_MINOR", "", CONV_DEFINE, API_RAND, HIP_UNSUPPORTED}}, + {"CURAND_VER_PATCH", {"HIPRAND_VER_PATCH", "", CONV_DEFINE, API_RAND, HIP_UNSUPPORTED}}, + {"CURAND_VER_BUILD", {"HIPRAND_VER_BUILD", "", CONV_DEFINE, API_RAND, HIP_UNSUPPORTED}}, + {"CURAND_VERSION", {"HIPRAND_VERSION", "", CONV_DEFINE, API_RAND, HIP_UNSUPPORTED}}, + + // RAND Host types {"curandStatus", {"hiprandStatus_t", "", CONV_TYPE, API_RAND}}, {"curandStatus_t", {"hiprandStatus_t", "", CONV_TYPE, API_RAND}}, {"curandRngType", {"hiprandRngType_t", "", CONV_TYPE, API_RAND}}, @@ -52,7 +60,8 @@ const std::map CUDA_RAND_TYPE_NAME_MAP{ {"curandMethod_t", {"hiprandMethod_t", "", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, {"curandDirectionVectors32_t", {"hiprandDirectionVectors32_t", "", CONV_TYPE, API_RAND}}, {"curandDirectionVectors64_t", {"hiprandDirectionVectors64_t", "", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, - // cuRAND types for Device functions + + // RAND types for Device functions {"curandStateMtgp32", {"hiprandStateMtgp32", "", CONV_TYPE, API_RAND}}, {"curandStateMtgp32_t", {"hiprandStateMtgp32_t", "", CONV_TYPE, API_RAND}}, {"curandStateScrambledSobol64", {"hiprandStateScrambledSobol64", "", CONV_TYPE, API_RAND, HIP_UNSUPPORTED}}, diff --git a/hipify-clang/src/CUDA2HIP_SPARSE_API_types.cpp b/hipify-clang/src/CUDA2HIP_SPARSE_API_types.cpp index 4a6e91288f..f9e3920af4 100644 --- a/hipify-clang/src/CUDA2HIP_SPARSE_API_types.cpp +++ b/hipify-clang/src/CUDA2HIP_SPARSE_API_types.cpp @@ -175,4 +175,10 @@ const std::map CUDA_SPARSE_TYPE_NAME_MAP{ {"CUSPARSE_INDEX_32I", {"HIPSPARSE_INDEX_32I", "", CONV_NUMERIC_LITERAL, API_SPARSE, HIP_UNSUPPORTED}}, {"CUSPARSE_INDEX_64I", {"HIPSPARSE_INDEX_64I", "", CONV_NUMERIC_LITERAL, API_SPARSE, HIP_UNSUPPORTED}}, + // 3. Defines + {"CUSPARSE_VER_MAJOR", {"HIPSPARSE_VER_MAJOR", "", CONV_DEFINE, API_SPARSE, HIP_UNSUPPORTED}}, + {"CUSPARSE_VER_MINOR", {"HIPSPARSE_VER_MINOR", "", CONV_DEFINE, API_SPARSE, HIP_UNSUPPORTED}}, + {"CUSPARSE_VER_PATCH", {"HIPSPARSE_VER_PATCH", "", CONV_DEFINE, API_SPARSE, HIP_UNSUPPORTED}}, + {"CUSPARSE_VER_BUILD", {"HIPSPARSE_VER_BUILD", "", CONV_DEFINE, API_SPARSE, HIP_UNSUPPORTED}}, + {"CUSPARSE_VERSION", {"HIPSPARSE_VERSION", "", CONV_DEFINE, API_SPARSE, HIP_UNSUPPORTED}}, };