Error: expression must be of integral or enumerated type

In CUDA C, why is the following code

findMinMax<<sizeof(lum)/1024,1024>>(lum,&min_logLum,&max_logLum);

      

enter this error?

error: expression must have integral or enum type

      

+3


source to share


1 answer


You need to use triple angle brackets as part of your kernel startup syntax:

findMinMax<<<sizeof(lum)/1024,1024>>>(lum,&min_logLum,&max_logLum);

      

This should resolve the compilation error if everything else is correct (for example, the set of arguments matches the kernel prototype).



Note that some other things are suspicious about the way you start the kernel:

  • You will round the number of blocks per grid, not upwards. For example, if it sizeof(lum)

    evaluates to 1500, you still only run 1 block out of 1024 threads. This may not be what you intend to do.

  • You pass a pointer node &min_logLum

    and &max_logLum

    in the core of that, again, may not be what you intend to do here, but it's hard to tell without seeing the rest of your code.

+5


source







All Articles