4

My CL program:

constant double LATTICEWEIGHTS[19] = { 1.0 / 36.0,

                                      .....

                                      1.0 / 36.0 };

void
computeFeq(
  double  density,
  double3 velocity,
  double* feq) {
  for (int i = 0; i < 19; ++i) {
    feq[i] = LATTICEWEIGHTS[i];         // Line 1
    //feq[i] = 2.0 * LATTICEWEIGHTS[i]; // Line 2
  }
}

__kernel void
Kernel(){

  .....

  double  density;
  double3 velocity;
  double  feq[19];

  computeFeq(density, velocity, feq);
}

This code works. But if I comment Line 1 and uncomment Line2, the CL_OUT_OF_RESOURCES will occur immediately.

Any ideas?

I test it with NVIDIA GTX 670M.

5

This does seem wrong, but some things to check first: register usage. Nvidia GPUs support a verbose output option. Pass that to clBuildProgram and then check the build log. Something like this:

clBuildProgram(program, 1, &device_id, "-cl-nv-verbose", NULL, NULL);

This is documented under the cl_nv_compiler_options extension. Lookup the maximum number of registers for your device in the CUDA documents. What could be happening is that the total number of registers required by a block of work items is more than is available in a single SM/SMX, resulting in the error.

If register usage is not the problem, then it could be an out of bounds memory access somewhere. I no that the error message does not suggest this, but I have experienced such errors before. Such an error could be anywhere and is much harder to find.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.