| 1 |
// RUN: %run_test hipify "%s" "%t" %hipify_args 3 --amap --default-preprocessor --experimental %clang_args -D__CUDA_API_VERSION_INTERNAL -ferror-limit=500 |
| 2 |
|
| 3 |
// CHECK: #include <hip/hip_runtime.h> |
| 4 |
#include <cuda_runtime.h> |
| 5 |
#include <stdio.h> |
| 6 |
// CHECK: #include "hiprand/hiprand.h" |
| 7 |
// CHECK-NEXT: #include "hiprand/hiprand_kernel.h" |
| 8 |
#include "curand.h" |
| 9 |
#include "curand_kernel.h" |
| 10 |
// CHECK-NOT: #include "hiprand/hiprand.h" |
| 11 |
// CHECK-NOT: #include "hiprand/hiprand_kernel.h" |
| 12 |
|
| 13 |
#if defined(_WIN32) && CUDA_VERSION < 9000 |
| 14 |
typedef signed __int64 int64_t; |
| 15 |
typedef unsigned __int64 uint64_t; |
| 16 |
#endif |
| 17 |
|
| 18 |
int main() { |
| 19 |
printf("22. cuRAND API to hipRAND API synthetic test\n"); |
| 20 |
|
| 21 |
unsigned int *outputPtr = nullptr; |
| 22 |
unsigned int *constants = nullptr; |
| 23 |
unsigned long long *constantsLL = nullptr; |
| 24 |
float *outputPtrFloat = nullptr; |
| 25 |
double *outputPtrDouble = nullptr; |
| 26 |
unsigned int num_dimensions = 0; |
| 27 |
unsigned long long *outputPtrUll = nullptr; |
| 28 |
unsigned long long offset = 0; |
| 29 |
int version = 0; |
| 30 |
size_t num = 0; |
| 31 |
float mean = 0.f; |
| 32 |
double dmean = 0.f; |
| 33 |
float stddev = 0.f; |
| 34 |
double dstddev = 0.f; |
| 35 |
double dlambda = 0.f; |
| 36 |
|
| 37 |
// CHECK: hipStream_t stream; |
| 38 |
cudaStream_t stream; |
| 39 |
|
| 40 |
// CHECK: hiprandStatus randStatus; |
| 41 |
// CHECK-NEXT: hiprandStatus_t status; |
| 42 |
// CHECK-NEXT: hiprandStatus_t STATUS_SUCCESS = HIPRAND_STATUS_SUCCESS; |
| 43 |
// CHECK-NEXT: hiprandStatus_t STATUS_VERSION_MISMATCH = HIPRAND_STATUS_VERSION_MISMATCH; |
| 44 |
// CHECK-NEXT: hiprandStatus_t STATUS_NOT_INITIALIZED = HIPRAND_STATUS_NOT_INITIALIZED; |
| 45 |
// CHECK-NEXT: hiprandStatus_t STATUS_ALLOCATION_FAILED = HIPRAND_STATUS_ALLOCATION_FAILED; |
| 46 |
// CHECK-NEXT: hiprandStatus_t STATUS_TYPE_ERROR = HIPRAND_STATUS_TYPE_ERROR; |
| 47 |
// CHECK-NEXT: hiprandStatus_t STATUS_OUT_OF_RANGE = HIPRAND_STATUS_OUT_OF_RANGE; |
| 48 |
// CHECK-NEXT: hiprandStatus_t STATUS_LENGTH_NOT_MULTIPLE = HIPRAND_STATUS_LENGTH_NOT_MULTIPLE; |
| 49 |
// CHECK-NEXT: hiprandStatus_t STATUS_DOUBLE_PRECISION_REQUIRED = HIPRAND_STATUS_DOUBLE_PRECISION_REQUIRED; |
| 50 |
// CHECK-NEXT: hiprandStatus_t STATUS_LAUNCH_FAILURE = HIPRAND_STATUS_LAUNCH_FAILURE; |
| 51 |
// CHECK-NEXT: hiprandStatus_t STATUS_PREEXISTING_FAILURE = HIPRAND_STATUS_PREEXISTING_FAILURE; |
| 52 |
// CHECK-NEXT: hiprandStatus_t STATUS_INITIALIZATION_FAILED = HIPRAND_STATUS_INITIALIZATION_FAILED; |
| 53 |
// CHECK-NEXT: hiprandStatus_t STATUS_ARCH_MISMATCH = HIPRAND_STATUS_ARCH_MISMATCH; |
| 54 |
// CHECK-NEXT: hiprandStatus_t STATUS_INTERNAL_ERROR = HIPRAND_STATUS_INTERNAL_ERROR; |
| 55 |
curandStatus randStatus; |
| 56 |
curandStatus_t status; |
| 57 |
curandStatus_t STATUS_SUCCESS = CURAND_STATUS_SUCCESS; |
| 58 |
curandStatus_t STATUS_VERSION_MISMATCH = CURAND_STATUS_VERSION_MISMATCH; |
| 59 |
curandStatus_t STATUS_NOT_INITIALIZED = CURAND_STATUS_NOT_INITIALIZED; |
| 60 |
curandStatus_t STATUS_ALLOCATION_FAILED = CURAND_STATUS_ALLOCATION_FAILED; |
| 61 |
curandStatus_t STATUS_TYPE_ERROR = CURAND_STATUS_TYPE_ERROR; |
| 62 |
curandStatus_t STATUS_OUT_OF_RANGE = CURAND_STATUS_OUT_OF_RANGE; |
| 63 |
curandStatus_t STATUS_LENGTH_NOT_MULTIPLE = CURAND_STATUS_LENGTH_NOT_MULTIPLE; |
| 64 |
curandStatus_t STATUS_DOUBLE_PRECISION_REQUIRED = CURAND_STATUS_DOUBLE_PRECISION_REQUIRED; |
| 65 |
curandStatus_t STATUS_LAUNCH_FAILURE = CURAND_STATUS_LAUNCH_FAILURE; |
| 66 |
curandStatus_t STATUS_PREEXISTING_FAILURE = CURAND_STATUS_PREEXISTING_FAILURE; |
| 67 |
curandStatus_t STATUS_INITIALIZATION_FAILED = CURAND_STATUS_INITIALIZATION_FAILED; |
| 68 |
curandStatus_t STATUS_ARCH_MISMATCH = CURAND_STATUS_ARCH_MISMATCH; |
| 69 |
curandStatus_t STATUS_INTERNAL_ERROR = CURAND_STATUS_INTERNAL_ERROR; |
| 70 |
|
| 71 |
// CHECK: hiprandRngType_t randRngType; |
| 72 |
// CHECK-NEXT: hiprandRngType_t randRngType_t; |
| 73 |
// CHECK-NEXT: hiprandRngType_t RNG_TEST = HIPRAND_RNG_TEST; |
| 74 |
// CHECK-NEXT: hiprandRngType_t RNG_PSEUDO_DEFAULT = HIPRAND_RNG_PSEUDO_DEFAULT; |
| 75 |
// CHECK-NEXT: hiprandRngType_t RNG_PSEUDO_XORWOW = HIPRAND_RNG_PSEUDO_XORWOW; |
| 76 |
// CHECK-NEXT: hiprandRngType_t RNG_PSEUDO_MRG32K3A = HIPRAND_RNG_PSEUDO_MRG32K3A; |
| 77 |
// CHECK-NEXT: hiprandRngType_t RNG_PSEUDO_MTGP32 = HIPRAND_RNG_PSEUDO_MTGP32; |
| 78 |
// CHECK-NEXT: hiprandRngType_t RNG_PSEUDO_MT19937 = HIPRAND_RNG_PSEUDO_MT19937; |
| 79 |
// CHECK-NEXT: hiprandRngType_t RNG_PSEUDO_PHILOX4_32_10 = HIPRAND_RNG_PSEUDO_PHILOX4_32_10; |
| 80 |
// CHECK-NEXT: hiprandRngType_t RNG_QUASI_DEFAULT = HIPRAND_RNG_QUASI_DEFAULT; |
| 81 |
// CHECK-NEXT: hiprandRngType_t RNG_QUASI_SOBOL32 = HIPRAND_RNG_QUASI_SOBOL32; |
| 82 |
// CHECK-NEXT: hiprandRngType_t RNG_QUASI_SCRAMBLED_SOBOL32 = HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL32; |
| 83 |
// CHECK-NEXT: hiprandRngType_t RNG_QUASI_SOBOL64 = HIPRAND_RNG_QUASI_SOBOL64; |
| 84 |
// CHECK-NEXT: hiprandRngType_t RNG_QUASI_SCRAMBLED_SOBOL64 = HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL64; |
| 85 |
curandRngType randRngType; |
| 86 |
curandRngType_t randRngType_t; |
| 87 |
curandRngType_t RNG_TEST = CURAND_RNG_TEST; |
| 88 |
curandRngType_t RNG_PSEUDO_DEFAULT = CURAND_RNG_PSEUDO_DEFAULT; |
| 89 |
curandRngType_t RNG_PSEUDO_XORWOW = CURAND_RNG_PSEUDO_XORWOW; |
| 90 |
curandRngType_t RNG_PSEUDO_MRG32K3A = CURAND_RNG_PSEUDO_MRG32K3A; |
| 91 |
curandRngType_t RNG_PSEUDO_MTGP32 = CURAND_RNG_PSEUDO_MTGP32; |
| 92 |
curandRngType_t RNG_PSEUDO_MT19937 = CURAND_RNG_PSEUDO_MT19937; |
| 93 |
curandRngType_t RNG_PSEUDO_PHILOX4_32_10 = CURAND_RNG_PSEUDO_PHILOX4_32_10; |
| 94 |
curandRngType_t RNG_QUASI_DEFAULT = CURAND_RNG_QUASI_DEFAULT; |
| 95 |
curandRngType_t RNG_QUASI_SOBOL32 = CURAND_RNG_QUASI_SOBOL32; |
| 96 |
curandRngType_t RNG_QUASI_SCRAMBLED_SOBOL32 = CURAND_RNG_QUASI_SCRAMBLED_SOBOL32; |
| 97 |
curandRngType_t RNG_QUASI_SOBOL64 = CURAND_RNG_QUASI_SOBOL64; |
| 98 |
curandRngType_t RNG_QUASI_SCRAMBLED_SOBOL64 = CURAND_RNG_QUASI_SCRAMBLED_SOBOL64; |
| 99 |
|
| 100 |
// CHECK: hiprandOrdering randOrdering; |
| 101 |
// CHECK-NEXT: hiprandOrdering_t randOrdering_t; |
| 102 |
// CHECK-NEXT: hiprandOrdering_t RAND_ORDERING_PSEUDO_BEST = HIPRAND_ORDERING_PSEUDO_BEST; |
| 103 |
// CHECK-NEXT: hiprandOrdering_t RAND_ORDERING_PSEUDO_DEFAULT = HIPRAND_ORDERING_PSEUDO_DEFAULT; |
| 104 |
// CHECK-NEXT: hiprandOrdering_t RAND_ORDERING_PSEUDO_SEEDED = HIPRAND_ORDERING_PSEUDO_SEEDED; |
| 105 |
// CHECK-NEXT: hiprandOrdering_t RAND_ORDERING_QUASI_DEFAULT = HIPRAND_ORDERING_QUASI_DEFAULT; |
| 106 |
curandOrdering randOrdering; |
| 107 |
curandOrdering_t randOrdering_t; |
| 108 |
curandOrdering_t RAND_ORDERING_PSEUDO_BEST = CURAND_ORDERING_PSEUDO_BEST; |
| 109 |
curandOrdering_t RAND_ORDERING_PSEUDO_DEFAULT = CURAND_ORDERING_PSEUDO_DEFAULT; |
| 110 |
curandOrdering_t RAND_ORDERING_PSEUDO_SEEDED = CURAND_ORDERING_PSEUDO_SEEDED; |
| 111 |
curandOrdering_t RAND_ORDERING_QUASI_DEFAULT = CURAND_ORDERING_QUASI_DEFAULT; |
| 112 |
|
| 113 |
// CHECK: hiprandGenerator_st *randGenerator_st = nullptr; |
| 114 |
// CHECK-NEXT: hiprandGenerator_t randGenerator; |
| 115 |
curandGenerator_st *randGenerator_st = nullptr; |
| 116 |
curandGenerator_t randGenerator; |
| 117 |
|
| 118 |
// CHECK: hiprandStateSobol64 randStateSobol64; |
| 119 |
// CHECK-NEXT: hiprandStateSobol64_t randStateSobol64_t; |
| 120 |
curandStateSobol64 randStateSobol64; |
| 121 |
curandStateSobol64_t randStateSobol64_t; |
| 122 |
|
| 123 |
// CHECK: hiprandStateScrambledSobol64 randStateScrambledSobol64; |
| 124 |
// CHECK-NEXT: hiprandStateScrambledSobol64_t randStateScrambledSobol64_t; |
| 125 |
curandStateScrambledSobol64 randStateScrambledSobol64; |
| 126 |
curandStateScrambledSobol64_t randStateScrambledSobol64_t; |
| 127 |
|
| 128 |
// CHECK: hiprandStateSobol32 randStateSobol32; |
| 129 |
// CHECK-NEXT: hiprandStateSobol32_t randStateSobol32_t; |
| 130 |
curandStateSobol32 randStateSobol32; |
| 131 |
curandStateSobol32_t randStateSobol32_t; |
| 132 |
|
| 133 |
// CHECK: hiprandStateScrambledSobol32 randStateScrambledSobol32; |
| 134 |
// CHECK-NEXT: hiprandStateScrambledSobol32_t randStateScrambledSobol32_t; |
| 135 |
curandStateScrambledSobol32 randStateScrambledSobol32; |
| 136 |
curandStateScrambledSobol32_t randStateScrambledSobol32_t; |
| 137 |
|
| 138 |
// CHECK: hiprandDirectionVectors32_t directions32; |
| 139 |
// CHECK-NEXT: hiprandDirectionVectors64_t directions64; |
| 140 |
// CHECK-NEXT: hiprandDirectionVectors64_t *pDirections64 = nullptr; |
| 141 |
curandDirectionVectors32_t directions32; |
| 142 |
curandDirectionVectors64_t directions64; |
| 143 |
curandDirectionVectors64_t *pDirections64 = nullptr; |
| 144 |
|
| 145 |
// CHECK: hiprandDiscreteDistribution_st *discreteDistribution_st = nullptr; |
| 146 |
// CHECK: hiprandDiscreteDistribution_t discreteDistribution_t = nullptr; |
| 147 |
curandDiscreteDistribution_st *discreteDistribution_st = nullptr; |
| 148 |
curandDiscreteDistribution_t discreteDistribution_t = nullptr; |
| 149 |
|
| 150 |
// CHECK: hiprandStateMtgp32 stateMtgp32; |
| 151 |
// CHECK-NEXT: hiprandStateMtgp32_t stateMtgp32_t; |
| 152 |
curandStateMtgp32 stateMtgp32; |
| 153 |
curandStateMtgp32_t stateMtgp32_t; |
| 154 |
|
| 155 |
// CHECK: hiprandStateMRG32k3a stateMRG32k3a; |
| 156 |
// CHECK-NEXT: hiprandStateMRG32k3a_t stateMRG32k3a_t; |
| 157 |
curandStateMRG32k3a stateMRG32k3a; |
| 158 |
curandStateMRG32k3a_t stateMRG32k3a_t; |
| 159 |
|
| 160 |
// CHECK: hiprandStatePhilox4_32_10 statePhilox4_32_10; |
| 161 |
// CHECK-NEXT: hiprandStatePhilox4_32_10_t statePhilox4_32_10_t; |
| 162 |
curandStatePhilox4_32_10 statePhilox4_32_10; |
| 163 |
curandStatePhilox4_32_10_t statePhilox4_32_10_t; |
| 164 |
|
| 165 |
// CHECK: hiprandDirectionVectorSet_t directionVectorSet; |
| 166 |
// CHECK-NEXT: hiprandDirectionVectorSet_t directionVectorSet_t; |
| 167 |
// CHECK-NEXT: hiprandDirectionVectorSet_t DIRECTION_VECTORS_32_JOEKUO6 = HIPRAND_DIRECTION_VECTORS_32_JOEKUO6; |
| 168 |
// CHECK-NEXT: hiprandDirectionVectorSet_t SCRAMBLED_DIRECTION_VECTORS_32_JOEKUO6 = HIPRAND_SCRAMBLED_DIRECTION_VECTORS_32_JOEKUO6; |
| 169 |
// CHECK-NEXT: hiprandDirectionVectorSet_t DIRECTION_VECTORS_64_JOEKUO6 = HIPRAND_DIRECTION_VECTORS_64_JOEKUO6; |
| 170 |
// CHECK-NEXT: hiprandDirectionVectorSet_t SCRAMBLED_DIRECTION_VECTORS_64_JOEKUO6 = HIPRAND_SCRAMBLED_DIRECTION_VECTORS_64_JOEKUO6; |
| 171 |
curandDirectionVectorSet directionVectorSet; |
| 172 |
curandDirectionVectorSet_t directionVectorSet_t; |
| 173 |
curandDirectionVectorSet_t DIRECTION_VECTORS_32_JOEKUO6 = CURAND_DIRECTION_VECTORS_32_JOEKUO6; |
| 174 |
curandDirectionVectorSet_t SCRAMBLED_DIRECTION_VECTORS_32_JOEKUO6 = CURAND_SCRAMBLED_DIRECTION_VECTORS_32_JOEKUO6; |
| 175 |
curandDirectionVectorSet_t DIRECTION_VECTORS_64_JOEKUO6 = CURAND_DIRECTION_VECTORS_64_JOEKUO6; |
| 176 |
curandDirectionVectorSet_t SCRAMBLED_DIRECTION_VECTORS_64_JOEKUO6 = CURAND_SCRAMBLED_DIRECTION_VECTORS_64_JOEKUO6; |
| 177 |
|
| 178 |
// CUDA: curandStatus_t CURANDAPI curandCreateGenerator(curandGenerator_t *generator, curandRngType_t rng_type); |
| 179 |
// HIP: hiprandStatus_t HIPRANDAPI hiprandCreateGenerator(hiprandGenerator_t* generator, hiprandRngType_t rng_type) |
| 180 |
// CHECK: status = hiprandCreateGenerator(&randGenerator, randRngType_t); |
| 181 |
status = curandCreateGenerator(&randGenerator, randRngType_t); |
| 182 |
|
| 183 |
// CUDA: curandStatus_t CURANDAPI curandDestroyGenerator(curandGenerator_t generator); |
| 184 |
// HIP: hiprandStatus_t HIPRANDAPI hiprandDestroyGenerator(hiprandGenerator_t generator); |
| 185 |
// CHECK: status = hiprandDestroyGenerator(randGenerator); |
| 186 |
status = curandDestroyGenerator(randGenerator); |
| 187 |
|
| 188 |
// CUDA: curandStatus_t CURANDAPI curandCreateGeneratorHost(curandGenerator_t *generator, curandRngType_t rng_type); |
| 189 |
// HIP: hiprandStatus_t HIPRANDAPI hiprandCreateGeneratorHost(hiprandGenerator_t * generator, hiprandRngType_t rng_type); |
| 190 |
// CHECK: status = hiprandCreateGeneratorHost(&randGenerator, randRngType_t); |
| 191 |
status = curandCreateGeneratorHost(&randGenerator, randRngType_t); |
| 192 |
|
| 193 |
// CUDA: curandStatus_t CURANDAPI curandSetGeneratorOrdering(curandGenerator_t generator, curandOrdering_t order); |
| 194 |
// HIP: hiprandStatus_t HIPRANDAPI hiprandSetGeneratorOrdering(hiprandGenerator_t generator, hiprandOrdering_t order); |
| 195 |
// CHECK: status = hiprandSetGeneratorOrdering(randGenerator, randOrdering_t); |
| 196 |
status = curandSetGeneratorOrdering(randGenerator, randOrdering_t); |
| 197 |
|
| 198 |
// CUDA: curandStatus_t CURANDAPI curandGetDirectionVectors64(curandDirectionVectors64_t *vectors[], curandDirectionVectorSet_t set); |
| 199 |
// HIP: hiprandStatus_t HIPRANDAPI hiprandGetDirectionVectors64(hiprandDirectionVectors64_t** vectors, hiprandDirectionVectorSet_t set); |
| 200 |
// CHECK: status = hiprandGetDirectionVectors64(&pDirections64, directionVectorSet_t); |
| 201 |
status = curandGetDirectionVectors64(&pDirections64, directionVectorSet_t); |
| 202 |
|
| 203 |
// CUDA: curandStatus_t CURANDAPI curandGenerate(curandGenerator_t generator, unsigned int *outputPtr, size_t num); |
| 204 |
// HIP: hiprandStatus_t HIPRANDAPI hiprandGenerate(hiprandGenerator_t generator, unsigned int * output_data, size_t n); |
| 205 |
// CHECK: status = hiprandGenerate(randGenerator, outputPtr, num); |
| 206 |
status = curandGenerate(randGenerator, outputPtr, num); |
| 207 |
|
| 208 |
// CUDA: curandStatus_t CURANDAPI curandGenerateLogNormal(curandGenerator_t generator, float *outputPtr, size_t n, float mean, float stddev); |
| 209 |
// HIP: hiprandStatus_t HIPRANDAPI hiprandGenerateLogNormal(hiprandGenerator_t generator, float * output_data, size_t n, float mean, float stddev); |
| 210 |
// CHECK: status = hiprandGenerateLogNormal(randGenerator, outputPtrFloat, num, mean, stddev); |
| 211 |
status = curandGenerateLogNormal(randGenerator, outputPtrFloat, num, mean, stddev); |
| 212 |
|
| 213 |
// CUDA: curandStatus_t CURANDAPI curandGenerateLongLong(curandGenerator_t generator, unsigned long long *outputPtr, size_t num); |
| 214 |
// HIP: hiprandStatus_t HIPRANDAPI hiprandGenerateLongLong(hiprandGenerator_t generator, unsigned long long* output_data, size_t n); |
| 215 |
// CHECK: status = hiprandGenerateLongLong(randGenerator, outputPtrUll, num); |
| 216 |
status = curandGenerateLongLong(randGenerator, outputPtrUll, num); |
| 217 |
|
| 218 |
// CUDA: curandStatus_t CURANDAPI curandGenerateNormal(curandGenerator_t generator, float *outputPtr, size_t n, float mean, float stddev); |
| 219 |
// HIP: hiprandStatus_t HIPRANDAPI hiprandGenerateNormal(hiprandGenerator_t generator, float * output_data, size_t n, float mean, float stddev); |
| 220 |
// CHECK: status = hiprandGenerateNormal(randGenerator, outputPtrFloat, num, mean, stddev); |
| 221 |
status = curandGenerateNormal(randGenerator, outputPtrFloat, num, mean, stddev); |
| 222 |
|
| 223 |
// CUDA: curandStatus_t CURANDAPI curandGenerateNormalDouble(curandGenerator_t generator, double *outputPtr, size_t n, double mean, double stddev); |
| 224 |
// HIP: hiprandStatus_t HIPRANDAPI hiprandGenerateNormalDouble(hiprandGenerator_t generator, double * output_data, size_t n, double mean, double stddev); |
| 225 |
// CHECK: status = hiprandGenerateNormalDouble(randGenerator, outputPtrDouble, num, dmean, dstddev); |
| 226 |
status = curandGenerateNormalDouble(randGenerator, outputPtrDouble, num, dmean, dstddev); |
| 227 |
|
| 228 |
// CUDA: curandStatus_t CURANDAPI curandGenerateUniform(curandGenerator_t generator, float *outputPtr, size_t num); |
| 229 |
// HIP: hiprandStatus_t HIPRANDAPI hiprandGenerateUniform(hiprandGenerator_t generator, float * output_data, size_t n); |
| 230 |
// CHECK: status = hiprandGenerateUniform(randGenerator, outputPtrFloat, num); |
| 231 |
status = curandGenerateUniform(randGenerator, outputPtrFloat, num); |
| 232 |
|
| 233 |
// CUDA: curandStatus_t CURANDAPI curandGenerateUniformDouble(curandGenerator_t generator, double *outputPtr, size_t num); |
| 234 |
// HIP: hiprandStatus_t HIPRANDAPI hiprandGenerateUniformDouble(hiprandGenerator_t generator, double * output_data, size_t n); |
| 235 |
// CHECK: status = hiprandGenerateUniformDouble(randGenerator, outputPtrDouble, num); |
| 236 |
status = curandGenerateUniformDouble(randGenerator, outputPtrDouble, num); |
| 237 |
|
| 238 |
// CUDA: curandStatus_t CURANDAPI curandGenerateLogNormalDouble(curandGenerator_t generator, double *outputPtr, size_t n, double mean, double stddev); |
| 239 |
// HIP: hiprandStatus_t HIPRANDAPI hiprandGenerateLogNormalDouble(hiprandGenerator_t generator, double * output_data, size_t n, double mean, double stddev); |
| 240 |
// CHECK: status = hiprandGenerateLogNormalDouble(randGenerator, outputPtrDouble, num, dmean, dstddev); |
| 241 |
status = curandGenerateLogNormalDouble(randGenerator, outputPtrDouble, num, dmean, dstddev); |
| 242 |
|
| 243 |
// CUDA: curandStatus_t CURANDAPI curandGeneratePoisson(curandGenerator_t generator, unsigned int *outputPtr, size_t n, double lambda); |
| 244 |
// HIP: hiprandStatus_t HIPRANDAPI hiprandGeneratePoisson(hiprandGenerator_t generator, unsigned int * output_data, size_t n, double lambda); |
| 245 |
// CHECK: status = hiprandGeneratePoisson(randGenerator, outputPtr, num, dlambda); |
| 246 |
status = curandGeneratePoisson(randGenerator, outputPtr, num, dlambda); |
| 247 |
|
| 248 |
// CUDA: curandStatus_t CURANDAPI curandGenerateSeeds(curandGenerator_t generator); |
| 249 |
// HIP: hiprandStatus_t HIPRANDAPI hiprandGenerateSeeds(hiprandGenerator_t generator); |
| 250 |
// CHECK: status = hiprandGenerateSeeds(randGenerator); |
| 251 |
status = curandGenerateSeeds(randGenerator); |
| 252 |
|
| 253 |
// CUDA: curandStatus_t CURANDAPI curandSetGeneratorOffset(curandGenerator_t generator, unsigned long long offset); |
| 254 |
// HIP: hiprandStatus_t HIPRANDAPI hiprandSetGeneratorOffset(hiprandGenerator_t generator, unsigned long long offset); |
| 255 |
// CHECK: status = hiprandSetGeneratorOffset(randGenerator, offset); |
| 256 |
status = curandSetGeneratorOffset(randGenerator, offset); |
| 257 |
|
| 258 |
// CUDA: curandStatus_t CURANDAPI curandSetPseudoRandomGeneratorSeed(curandGenerator_t generator, unsigned long long seed); |
| 259 |
// HIP: hiprandStatus_t HIPRANDAPI hiprandSetPseudoRandomGeneratorSeed(hiprandGenerator_t generator, unsigned long long seed); |
| 260 |
// CHECK: status = hiprandSetPseudoRandomGeneratorSeed(randGenerator, offset); |
| 261 |
status = curandSetPseudoRandomGeneratorSeed(randGenerator, offset); |
| 262 |
|
| 263 |
// CUDA: curandStatus_t CURANDAPI curandSetStream(curandGenerator_t generator, cudaStream_t stream); |
| 264 |
// HIP: hiprandStatus_t HIPRANDAPI hiprandSetStream(hiprandGenerator_t generator, hipStream_t stream); |
| 265 |
// CHECK: status = hiprandSetStream(randGenerator, stream); |
| 266 |
status = curandSetStream(randGenerator, stream); |
| 267 |
|
| 268 |
// CUDA: curandStatus_t CURANDAPI curandCreatePoissonDistribution(double lambda, curandDiscreteDistribution_t *discrete_distribution); |
| 269 |
// HIP: hiprandStatus_t HIPRANDAPI hiprandCreatePoissonDistribution(double lambda, hiprandDiscreteDistribution_t * discrete_distribution); |
| 270 |
// CHECK: status = hiprandCreatePoissonDistribution(dlambda, &discreteDistribution_t); |
| 271 |
status = curandCreatePoissonDistribution(dlambda, &discreteDistribution_t); |
| 272 |
|
| 273 |
// CUDA: curandStatus_t CURANDAPI curandDestroyDistribution(curandDiscreteDistribution_t discrete_distribution); |
| 274 |
// HIP: hiprandStatus_t HIPRANDAPI hiprandDestroyDistribution(hiprandDiscreteDistribution_t discrete_distribution); |
| 275 |
// CHECK: status = hiprandDestroyDistribution(discreteDistribution_t); |
| 276 |
status = curandDestroyDistribution(discreteDistribution_t); |
| 277 |
|
| 278 |
// CUDA: curandStatus_t CURANDAPI curandGetScrambleConstants32(unsigned int * * constants); |
| 279 |
// HIP: hiprandStatus_t HIPRANDAPI hiprandGetScrambleConstants32(const unsigned int** constants); |
| 280 |
// CHECK: status = hiprandGetScrambleConstants32(&constants); |
| 281 |
status = curandGetScrambleConstants32(&constants); |
| 282 |
|
| 283 |
// CUDA: curandStatus_t CURANDAPI curandGetScrambleConstants64(unsigned long long * * constants); |
| 284 |
// HIP: hiprandStatus_t HIPRANDAPI hiprandGetScrambleConstants64(const unsigned long long** constants); |
| 285 |
// CHECK: status = hiprandGetScrambleConstants64(&constantsLL); |
| 286 |
status = curandGetScrambleConstants64(&constantsLL); |
| 287 |
|
| 288 |
// CUDA: curandStatus_t CURANDAPI curandGetVersion(int *version); |
| 289 |
// HIP: hiprandStatus_t HIPRANDAPI hiprandGetVersion(int * version); |
| 290 |
// CHECK: status = hiprandGetVersion(&version); |
| 291 |
status = curandGetVersion(&version); |
| 292 |
|
| 293 |
// CUDA: curandStatus_t CURANDAPI curandSetQuasiRandomGeneratorDimensions(curandGenerator_t generator, unsigned int num_dimensions); |
| 294 |
// HIP: hiprandStatus_t HIPRANDAPI hiprandSetQuasiRandomGeneratorDimensions(hiprandGenerator_t generator, unsigned int dimensions); |
| 295 |
// CHECK: status = hiprandSetQuasiRandomGeneratorDimensions(randGenerator, num_dimensions); |
| 296 |
status = curandSetQuasiRandomGeneratorDimensions(randGenerator, num_dimensions); |
| 297 |
|
| 298 |
#if CUDA_VERSION >= 11000 && CURAND_VERSION >= 10200 |
| 299 |
// CHECK: hiprandOrdering_t RAND_ORDERING_PSEUDO_LEGACY = HIPRAND_ORDERING_PSEUDO_LEGACY; |
| 300 |
curandOrdering_t RAND_ORDERING_PSEUDO_LEGACY = CURAND_ORDERING_PSEUDO_LEGACY; |
| 301 |
#endif |
| 302 |
|
| 303 |
#if CUDA_VERSION >= 11050 && CURAND_VERSION >= 10207 |
| 304 |
// CHECK: hiprandOrdering_t RAND_ORDERING_PSEUDO_DYNAMIC = HIPRAND_ORDERING_PSEUDO_DYNAMIC; |
| 305 |
curandOrdering_t RAND_ORDERING_PSEUDO_DYNAMIC = CURAND_ORDERING_PSEUDO_DYNAMIC; |
| 306 |
#endif |
| 307 |
|
| 308 |
return 0; |
| 309 |
} |