In CUDA C, why does the following code
findMinMax<<sizeof(lum)/1024,1024>>(lum,&min_logLum,&max_logLum);
give this error?
error: expression must have integral or enum type
You need to use triple angled brackets as part of kernel launch syntax:
findMinMax<<<sizeof(lum)/1024,1024>>>(lum,&min_logLum,&max_logLum);
That should resolve compilation error, provided the rest is correct (e.g., the set of arguments matches the kernel prototype).
Note that a few other things are suspicious in the way you launch the kernel:
You round the number of blocks per grid down instead of up. For example, if sizeof(lum)
evaluates to 1500, you still launch only 1 block of 1024 threads. This may not be what you intend to do.
You pass host pointers &min_logLum
and &max_logLum
to the kernel, which, again, may be not what you intend to do here, however it is hard to tell without seeing the rest of your code.
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句