cuda-samples
cuda-samples copied to clipboard
Example has misleading in-source comments and unused parameters
https://github.com/NVIDIA/cuda-samples/blob/b312abaa07ffdc1ba6e3d44a9bc1a8e89149c20b/Samples/2_Concepts_and_Techniques/boxFilter/boxFilter_kernel.cu#L450
The d_src
parameter is unused. It's an unexpected curiosity that is difficult to understand. The function signature suggests that the source image arrives via the d_src
parameter, it is even documented to that effect in comments above, but what actually happens is something completely different. The actual texture is referred to directly via a global variable called tex
.
Oddities like this should not appear in example code. It makes it difficult to understand the example code - especially when the in-source documentation and expected function API surprisingly do not coincide with the actual implementation.