I’m having trouble disabling warnings inside kernels. I have a template CUDA kernel that does something like:
template<uint i>
__global__ void warning() {
if (i > 0)
for (uint j = 0; j < i; ++j);
}
int main(int argc, char **argv) {
warning<0><<<1,256>>>();
cudaDeviceSynchronize();
return 0;
}
When I compile this code I get the following (useless) warning:
warning.cu(4): warning: pointless comparison of unsigned integer with zero
detected during instantiation of “void warning() [with i=0U]”
(8): here
Is there any way to disable warnings on specific lines within a kernel?