CURAND를 사용하여 난수를 생성하고 있습니다. 나는 3600 만개의 난수 인 3 개의 배열을 채우기 위해 curandGenerator_t
을 만들었습니다. 각 어레이에는 서로 다른 시드가 있습니다. 수 세대가 더 많거나 적은이 같은 루프 내에서 수행됩니다CURAND가 더 느리게 실행 중입니다.
curandGenerator_t randGenerator;
curandCreateGenerator(&randGenerator, CURAND_RNG_PSEUDO_DEFAULT);
for(i = 0; i < 100; i++)
{
curandSetStream(randGenerator, stream[0]);
curandSetPseudoRandomGeneratorSeed(randGenerator, seed[0]);
curandGenerateUniformDouble(randGenerator, d_rv0, N);
curandSetStream(randGenerator, stream[1]);
curandSetPseudoRandomGeneratorSeed(randGenerator, seed[1]);
curandGenerateUniformDouble(randGenerator, d_rv1, N);
curandSetStream(randGenerator, stream[2]);
curandSetPseudoRandomGeneratorSeed(randGenerator, seed[2]);
curandGenerateUniformDouble(randGenerator, d_rv2, N);
}
내가지고있어 결과가 예상되는이 있지만 응용 프로그램을 프로파일 링 후 나는 깨달았다 그것은 잘 작동하는 루프 생성의 몇 가지 반복 후 난수가 더 느려집니다. 다음 이미지에서 파란 녹색 항목은 100ms에서 1s로 이동합니다.
난수 생성의 정상적인 동작인지 누군가가 설명 할 수 있습니까?
3 개의 다른 씨앗과 하나의 curand 생성자로 임의의 숫자를 생성하는 것을 잘못하고 있습니까?
나는 종자를 바꾼 후에도 발전기가 상태를 저장했다. 그리고 난 정말 3 가지 다른 임의의 스트림에 대해 3 가지 다른 씨앗이 필요합니다. 나는 그것을보고 어떻게 움직이는 지 볼 것이다. 문제가 계속되면 다시 게시 할 것입니다. – BRabbit27
문제는 실제로'curandSetSeed()'와 똑같은 테스트를 실행했는데 더 이상 느려지는 효과가 없으며 사실 더 빨라졌습니다. – BRabbit27