Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Bahram_Vedadian
Beginner
52 Views

Serious bug in version 11 (optimization)

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?

0 Kudos
3 Replies
JenniferJ
Moderator
52 Views

did you use the latest 11.1?

is it Windows, Linux or MacOS? please provide a test if possible.

Thanks,
Jennifer

Bahram_Vedadian
Beginner
52 Views

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.

JenniferJ
Moderator
52 Views

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.

Thanks,
Jennifer

Reply