I’ve been trying to play around with the pragma unroll construct but I keep getting the following compiler warning:
Advisory: Loop was not unrolled, unexpected control flow construct
Any idea what can be causing it and how to get pragma unroll working?
One of the codes that exhibits the problem if it helps:
[codebox]#pragma unroll 4
for (int kx = 0 ; kx < seWidth ; kx++)
{
unsigned char v;
v = tex2D(seTex, kx, ky);
if (v)
{
// Erosion of image by structuring element
fgResponse.x = fgResponse.x && PATCH(sx + kx, threadIdx.y + ky);
fgResponse.y = fgResponse.y && PATCH(sx + 1 + kx, threadIdx.y + ky);
fgResponse.z = fgResponse.z && PATCH(sx + 2 + kx, threadIdx.y + ky);
fgResponse.w = fgResponse.w && PATCH(sx + 3 + kx, threadIdx.y + ky);
}
v = tex2D(secTex, kx, ky);
if (v)
{
// Erosion of image complement by background structuring element (not that
// the background structuring element is not the structuring element complement
// if we want non-square hit-or-miss transform
bgResponse.x = bgResponse.x && !PATCH(sx + kx, threadIdx.y + ky);
bgResponse.y = bgResponse.y && !PATCH(sx + 1 + kx, threadIdx.y + ky);
bgResponse.z = bgResponse.z && !PATCH(sx + 2 + kx, threadIdx.y + ky);
bgResponse.w = bgResponse.w && !PATCH(sx + 3 + kx, threadIdx.y + ky);
}
}[/codebox]