Optimization of code causes elimination of some vital function calls and disputes the algorithm results.
No choice of optimization scheme other than "optimization:off" could change the situation.
Are there any workarounds for this?
Thanks for fast reply.
The exact version number is 11.1.054.
I'm using it under Microsoft Windows XP service pack 3. The code has no special structure and is a straightforward implementation of "elastic distortion". The compiler when used with optimizations enabled ignores two consecutive executions of "conv2"(2 dimensional convolution) procedure which in turn causes the delta values for distortion to remain uniformly random and not smoothed.
I tried different composition of options with optimizations enabled (i.e. whole program optimization, optimization level, different code paths ...) and none solved the issue. The only choice was to disable optimization for the before mentioned procedure.
I currently don't have the code but will provide it soon. But as mentioned there's no special structures within it.
The only suspecious fact is that I've used some buffers that change meaning cyclingly.
double* dX, dY, dB;
Convolve2D(dX, W, H, dS, GK, KS, KS, KS, dB, W, H, dS);
Convolve2D(dY, W, H, dS, GK, KS, KS, KS, dB, W, H, dX);
double* tmp = dY;
dX = dB;
dY = dX;
dB = tmp;
Convolve2D as I mentioned above convolves dX(or dY) with Gaussian kernel(GK) and three parameters after buffers stand for(in sequential order) Row count, Col. count and Column stride.
FINALLY, VERSION 10.1 OF THE COMPILER DIDN'T IGNORE THIS CODE AND GENERATED A FULLY VALID PROCEDURE.
Yeh, it sounds like a bug to me.
if you could create a testcase and attach to your posting, it would be great.maybe just the source code or .i file (preprocessed with /EP /P) would be enough and the compile-options.please use the private postingfor sensitive info.