So I'm currently coding this signal processing with CUDA and I run over a very strange issue, which clearly is a bug in either the driver or the hardware. I tracked down the issue called over my colleague to assert me, that I'm not on drugs or hallucinating. He confirmed it and then I set out to find a workaround (which turned out to be easy, but, well, weird).

This whole thing made me wonder if there either was already, or there should be a site on the SE network for discussion of code that should work but gets broken by external dependencies, so that other people can either confirm the problem, or point it out. I don't think that the codereview.stackexchange.com is not the right place for this.

In case you wonder what my CUDA issue is.

This is broken for 2^n - 1 < a < 2^n +1 for any n

float a = ...; // also happens with int
float t = threadIdx.x;
float tau = t / (float)a;

and this works

// may be any number that won't make 'a' multiply
// to a number close to a power of 2
#define WEIRDAROUND 1.2345

float a = ...; // also for int
float t = threadIdx.x * WEIRDAROUND;
float tau = t / ((float)a * WEIRDAROUND);
  • 1
    I think SO covers most of what you are suggesting.
    – Ryathal
    Sep 7 '12 at 14:44

You are right that Code Review Stack Exchange is not appropriate for this kind of question. From their FAQ:

If you are looking for feedback on a specific working piece of code from your project in the following areas…

  • Best practices and design pattern usage
  • Security issues
  • Performance
  • Correctness in unanticipated cases

then you are in the right place!

I would hardly call a bizarre workaround that you don't understand as working code and would be considered off topic.

If you are genuinely concerned about solving the issue specifically then it would make sense for Stack Overflow. If however you have a question about driver workarounds in general or how they can affect your design then it would be appropriate for Programmers. Asking Programmers for help with this specific problem would be off topic on Programmers.

In the end however, if you can see yourself having a lengthy discussion over a workaround in code then, it might not be a good fit for any site. This is a Q&A site and doesn't lend itself well to lengthy discussions and a lot of back and forth. If this is the case for your specific question then it may be too overly broad or rhetorical to be answered well in this format. In which case I would recommend you ask around in the chat rooms and see if anybody wants to discuss with you in there.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .