OpenCL program build interferes with random numbers

Hi,

I have a program which uses random numbers in which an OpenCL program is created. Basically, it looks like this

  [..] // Initialization etc.
  srand(1); // Default should be 1, but just make sure.
  printf ("Before: %d\n", rand());
  if (program.build({default_device}) != CL_SUCCESS) {
    std::cout << " Error building: " << program.getBuildInfo<CL_PROGRAM_BUILD_LOG>(default_device) << "\n";
    return 1;
  }
  printf ("After: %d\n", rand());

The first random number is always the same, as it should be. However, the second is always different. This looks as though the OpenCL call messes up the random numbers in a way. Is there a reason why this should be expected?