cufft is not part of the cuda runtime api. cufft is a separate library of functions. Since it's separate, it makes sense not to make cufft error enums dependent on the cuda runtime api library; such linkages hamper independent development of modules, codes, and libraries.
So when the book mentions CUDA calls, they are referring to the cuda runtime api, not the cufft library api.
Since the enumerated values returned from cufft library calls are independent of (and mostly orthogonal to) the enumerated values returned from the cuda runtime api, I don't think it's possible in any straightforward way to harmonize the two sets in a single macro. And since cuda calls and cufft calls may be intermingled in any piece of code, I can't think of an environmental way to do it. Someone else may come up with a clever approach, however.
If you want a cufft error enum to string parser, there is one in /usr/local/cuda/samples/common/inc/helper_cuda.h
(assuming standard linux CUDA 5 install) that may be of interest. Pasting it in here for convenience:
#ifdef _CUFFT_H_
// cuFFT API errors
static const char *_cudaGetErrorEnum(cufftResult error)
{
switch (error)
{
case CUFFT_SUCCESS:
return "CUFFT_SUCCESS";
case CUFFT_INVALID_PLAN:
return "CUFFT_INVALID_PLAN";
case CUFFT_ALLOC_FAILED:
return "CUFFT_ALLOC_FAILED";
case CUFFT_INVALID_TYPE:
return "CUFFT_INVALID_TYPE";
case CUFFT_INVALID_VALUE:
return "CUFFT_INVALID_VALUE";
case CUFFT_INTERNAL_ERROR:
return "CUFFT_INTERNAL_ERROR";
case CUFFT_EXEC_FAILED:
return "CUFFT_EXEC_FAILED";
case CUFFT_SETUP_FAILED:
return "CUFFT_SETUP_FAILED";
case CUFFT_INVALID_SIZE:
return "CUFFT_INVALID_SIZE";
case CUFFT_UNALIGNED_DATA:
return "CUFFT_UNALIGNED_DATA";
}
return "<unknown>";
}
#endif