calling curandSetPseudoRandomGeneratorSeed multiple times

Hi All,
Can curandSetPseudoRandomGeneratorSeed() be called multiple times per created curandGenerator_t?

I have

curandGenerator_t gen;

InitRNG(uint64_t seed)
{
    curandCreateGenerator(&gen, CURAND_RNG_PSEUDO_DEFAULT);

    curandSetPseudoRandomGeneratorSeed(gen, seed);
}

SetRNGSeed(uint64_t newSeed)
{
    curandSetPseudoRandomGeneratorSeed(gen, newSeed);
}

The first call to curandSetPseudoRandomGeneratorSeed() right after curandCreateGenerator() runs fine. However the second call in SetRNGSeed() on the same generator causes SEGV.
Is there a way to reset the generator without destroying and creating steps?
Thanks a lot.
xunlei

I think it should be possible. You should provide a complete code that demonstrates the failure, it may have nothing to do with the code you have shown. What you have shown seems to work without error for me:

$ cat t49.cu
#include <curand.h>
#include <stdint.h>

curandGenerator_t gen;

void InitRNG(uint64_t seed)
{
curandCreateGenerator(&gen, CURAND_RNG_PSEUDO_DEFAULT);

curandSetPseudoRandomGeneratorSeed(gen, seed);
}

void SetRNGSeed(uint64_t newSeed)
{
curandSetPseudoRandomGeneratorSeed(gen, newSeed);
}

int main(){

  InitRNG(0x1234ULL);
  SetRNGSeed(0x2345ULL);
  cudaDeviceSynchronize();
  return 0;
}
$ nvcc -arch=sm_61 -o t49 t49.cu -lcurand
$ cuda-memcheck ./t49
========= CUDA-MEMCHECK
========= ERROR SUMMARY: 0 errors
$

Hi txbob,
thank you very much for the quick diagnosis.
It turned out that I was trashing the address of hosting structure of gen in my code (gen is a field of that struct) when I calling SetRNGSeed() and thus the segv issue.
After I fix my bug, I verified that curandSetPseudoRandomGeneratorSeed() indeed can be called multiple times on the same handle.
Sorry for the false alarm.