Hi , I'm using MKL with fftw3 to calculate the price of an option. I've converted code from Matlab to C++. The code used to work in VS2008 but I had to upgrade my environment and now I use VS2010 with a new compiler and it no longer works. Environment information is
System Type x64-based PC
Processor Intel Core2 Duo CPU P8600 @ 2.40GHz, 2401 Mhz, 2 Core(s), 2 Logical Processor(s)
Intel Parallel Studio XE for Windows* (all tools)
Version 2011 (SP1 Update 2 VS)
Intel Math Kernel Library for Windows*
Version 10.3 (9)
Microsoft Visual Studio 2010
Version 10.0.30319.1 RTMRel
Microsoft .NET Framework
Version 4.0.30319 RTMRel
Intel C++ Composer XE 2011 Update 9 Package ID: w_ccompxe_2011.9.300
Intel C++ Composer XE 2011 Update 9 Integration for Microsoft Visual Studio* 2010, Version 12.1.1109.2010, Copyright 2002-2012 Intel Corporation
Intel Inspector XE 2011 Update 9
Intel Inspector XE 2011 Update 9, (build 218166), Copyright 2009-2012 Intel Corporation. All rights reserved.
Intel VTune Amplifier XE 2011 Update 8
Intel VTune Amplifier XE 2011 Update 8, (build 221625), Copyright 2009-2012 Intel Corporation. All rights reserved.
NB. when I look at VS2010 "about" information it does not show the MKL installed. Should it?
The errors coming out from the compilation are all for the use of the MKL_INT declaration of the k variable in the for loop. Example, error is
1>AOptionPricer.cpp(310): warning C4244: 'argument' : conversion from '__int64' to 'const int', possible loss of data
and the related code for this error is
for ( MKL_INT k=0 ; k
complex gxc = i*u*y[k] ;
cA[k].real = gxc.real() ;
cA[k].imag = gxc.imag() ;
where the line highlighted for this error in VS2010 is
complex gxc = i*u*y[k] ;
I am doing complex number arithmetic so need y[k] to be a vector calculation, hence the use of MKL_INT. This used to work, but now still compiles but crashes when run. I had this problem some time ago in vs20008, but corrected it with an updated compiler and I think some compiler options. Now I've updated the compiler and environment again and it does not work any more.
my includes are
and all are shown as found in vs2010 and as i said i have no link errors, only this conversion error.
I had fixed some of the conversion errors using a static_cast for my call to pow below
for (MKL_INT k=0 ; k
complex yyc = -pi*i*a*v ;
cA[k].real = yyc.real() ;
cA[k].imag = yyc.imag() ;
but am stuck for a fix for the aforementioned for loop.
Can you please help?