Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

NORM2 Intrinsic Performance

Aaron_S_1
Beginner
524 Views

All,

I'm just wondering if there is a good reason why calling SQRT( DOT_PRODUCT( V,V ) ) seems to perform better than NORM2(V). I'm trying to improve performance for a large program written in Fortran and I thought an easy first step would be to switch the first call to the second, but more testing proved otherwise. I compiled a test program with /O3 and /fp:source. I will admit when I use /fp:fast NORM2 is faster. Unfortunately, our legacy program requires /fp:source. I've attached the really rough source file for the program I used to test the performance. Is my test program flawed? This really is more of a curiosity than anything else. Thanks.

0 Kudos
1 Reply
Steven_L_Intel1
Employee
524 Views

Your program doesn't use the result of either call, so the compiler optimized both away. Your program doesn't show what you think it does.

0 Kudos
Reply