2

What is the proper way to use cufftGetSize1d (or any of the cufftGetSize*) functions?

I tried with:

cufftHandle plan;
size_t workSize;
cufftResult result;
cufftCreate(&plan);
result = cufftGetSize1d(plan, 1000, CUFFT_C2C, 1, &workSize);

However, the result of last call is always CUFFT_INVALID_VALUE, regardless of size, type, or batch i use. The same is with 2d and 3d variants. cufftEstimate1d works correctly.

user3452579
  • 413
  • 4
  • 14
  • 1
    I've been able to reproduce the error and at the moment cannot explain it. I have observed that it fails this way on CUDA 6.5 and CUDA 6.0, but it seems to work correctly on CUDA 5.5 If I discover any additional information, I will report back. Separately, `cufftGetSize` seems to work correctly. – Robert Crovella Oct 06 '14 at 16:07
  • I see the same thing with cufftGetSize3d() - worked in CUDA 5.5, fails in CUDA 6.5. cufftGetSize() does what I need, so I will use it instead. – David Steinhauer Oct 15 '14 at 21:54
  • I submitted a bug report to NVidia. Their response is that they have reproduced it, and the developer team is investigating. – David Steinhauer Oct 16 '14 at 16:01
  • @RobertCrovella: Seeing as this seemed to have been a genuine bug which is now fixed in CUDA 7, would you care to upvote (and edit if you have anything to add) the community wiki answer to get this question off the unanswered queue? – talonmies Jan 01 '16 at 14:32
  • @talonmies thanks for the pointer. I've gone through the "unanswered" list as far back as beginning of 2015 and upvoted a few other languishing answers. While doing so I came across [this Q with a CW answer](http://stackoverflow.com/questions/33880248/the-difference-between-running-time-and-time-of-obtaining-results-in-cuda) and thought you might want to have a look. – Robert Crovella Jan 01 '16 at 15:48

1 Answers1

2

This appears to be a bug which was introduced during the CUDA 6 release cycle and subsequently fixed in CUDA 7. The following code:

#include <iostream>
#include <cufft.h>

int main()
{

    cufftHandle plan;
    size_t workSize;
    cufftResult result;
    cufftCreate(&plan);
    result = cufftGetSize1d(plan, 1000, CUFFT_C2C, 1, &workSize);

    std::cout << "result = " << result << std::endl;

    return 0;
}

fails with CUFFT_INVALID_VALUE when compiled and run with the CUFFT shipped in CUDA 6.5, but succeeds when built and run against the CUFFT version in CUDA 7.0. As noted in comments, cufftGetSize appears to work correctly in CUDA 6.5. So the workaround is to use cufftGetSize or upgrade to a newer than CUDA 6.5 version of CUFFT.

[This community wiki entry was added mostly from comments to get this question off the unanswered question list]

talonmies
  • 70,661
  • 34
  • 192
  • 269