diff --git a/bin/hipify-perl b/bin/hipify-perl index 34f1d9e7..83ebd225 100755 --- a/bin/hipify-perl +++ b/bin/hipify-perl @@ -3206,6 +3206,8 @@ sub rocSubstitutions { subst("cudnnStatus_t", "miopenStatus_t", "type"); subst("cudnnTensorDescriptor_t", "miopenTensorDescriptor_t", "type"); subst("cudnnTensorFormat_t", "miopenTensorLayout_t", "type"); + subst("curandRngType", "rocrand_rng_type", "type"); + subst("curandRngType_t", "rocrand_rng_type", "type"); subst("curandStatus", "rocrand_status", "type"); subst("curandStatus_t", "rocrand_status", "type"); subst("cusolverDnHandle_t", "rocblas_handle", "type"); @@ -3436,6 +3438,17 @@ sub rocSubstitutions { subst("CUDNN_TYPE_TENSOR_REORDERING_MODE", "MIOPEN_TYPE_TENSOR_REORDERING_MODE", "numeric_literal"); subst("CUDNN_TYPE_VOID_PTR", "MIOPEN_TYPE_VOID_PTR", "numeric_literal"); subst("CUDNN_UNIDIRECTIONAL", "miopenRNNunidirection", "numeric_literal"); + subst("CURAND_RNG_PSEUDO_DEFAULT", "ROCRAND_RNG_PSEUDO_DEFAULT", "numeric_literal"); + subst("CURAND_RNG_PSEUDO_MRG32K3A", "ROCRAND_RNG_PSEUDO_MRG32K3A", "numeric_literal"); + subst("CURAND_RNG_PSEUDO_MT19937", "ROCRAND_RNG_PSEUDO_MT19937", "numeric_literal"); + subst("CURAND_RNG_PSEUDO_MTGP32", "ROCRAND_RNG_PSEUDO_MTGP32", "numeric_literal"); + subst("CURAND_RNG_PSEUDO_PHILOX4_32_10", "ROCRAND_RNG_PSEUDO_PHILOX4_32_10", "numeric_literal"); + subst("CURAND_RNG_PSEUDO_XORWOW", "ROCRAND_RNG_PSEUDO_XORWOW", "numeric_literal"); + subst("CURAND_RNG_QUASI_DEFAULT", "ROCRAND_RNG_QUASI_DEFAULT", "numeric_literal"); + subst("CURAND_RNG_QUASI_SCRAMBLED_SOBOL32", "ROCRAND_RNG_QUASI_SCRAMBLED_SOBOL32", "numeric_literal"); + subst("CURAND_RNG_QUASI_SCRAMBLED_SOBOL64", "ROCRAND_RNG_QUASI_SCRAMBLED_SOBOL64", "numeric_literal"); + subst("CURAND_RNG_QUASI_SOBOL32", "ROCRAND_RNG_QUASI_SOBOL32", "numeric_literal"); + subst("CURAND_RNG_QUASI_SOBOL64", "ROCRAND_RNG_QUASI_SOBOL64", "numeric_literal"); subst("CURAND_STATUS_ALLOCATION_FAILED", "ROCRAND_STATUS_ALLOCATION_FAILED", "numeric_literal"); subst("CURAND_STATUS_DOUBLE_PRECISION_REQUIRED", "ROCRAND_STATUS_DOUBLE_PRECISION_REQUIRED", "numeric_literal"); subst("CURAND_STATUS_INTERNAL_ERROR", "ROCRAND_STATUS_INTERNAL_ERROR", "numeric_literal"); diff --git a/docs/tables/CURAND_API_supported_by_HIP_and_ROC.md b/docs/tables/CURAND_API_supported_by_HIP_and_ROC.md index 2b69c164..5fd746cd 100644 --- a/docs/tables/CURAND_API_supported_by_HIP_and_ROC.md +++ b/docs/tables/CURAND_API_supported_by_HIP_and_ROC.md @@ -26,17 +26,17 @@ |`CURAND_ORDERING_QUASI_DEFAULT`| | | | |`HIPRAND_ORDERING_QUASI_DEFAULT`|6.2.0| | | |6.2.0| | | | | | | |`CURAND_POISSON`| | | | | | | | | | | | | | | | | |`CURAND_REJECTION`| | | | | | | | | | | | | | | | | -|`CURAND_RNG_PSEUDO_DEFAULT`| | | | |`HIPRAND_RNG_PSEUDO_DEFAULT`|1.5.0| | | | | | | | | | | -|`CURAND_RNG_PSEUDO_MRG32K3A`| | | | |`HIPRAND_RNG_PSEUDO_MRG32K3A`|1.5.0| | | | | | | | | | | -|`CURAND_RNG_PSEUDO_MT19937`| | | | |`HIPRAND_RNG_PSEUDO_MT19937`|1.5.0| | | | | | | | | | | -|`CURAND_RNG_PSEUDO_MTGP32`| | | | |`HIPRAND_RNG_PSEUDO_MTGP32`|1.5.0| | | | | | | | | | | -|`CURAND_RNG_PSEUDO_PHILOX4_32_10`| | | | |`HIPRAND_RNG_PSEUDO_PHILOX4_32_10`|1.5.0| | | | | | | | | | | -|`CURAND_RNG_PSEUDO_XORWOW`| | | | |`HIPRAND_RNG_PSEUDO_XORWOW`|1.5.0| | | | | | | | | | | -|`CURAND_RNG_QUASI_DEFAULT`| | | | |`HIPRAND_RNG_QUASI_DEFAULT`|1.5.0| | | | | | | | | | | -|`CURAND_RNG_QUASI_SCRAMBLED_SOBOL32`| | | | |`HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL32`|1.5.0| | | | | | | | | | | -|`CURAND_RNG_QUASI_SCRAMBLED_SOBOL64`| | | | |`HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL64`|1.5.0| | | | | | | | | | | -|`CURAND_RNG_QUASI_SOBOL32`| | | | |`HIPRAND_RNG_QUASI_SOBOL32`|1.5.0| | | | | | | | | | | -|`CURAND_RNG_QUASI_SOBOL64`| | | | |`HIPRAND_RNG_QUASI_SOBOL64`|1.5.0| | | | | | | | | | | +|`CURAND_RNG_PSEUDO_DEFAULT`| | | | |`HIPRAND_RNG_PSEUDO_DEFAULT`|1.5.0| | | | |`ROCRAND_RNG_PSEUDO_DEFAULT`|1.5.0| | | | | +|`CURAND_RNG_PSEUDO_MRG32K3A`| | | | |`HIPRAND_RNG_PSEUDO_MRG32K3A`|1.5.0| | | | |`ROCRAND_RNG_PSEUDO_MRG32K3A`|1.5.0| | | | | +|`CURAND_RNG_PSEUDO_MT19937`| | | | |`HIPRAND_RNG_PSEUDO_MT19937`|1.5.0| | | | |`ROCRAND_RNG_PSEUDO_MT19937`|5.5.0| | | | | +|`CURAND_RNG_PSEUDO_MTGP32`| | | | |`HIPRAND_RNG_PSEUDO_MTGP32`|1.5.0| | | | |`ROCRAND_RNG_PSEUDO_MTGP32`|1.5.0| | | | | +|`CURAND_RNG_PSEUDO_PHILOX4_32_10`| | | | |`HIPRAND_RNG_PSEUDO_PHILOX4_32_10`|1.5.0| | | | |`ROCRAND_RNG_PSEUDO_PHILOX4_32_10`|1.5.0| | | | | +|`CURAND_RNG_PSEUDO_XORWOW`| | | | |`HIPRAND_RNG_PSEUDO_XORWOW`|1.5.0| | | | |`ROCRAND_RNG_PSEUDO_XORWOW`|1.5.0| | | | | +|`CURAND_RNG_QUASI_DEFAULT`| | | | |`HIPRAND_RNG_QUASI_DEFAULT`|1.5.0| | | | |`ROCRAND_RNG_QUASI_DEFAULT`|1.5.0| | | | | +|`CURAND_RNG_QUASI_SCRAMBLED_SOBOL32`| | | | |`HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL32`|1.5.0| | | | |`ROCRAND_RNG_QUASI_SCRAMBLED_SOBOL32`|5.4.0| | | | | +|`CURAND_RNG_QUASI_SCRAMBLED_SOBOL64`| | | | |`HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL64`|1.5.0| | | | |`ROCRAND_RNG_QUASI_SCRAMBLED_SOBOL64`|5.4.0| | | | | +|`CURAND_RNG_QUASI_SOBOL32`| | | | |`HIPRAND_RNG_QUASI_SOBOL32`|1.5.0| | | | |`ROCRAND_RNG_QUASI_SOBOL32`|1.5.0| | | | | +|`CURAND_RNG_QUASI_SOBOL64`| | | | |`HIPRAND_RNG_QUASI_SOBOL64`|1.5.0| | | | |`ROCRAND_RNG_QUASI_SOBOL64`|4.5.0| | | | | |`CURAND_RNG_TEST`| | | | |`HIPRAND_RNG_TEST`|1.5.0| | | | | | | | | | | |`CURAND_SCRAMBLED_DIRECTION_VECTORS_32_JOEKUO6`| | | | |`HIPRAND_SCRAMBLED_DIRECTION_VECTORS_32_JOEKUO6`|6.0.0| | | | | | | | | | | |`CURAND_SCRAMBLED_DIRECTION_VECTORS_64_JOEKUO6`| | | | |`HIPRAND_SCRAMBLED_DIRECTION_VECTORS_64_JOEKUO6`|6.0.0| | | | | | | | | | | @@ -77,8 +77,8 @@ |`curandMethod_t`| | | | | | | | | | | | | | | | | |`curandOrdering`| | | | |`hiprandOrdering`|6.2.0| | | |6.2.0| | | | | | | |`curandOrdering_t`| | | | |`hiprandOrdering_t`|6.2.0| | | |6.2.0| | | | | | | -|`curandRngType`| | | | |`hiprandRngType_t`|1.5.0| | | | | | | | | | | -|`curandRngType_t`| | | | |`hiprandRngType_t`|1.5.0| | | | | | | | | | | +|`curandRngType`| | | | |`hiprandRngType_t`|1.5.0| | | | |`rocrand_rng_type`|1.5.0| | | | | +|`curandRngType_t`| | | | |`hiprandRngType_t`|1.5.0| | | | |`rocrand_rng_type`|1.5.0| | | | | |`curandState`| | | | |`hiprandState`|1.8.0| | | | | | | | | | | |`curandStateMRG32k3a`| | | | |`hiprandStateMRG32k3a`|1.8.0| | | | | | | | | | | |`curandStateMRG32k3a_t`| | | | |`hiprandStateMRG32k3a_t`|1.5.0| | | | | | | | | | | diff --git a/docs/tables/CURAND_API_supported_by_ROC.md b/docs/tables/CURAND_API_supported_by_ROC.md index 7b0e22d4..a21817f8 100644 --- a/docs/tables/CURAND_API_supported_by_ROC.md +++ b/docs/tables/CURAND_API_supported_by_ROC.md @@ -26,17 +26,17 @@ |`CURAND_ORDERING_QUASI_DEFAULT`| | | | | | | | | | | |`CURAND_POISSON`| | | | | | | | | | | |`CURAND_REJECTION`| | | | | | | | | | | -|`CURAND_RNG_PSEUDO_DEFAULT`| | | | | | | | | | | -|`CURAND_RNG_PSEUDO_MRG32K3A`| | | | | | | | | | | -|`CURAND_RNG_PSEUDO_MT19937`| | | | | | | | | | | -|`CURAND_RNG_PSEUDO_MTGP32`| | | | | | | | | | | -|`CURAND_RNG_PSEUDO_PHILOX4_32_10`| | | | | | | | | | | -|`CURAND_RNG_PSEUDO_XORWOW`| | | | | | | | | | | -|`CURAND_RNG_QUASI_DEFAULT`| | | | | | | | | | | -|`CURAND_RNG_QUASI_SCRAMBLED_SOBOL32`| | | | | | | | | | | -|`CURAND_RNG_QUASI_SCRAMBLED_SOBOL64`| | | | | | | | | | | -|`CURAND_RNG_QUASI_SOBOL32`| | | | | | | | | | | -|`CURAND_RNG_QUASI_SOBOL64`| | | | | | | | | | | +|`CURAND_RNG_PSEUDO_DEFAULT`| | | | |`ROCRAND_RNG_PSEUDO_DEFAULT`|1.5.0| | | | | +|`CURAND_RNG_PSEUDO_MRG32K3A`| | | | |`ROCRAND_RNG_PSEUDO_MRG32K3A`|1.5.0| | | | | +|`CURAND_RNG_PSEUDO_MT19937`| | | | |`ROCRAND_RNG_PSEUDO_MT19937`|5.5.0| | | | | +|`CURAND_RNG_PSEUDO_MTGP32`| | | | |`ROCRAND_RNG_PSEUDO_MTGP32`|1.5.0| | | | | +|`CURAND_RNG_PSEUDO_PHILOX4_32_10`| | | | |`ROCRAND_RNG_PSEUDO_PHILOX4_32_10`|1.5.0| | | | | +|`CURAND_RNG_PSEUDO_XORWOW`| | | | |`ROCRAND_RNG_PSEUDO_XORWOW`|1.5.0| | | | | +|`CURAND_RNG_QUASI_DEFAULT`| | | | |`ROCRAND_RNG_QUASI_DEFAULT`|1.5.0| | | | | +|`CURAND_RNG_QUASI_SCRAMBLED_SOBOL32`| | | | |`ROCRAND_RNG_QUASI_SCRAMBLED_SOBOL32`|5.4.0| | | | | +|`CURAND_RNG_QUASI_SCRAMBLED_SOBOL64`| | | | |`ROCRAND_RNG_QUASI_SCRAMBLED_SOBOL64`|5.4.0| | | | | +|`CURAND_RNG_QUASI_SOBOL32`| | | | |`ROCRAND_RNG_QUASI_SOBOL32`|1.5.0| | | | | +|`CURAND_RNG_QUASI_SOBOL64`| | | | |`ROCRAND_RNG_QUASI_SOBOL64`|4.5.0| | | | | |`CURAND_RNG_TEST`| | | | | | | | | | | |`CURAND_SCRAMBLED_DIRECTION_VECTORS_32_JOEKUO6`| | | | | | | | | | | |`CURAND_SCRAMBLED_DIRECTION_VECTORS_64_JOEKUO6`| | | | | | | | | | | @@ -77,8 +77,8 @@ |`curandMethod_t`| | | | | | | | | | | |`curandOrdering`| | | | | | | | | | | |`curandOrdering_t`| | | | | | | | | | | -|`curandRngType`| | | | | | | | | | | -|`curandRngType_t`| | | | | | | | | | | +|`curandRngType`| | | | |`rocrand_rng_type`|1.5.0| | | | | +|`curandRngType_t`| | | | |`rocrand_rng_type`|1.5.0| | | | | |`curandState`| | | | | | | | | | | |`curandStateMRG32k3a`| | | | | | | | | | | |`curandStateMRG32k3a_t`| | | | | | | | | | | diff --git a/src/CUDA2HIP_RAND_API_types.cpp b/src/CUDA2HIP_RAND_API_types.cpp index 3621519f..488b8511 100644 --- a/src/CUDA2HIP_RAND_API_types.cpp +++ b/src/CUDA2HIP_RAND_API_types.cpp @@ -27,8 +27,37 @@ const std::map CUDA_RAND_TYPE_NAME_MAP { // RAND Host types {"curandStatus", {"hiprandStatus", "rocrand_status", CONV_TYPE, API_RAND, 1}}, {"curandStatus_t", {"hiprandStatus_t", "rocrand_status", CONV_TYPE, API_RAND, 1}}, - {"curandRngType", {"hiprandRngType_t", "", CONV_TYPE, API_RAND, 1}}, - {"curandRngType_t", {"hiprandRngType_t", "", CONV_TYPE, API_RAND, 1}}, + // RAND function call status types (enum curandStatus) + {"CURAND_STATUS_SUCCESS", {"HIPRAND_STATUS_SUCCESS", "ROCRAND_STATUS_SUCCESS", CONV_NUMERIC_LITERAL, API_RAND, 1}}, + {"CURAND_STATUS_VERSION_MISMATCH", {"HIPRAND_STATUS_VERSION_MISMATCH", "ROCRAND_STATUS_VERSION_MISMATCH", CONV_NUMERIC_LITERAL, API_RAND, 1}}, + {"CURAND_STATUS_NOT_INITIALIZED", {"HIPRAND_STATUS_NOT_INITIALIZED", "ROCRAND_STATUS_NOT_CREATED", CONV_NUMERIC_LITERAL, API_RAND, 1}}, + {"CURAND_STATUS_ALLOCATION_FAILED", {"HIPRAND_STATUS_ALLOCATION_FAILED", "ROCRAND_STATUS_ALLOCATION_FAILED", CONV_NUMERIC_LITERAL, API_RAND, 1}}, + {"CURAND_STATUS_TYPE_ERROR", {"HIPRAND_STATUS_TYPE_ERROR", "ROCRAND_STATUS_TYPE_ERROR", CONV_NUMERIC_LITERAL, API_RAND, 1}}, + {"CURAND_STATUS_OUT_OF_RANGE", {"HIPRAND_STATUS_OUT_OF_RANGE", "ROCRAND_STATUS_OUT_OF_RANGE", CONV_NUMERIC_LITERAL, API_RAND, 1}}, + {"CURAND_STATUS_LENGTH_NOT_MULTIPLE", {"HIPRAND_STATUS_LENGTH_NOT_MULTIPLE", "ROCRAND_STATUS_LENGTH_NOT_MULTIPLE", CONV_NUMERIC_LITERAL, API_RAND, 1}}, + {"CURAND_STATUS_DOUBLE_PRECISION_REQUIRED", {"HIPRAND_STATUS_DOUBLE_PRECISION_REQUIRED", "ROCRAND_STATUS_DOUBLE_PRECISION_REQUIRED", CONV_NUMERIC_LITERAL, API_RAND, 1}}, + {"CURAND_STATUS_LAUNCH_FAILURE", {"HIPRAND_STATUS_LAUNCH_FAILURE", "ROCRAND_STATUS_LAUNCH_FAILURE", CONV_NUMERIC_LITERAL, API_RAND, 1}}, + {"CURAND_STATUS_PREEXISTING_FAILURE", {"HIPRAND_STATUS_PREEXISTING_FAILURE", "", CONV_NUMERIC_LITERAL, API_RAND, 1, ROC_UNSUPPORTED}}, + {"CURAND_STATUS_INITIALIZATION_FAILED", {"HIPRAND_STATUS_INITIALIZATION_FAILED", "", CONV_NUMERIC_LITERAL, API_RAND, 1, ROC_UNSUPPORTED}}, + {"CURAND_STATUS_ARCH_MISMATCH", {"HIPRAND_STATUS_ARCH_MISMATCH", "", CONV_NUMERIC_LITERAL, API_RAND, 1, ROC_UNSUPPORTED}}, + {"CURAND_STATUS_INTERNAL_ERROR", {"HIPRAND_STATUS_INTERNAL_ERROR", "ROCRAND_STATUS_INTERNAL_ERROR", CONV_NUMERIC_LITERAL, API_RAND, 1}}, + + {"curandRngType", {"hiprandRngType_t", "rocrand_rng_type", CONV_TYPE, API_RAND, 1}}, + {"curandRngType_t", {"hiprandRngType_t", "rocrand_rng_type", CONV_TYPE, API_RAND, 1}}, + // RAND generator types (enum curandRngType) + {"CURAND_RNG_TEST", {"HIPRAND_RNG_TEST", "", CONV_NUMERIC_LITERAL, API_RAND, 1, ROC_UNSUPPORTED}}, + {"CURAND_RNG_PSEUDO_DEFAULT", {"HIPRAND_RNG_PSEUDO_DEFAULT", "ROCRAND_RNG_PSEUDO_DEFAULT", CONV_NUMERIC_LITERAL, API_RAND, 1}}, + {"CURAND_RNG_PSEUDO_XORWOW", {"HIPRAND_RNG_PSEUDO_XORWOW", "ROCRAND_RNG_PSEUDO_XORWOW", CONV_NUMERIC_LITERAL, API_RAND, 1}}, + {"CURAND_RNG_PSEUDO_MRG32K3A", {"HIPRAND_RNG_PSEUDO_MRG32K3A", "ROCRAND_RNG_PSEUDO_MRG32K3A", CONV_NUMERIC_LITERAL, API_RAND, 1}}, + {"CURAND_RNG_PSEUDO_MTGP32", {"HIPRAND_RNG_PSEUDO_MTGP32", "ROCRAND_RNG_PSEUDO_MTGP32", CONV_NUMERIC_LITERAL, API_RAND, 1}}, + {"CURAND_RNG_PSEUDO_MT19937", {"HIPRAND_RNG_PSEUDO_MT19937", "ROCRAND_RNG_PSEUDO_MT19937", CONV_NUMERIC_LITERAL, API_RAND, 1}}, + {"CURAND_RNG_PSEUDO_PHILOX4_32_10", {"HIPRAND_RNG_PSEUDO_PHILOX4_32_10", "ROCRAND_RNG_PSEUDO_PHILOX4_32_10", CONV_NUMERIC_LITERAL, API_RAND, 1}}, + {"CURAND_RNG_QUASI_DEFAULT", {"HIPRAND_RNG_QUASI_DEFAULT", "ROCRAND_RNG_QUASI_DEFAULT", CONV_NUMERIC_LITERAL, API_RAND, 1}}, + {"CURAND_RNG_QUASI_SOBOL32", {"HIPRAND_RNG_QUASI_SOBOL32", "ROCRAND_RNG_QUASI_SOBOL32", CONV_NUMERIC_LITERAL, API_RAND, 1}}, + {"CURAND_RNG_QUASI_SCRAMBLED_SOBOL32", {"HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL32", "ROCRAND_RNG_QUASI_SCRAMBLED_SOBOL32", CONV_NUMERIC_LITERAL, API_RAND, 1}}, + {"CURAND_RNG_QUASI_SOBOL64", {"HIPRAND_RNG_QUASI_SOBOL64", "ROCRAND_RNG_QUASI_SOBOL64", CONV_NUMERIC_LITERAL, API_RAND, 1}}, + {"CURAND_RNG_QUASI_SCRAMBLED_SOBOL64", {"HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL64", "ROCRAND_RNG_QUASI_SCRAMBLED_SOBOL64", CONV_NUMERIC_LITERAL, API_RAND, 1}}, + {"curandGenerator_st", {"hiprandGenerator_st", "", CONV_TYPE, API_RAND, 1}}, {"curandGenerator_t", {"hiprandGenerator_t", "", CONV_TYPE, API_RAND, 1}}, {"curandDirectionVectorSet", {"hiprandDirectionVectorSet_t", "", CONV_TYPE, API_RAND, 1}}, @@ -74,35 +103,6 @@ const std::map CUDA_RAND_TYPE_NAME_MAP { {"curandState", {"hiprandState", "", CONV_TYPE, API_RAND, 1}}, {"curandState_t", {"hiprandState_t", "", CONV_TYPE, API_RAND, 1}}, - // RAND function call status types (enum curandStatus) - {"CURAND_STATUS_SUCCESS", {"HIPRAND_STATUS_SUCCESS", "ROCRAND_STATUS_SUCCESS", CONV_NUMERIC_LITERAL, API_RAND, 1}}, - {"CURAND_STATUS_VERSION_MISMATCH", {"HIPRAND_STATUS_VERSION_MISMATCH", "ROCRAND_STATUS_VERSION_MISMATCH", CONV_NUMERIC_LITERAL, API_RAND, 1}}, - {"CURAND_STATUS_NOT_INITIALIZED", {"HIPRAND_STATUS_NOT_INITIALIZED", "ROCRAND_STATUS_NOT_CREATED", CONV_NUMERIC_LITERAL, API_RAND, 1}}, - {"CURAND_STATUS_ALLOCATION_FAILED", {"HIPRAND_STATUS_ALLOCATION_FAILED", "ROCRAND_STATUS_ALLOCATION_FAILED", CONV_NUMERIC_LITERAL, API_RAND, 1}}, - {"CURAND_STATUS_TYPE_ERROR", {"HIPRAND_STATUS_TYPE_ERROR", "ROCRAND_STATUS_TYPE_ERROR", CONV_NUMERIC_LITERAL, API_RAND, 1}}, - {"CURAND_STATUS_OUT_OF_RANGE", {"HIPRAND_STATUS_OUT_OF_RANGE", "ROCRAND_STATUS_OUT_OF_RANGE", CONV_NUMERIC_LITERAL, API_RAND, 1}}, - {"CURAND_STATUS_LENGTH_NOT_MULTIPLE", {"HIPRAND_STATUS_LENGTH_NOT_MULTIPLE", "ROCRAND_STATUS_LENGTH_NOT_MULTIPLE", CONV_NUMERIC_LITERAL, API_RAND, 1}}, - {"CURAND_STATUS_DOUBLE_PRECISION_REQUIRED", {"HIPRAND_STATUS_DOUBLE_PRECISION_REQUIRED", "ROCRAND_STATUS_DOUBLE_PRECISION_REQUIRED", CONV_NUMERIC_LITERAL, API_RAND, 1}}, - {"CURAND_STATUS_LAUNCH_FAILURE", {"HIPRAND_STATUS_LAUNCH_FAILURE", "ROCRAND_STATUS_LAUNCH_FAILURE", CONV_NUMERIC_LITERAL, API_RAND, 1}}, - {"CURAND_STATUS_PREEXISTING_FAILURE", {"HIPRAND_STATUS_PREEXISTING_FAILURE", "", CONV_NUMERIC_LITERAL, API_RAND, 1, ROC_UNSUPPORTED}}, - {"CURAND_STATUS_INITIALIZATION_FAILED", {"HIPRAND_STATUS_INITIALIZATION_FAILED", "", CONV_NUMERIC_LITERAL, API_RAND, 1, ROC_UNSUPPORTED}}, - {"CURAND_STATUS_ARCH_MISMATCH", {"HIPRAND_STATUS_ARCH_MISMATCH", "", CONV_NUMERIC_LITERAL, API_RAND, 1, ROC_UNSUPPORTED}}, - {"CURAND_STATUS_INTERNAL_ERROR", {"HIPRAND_STATUS_INTERNAL_ERROR", "ROCRAND_STATUS_INTERNAL_ERROR", CONV_NUMERIC_LITERAL, API_RAND, 1}}, - - // RAND generator types (enum curandRngType) - {"CURAND_RNG_TEST", {"HIPRAND_RNG_TEST", "", CONV_NUMERIC_LITERAL, API_RAND, 1}}, - {"CURAND_RNG_PSEUDO_DEFAULT", {"HIPRAND_RNG_PSEUDO_DEFAULT", "", CONV_NUMERIC_LITERAL, API_RAND, 1}}, - {"CURAND_RNG_PSEUDO_XORWOW", {"HIPRAND_RNG_PSEUDO_XORWOW", "", CONV_NUMERIC_LITERAL, API_RAND, 1}}, - {"CURAND_RNG_PSEUDO_MRG32K3A", {"HIPRAND_RNG_PSEUDO_MRG32K3A", "", CONV_NUMERIC_LITERAL, API_RAND, 1}}, - {"CURAND_RNG_PSEUDO_MTGP32", {"HIPRAND_RNG_PSEUDO_MTGP32", "", CONV_NUMERIC_LITERAL, API_RAND, 1}}, - {"CURAND_RNG_PSEUDO_MT19937", {"HIPRAND_RNG_PSEUDO_MT19937", "", CONV_NUMERIC_LITERAL, API_RAND, 1}}, - {"CURAND_RNG_PSEUDO_PHILOX4_32_10", {"HIPRAND_RNG_PSEUDO_PHILOX4_32_10", "", CONV_NUMERIC_LITERAL, API_RAND, 1}}, - {"CURAND_RNG_QUASI_DEFAULT", {"HIPRAND_RNG_QUASI_DEFAULT", "", CONV_NUMERIC_LITERAL, API_RAND, 1}}, - {"CURAND_RNG_QUASI_SOBOL32", {"HIPRAND_RNG_QUASI_SOBOL32", "", CONV_NUMERIC_LITERAL, API_RAND, 1}}, - {"CURAND_RNG_QUASI_SCRAMBLED_SOBOL32", {"HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL32", "", CONV_NUMERIC_LITERAL, API_RAND, 1}}, - {"CURAND_RNG_QUASI_SOBOL64", {"HIPRAND_RNG_QUASI_SOBOL64", "", CONV_NUMERIC_LITERAL, API_RAND, 1}}, - {"CURAND_RNG_QUASI_SCRAMBLED_SOBOL64", {"HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL64", "", CONV_NUMERIC_LITERAL, API_RAND, 1}}, - // RAND ordering of results in memory (enum curandOrdering) {"CURAND_ORDERING_PSEUDO_BEST", {"HIPRAND_ORDERING_PSEUDO_BEST", "", CONV_NUMERIC_LITERAL, API_RAND, 1, HIP_EXPERIMENTAL}}, {"CURAND_ORDERING_PSEUDO_DEFAULT", {"HIPRAND_ORDERING_PSEUDO_DEFAULT", "", CONV_NUMERIC_LITERAL, API_RAND, 1, HIP_EXPERIMENTAL}}, @@ -216,4 +216,16 @@ const std::map HIP_RAND_TYPE_NAME_VER_MAP { {"ROCRAND_STATUS_DOUBLE_PRECISION_REQUIRED", {HIP_1050, HIP_0, HIP_0 }}, {"ROCRAND_STATUS_LAUNCH_FAILURE", {HIP_1050, HIP_0, HIP_0 }}, {"ROCRAND_STATUS_INTERNAL_ERROR", {HIP_1050, HIP_0, HIP_0 }}, + {"rocrand_rng_type", {HIP_1050, HIP_0, HIP_0 }}, + {"ROCRAND_RNG_PSEUDO_DEFAULT", {HIP_1050, HIP_0, HIP_0 }}, + {"ROCRAND_RNG_PSEUDO_XORWOW", {HIP_1050, HIP_0, HIP_0 }}, + {"ROCRAND_RNG_PSEUDO_MRG32K3A", {HIP_1050, HIP_0, HIP_0 }}, + {"ROCRAND_RNG_PSEUDO_MTGP32", {HIP_1050, HIP_0, HIP_0 }}, + {"ROCRAND_RNG_PSEUDO_MT19937", {HIP_5050, HIP_0, HIP_0 }}, + {"ROCRAND_RNG_PSEUDO_PHILOX4_32_10", {HIP_1050, HIP_0, HIP_0 }}, + {"ROCRAND_RNG_QUASI_DEFAULT", {HIP_1050, HIP_0, HIP_0 }}, + {"ROCRAND_RNG_QUASI_SOBOL32", {HIP_1050, HIP_0, HIP_0 }}, + {"ROCRAND_RNG_QUASI_SCRAMBLED_SOBOL32", {HIP_5040, HIP_0, HIP_0 }}, + {"ROCRAND_RNG_QUASI_SOBOL64", {HIP_4050, HIP_0, HIP_0 }}, + {"ROCRAND_RNG_QUASI_SCRAMBLED_SOBOL64", {HIP_5040, HIP_0, HIP_0 }}, }; diff --git a/tests/unit_tests/synthetic/libraries/curand2hiprand.cu b/tests/unit_tests/synthetic/libraries/curand2hiprand.cu index 420271df..f623fb7e 100644 --- a/tests/unit_tests/synthetic/libraries/curand2hiprand.cu +++ b/tests/unit_tests/synthetic/libraries/curand2hiprand.cu @@ -18,6 +18,66 @@ int main() { printf("21. cuRAND API to hipRAND API synthetic test\n"); + // CHECK: hiprandStatus randStatus; + // CHECK-NEXT: hiprandStatus_t status; + // CHECK-NEXT: hiprandStatus_t STATUS_SUCCESS = HIPRAND_STATUS_SUCCESS; + // CHECK-NEXT: hiprandStatus_t STATUS_VERSION_MISMATCH = HIPRAND_STATUS_VERSION_MISMATCH; + // CHECK-NEXT: hiprandStatus_t STATUS_NOT_INITIALIZED = HIPRAND_STATUS_NOT_INITIALIZED; + // CHECK-NEXT: hiprandStatus_t STATUS_ALLOCATION_FAILED = HIPRAND_STATUS_ALLOCATION_FAILED; + // CHECK-NEXT: hiprandStatus_t STATUS_TYPE_ERROR = HIPRAND_STATUS_TYPE_ERROR; + // CHECK-NEXT: hiprandStatus_t STATUS_OUT_OF_RANGE = HIPRAND_STATUS_OUT_OF_RANGE; + // CHECK-NEXT: hiprandStatus_t STATUS_LENGTH_NOT_MULTIPLE = HIPRAND_STATUS_LENGTH_NOT_MULTIPLE; + // CHECK-NEXT: hiprandStatus_t STATUS_DOUBLE_PRECISION_REQUIRED = HIPRAND_STATUS_DOUBLE_PRECISION_REQUIRED; + // CHECK-NEXT: hiprandStatus_t STATUS_LAUNCH_FAILURE = HIPRAND_STATUS_LAUNCH_FAILURE; + // CHECK-NEXT: hiprandStatus_t STATUS_PREEXISTING_FAILURE = HIPRAND_STATUS_PREEXISTING_FAILURE; + // CHECK-NEXT: hiprandStatus_t STATUS_INITIALIZATION_FAILED = HIPRAND_STATUS_INITIALIZATION_FAILED; + // CHECK-NEXT: hiprandStatus_t STATUS_ARCH_MISMATCH = HIPRAND_STATUS_ARCH_MISMATCH; + // CHECK-NEXT: hiprandStatus_t STATUS_INTERNAL_ERROR = HIPRAND_STATUS_INTERNAL_ERROR; + curandStatus randStatus; + curandStatus_t status; + curandStatus_t STATUS_SUCCESS = CURAND_STATUS_SUCCESS; + curandStatus_t STATUS_VERSION_MISMATCH = CURAND_STATUS_VERSION_MISMATCH; + curandStatus_t STATUS_NOT_INITIALIZED = CURAND_STATUS_NOT_INITIALIZED; + curandStatus_t STATUS_ALLOCATION_FAILED = CURAND_STATUS_ALLOCATION_FAILED; + curandStatus_t STATUS_TYPE_ERROR = CURAND_STATUS_TYPE_ERROR; + curandStatus_t STATUS_OUT_OF_RANGE = CURAND_STATUS_OUT_OF_RANGE; + curandStatus_t STATUS_LENGTH_NOT_MULTIPLE = CURAND_STATUS_LENGTH_NOT_MULTIPLE; + curandStatus_t STATUS_DOUBLE_PRECISION_REQUIRED = CURAND_STATUS_DOUBLE_PRECISION_REQUIRED; + curandStatus_t STATUS_LAUNCH_FAILURE = CURAND_STATUS_LAUNCH_FAILURE; + curandStatus_t STATUS_PREEXISTING_FAILURE = CURAND_STATUS_PREEXISTING_FAILURE; + curandStatus_t STATUS_INITIALIZATION_FAILED = CURAND_STATUS_INITIALIZATION_FAILED; + curandStatus_t STATUS_ARCH_MISMATCH = CURAND_STATUS_ARCH_MISMATCH; + curandStatus_t STATUS_INTERNAL_ERROR = CURAND_STATUS_INTERNAL_ERROR; + + // CHECK: hiprandRngType_t randRngType; + // CHECK-NEXT: hiprandRngType_t randRngType_t; + // CHECK-NEXT: hiprandRngType_t RNG_TEST = HIPRAND_RNG_TEST; + // CHECK-NEXT: hiprandRngType_t RNG_PSEUDO_DEFAULT = HIPRAND_RNG_PSEUDO_DEFAULT; + // CHECK-NEXT: hiprandRngType_t RNG_PSEUDO_XORWOW = HIPRAND_RNG_PSEUDO_XORWOW; + // CHECK-NEXT: hiprandRngType_t RNG_PSEUDO_MRG32K3A = HIPRAND_RNG_PSEUDO_MRG32K3A; + // CHECK-NEXT: hiprandRngType_t RNG_PSEUDO_MTGP32 = HIPRAND_RNG_PSEUDO_MTGP32; + // CHECK-NEXT: hiprandRngType_t RNG_PSEUDO_MT19937 = HIPRAND_RNG_PSEUDO_MT19937; + // CHECK-NEXT: hiprandRngType_t RNG_PSEUDO_PHILOX4_32_10 = HIPRAND_RNG_PSEUDO_PHILOX4_32_10; + // CHECK-NEXT: hiprandRngType_t RNG_QUASI_DEFAULT = HIPRAND_RNG_QUASI_DEFAULT; + // CHECK-NEXT: hiprandRngType_t RNG_QUASI_SOBOL32 = HIPRAND_RNG_QUASI_SOBOL32; + // CHECK-NEXT: hiprandRngType_t RNG_QUASI_SCRAMBLED_SOBOL32 = HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL32; + // CHECK-NEXT: hiprandRngType_t RNG_QUASI_SOBOL64 = HIPRAND_RNG_QUASI_SOBOL64; + // CHECK-NEXT: hiprandRngType_t RNG_QUASI_SCRAMBLED_SOBOL64 = HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL64; + curandRngType randRngType; + curandRngType_t randRngType_t; + curandRngType_t RNG_TEST = CURAND_RNG_TEST; + curandRngType_t RNG_PSEUDO_DEFAULT = CURAND_RNG_PSEUDO_DEFAULT; + curandRngType_t RNG_PSEUDO_XORWOW = CURAND_RNG_PSEUDO_XORWOW; + curandRngType_t RNG_PSEUDO_MRG32K3A = CURAND_RNG_PSEUDO_MRG32K3A; + curandRngType_t RNG_PSEUDO_MTGP32 = CURAND_RNG_PSEUDO_MTGP32; + curandRngType_t RNG_PSEUDO_MT19937 = CURAND_RNG_PSEUDO_MT19937; + curandRngType_t RNG_PSEUDO_PHILOX4_32_10 = CURAND_RNG_PSEUDO_PHILOX4_32_10; + curandRngType_t RNG_QUASI_DEFAULT = CURAND_RNG_QUASI_DEFAULT; + curandRngType_t RNG_QUASI_SOBOL32 = CURAND_RNG_QUASI_SOBOL32; + curandRngType_t RNG_QUASI_SCRAMBLED_SOBOL32 = CURAND_RNG_QUASI_SCRAMBLED_SOBOL32; + curandRngType_t RNG_QUASI_SOBOL64 = CURAND_RNG_QUASI_SOBOL64; + curandRngType_t RNG_QUASI_SCRAMBLED_SOBOL64 = CURAND_RNG_QUASI_SCRAMBLED_SOBOL64; + // CHECK: hiprandOrdering randOrdering; // CHECK-NEXT: hiprandOrdering_t randOrdering_t; // CHECK-NEXT: hiprandOrdering_t RAND_ORDERING_PSEUDO_BEST = HIPRAND_ORDERING_PSEUDO_BEST; @@ -31,11 +91,6 @@ int main() { curandOrdering_t RAND_ORDERING_PSEUDO_SEEDED = CURAND_ORDERING_PSEUDO_SEEDED; curandOrdering_t RAND_ORDERING_QUASI_DEFAULT = CURAND_ORDERING_QUASI_DEFAULT; - // CHECK: hiprandStatus randStatus; - // CHECK-NEXT: hiprandStatus_t status; - curandStatus randStatus; - curandStatus_t status; - // CHECK: hiprandGenerator_st *randGenerator_st = nullptr; // CHECK-NEXT: hiprandGenerator_t randGenerator; curandGenerator_st *randGenerator_st = nullptr; diff --git a/tests/unit_tests/synthetic/libraries/curand2rocrand.cu b/tests/unit_tests/synthetic/libraries/curand2rocrand.cu index ab6b02d5..95ea120e 100644 --- a/tests/unit_tests/synthetic/libraries/curand2rocrand.cu +++ b/tests/unit_tests/synthetic/libraries/curand2rocrand.cu @@ -35,5 +35,33 @@ int main() { curandStatus_t STATUS_LAUNCH_FAILURE = CURAND_STATUS_LAUNCH_FAILURE; curandStatus_t STATUS_INTERNAL_ERROR = CURAND_STATUS_INTERNAL_ERROR; + + // CHECK: rocrand_rng_type randRngType; + // CHECK-NEXT: rocrand_rng_type randRngType_t; + // CHECK-NEXT: rocrand_rng_type RNG_PSEUDO_DEFAULT = ROCRAND_RNG_PSEUDO_DEFAULT; + // CHECK-NEXT: rocrand_rng_type RNG_PSEUDO_XORWOW = ROCRAND_RNG_PSEUDO_XORWOW; + // CHECK-NEXT: rocrand_rng_type RNG_PSEUDO_MRG32K3A = ROCRAND_RNG_PSEUDO_MRG32K3A; + // CHECK-NEXT: rocrand_rng_type RNG_PSEUDO_MTGP32 = ROCRAND_RNG_PSEUDO_MTGP32; + // CHECK-NEXT: rocrand_rng_type RNG_PSEUDO_MT19937 = ROCRAND_RNG_PSEUDO_MT19937; + // CHECK-NEXT: rocrand_rng_type RNG_PSEUDO_PHILOX4_32_10 = ROCRAND_RNG_PSEUDO_PHILOX4_32_10; + // CHECK-NEXT: rocrand_rng_type RNG_QUASI_DEFAULT = ROCRAND_RNG_QUASI_DEFAULT; + // CHECK-NEXT: rocrand_rng_type RNG_QUASI_SOBOL32 = ROCRAND_RNG_QUASI_SOBOL32; + // CHECK-NEXT: rocrand_rng_type RNG_QUASI_SCRAMBLED_SOBOL32 = ROCRAND_RNG_QUASI_SCRAMBLED_SOBOL32; + // CHECK-NEXT: rocrand_rng_type RNG_QUASI_SOBOL64 = ROCRAND_RNG_QUASI_SOBOL64; + // CHECK-NEXT: rocrand_rng_type RNG_QUASI_SCRAMBLED_SOBOL64 = ROCRAND_RNG_QUASI_SCRAMBLED_SOBOL64; + curandRngType randRngType; + curandRngType_t randRngType_t; + curandRngType_t RNG_PSEUDO_DEFAULT = CURAND_RNG_PSEUDO_DEFAULT; + curandRngType_t RNG_PSEUDO_XORWOW = CURAND_RNG_PSEUDO_XORWOW; + curandRngType_t RNG_PSEUDO_MRG32K3A = CURAND_RNG_PSEUDO_MRG32K3A; + curandRngType_t RNG_PSEUDO_MTGP32 = CURAND_RNG_PSEUDO_MTGP32; + curandRngType_t RNG_PSEUDO_MT19937 = CURAND_RNG_PSEUDO_MT19937; + curandRngType_t RNG_PSEUDO_PHILOX4_32_10 = CURAND_RNG_PSEUDO_PHILOX4_32_10; + curandRngType_t RNG_QUASI_DEFAULT = CURAND_RNG_QUASI_DEFAULT; + curandRngType_t RNG_QUASI_SOBOL32 = CURAND_RNG_QUASI_SOBOL32; + curandRngType_t RNG_QUASI_SCRAMBLED_SOBOL32 = CURAND_RNG_QUASI_SCRAMBLED_SOBOL32; + curandRngType_t RNG_QUASI_SOBOL64 = CURAND_RNG_QUASI_SOBOL64; + curandRngType_t RNG_QUASI_SCRAMBLED_SOBOL64 = CURAND_RNG_QUASI_SCRAMBLED_SOBOL64; + return 0; }