2. I think I have MKL installed in my desktop because I have "C:\Program Files (x86)\Intel\Composer XE 2015\mkl" and I set it as MKLROOT path same as readme-windows indicates.
I also set LAPACK_LIBRARIES path to "C:\Program Files (x86)\Intel\Composer XE 2015\mkl\lib\intel64\mkl_intel_lp64_dll.lib;C:\Program Files (x86)\Intel\Composer XE 2015\mkl\lib\intel64\mkl_intel_thread_dll.lib;C:\Program Files (x86)\Intel\Composer XE 2015\mkl\lib\intel64\mkl_core_dll.lib;C:\Program Files (x86)\Intel\Composer XE 2015\compiler\lib\intel64\libiomp5md.lib" which also follows the readme-windows.
I actually can find mkl_intel_thread.dll under C:\Program Files (x86)\Intel\Composer XE 2015\redist\intel64\mkl, but it is not under any path I configured above. I would like to know should I add "C:\Program Files (x86)\Intel\Composer XE 2015\redist\intel64\mkl" as part of the MKLROOT and recompile everything in Visual Studio?
3. I have added C:\magma\include, C:\magma\control and C:\magma\test as the external library and now I am able to include "magma.h" without error. However, visual studio shows red line under "magma_err_t err" in my test program and when I tried to compile I got the below error message:
6 IntelliSense: identifier "magma_err_t" is undefined c:\users\administrator\documents\visual studio 2010\projects\magma_test\magmatest\test.cpp 11 1 magmaTest
Error 2 error C2146: syntax error : missing ';' before identifier 'err' c:\users\administrator\documents\visual studio 2010\projects\magma_test\magmatest\test.cpp 11 1 magmaTest
Error 1 error C2065: 'magma_err_t' : undeclared identifier c:\users\administrator\documents\visual studio 2010\projects\magma_test\magmatest\test.cpp 11 1 magmaTest
Error 3 error C2065: 'err' : undeclared identifier c:\users\administrator\documents\visual studio 2010\projects\magma_test\magmatest\test.cpp 11 1 magmaTest
Error 4 error C2065: 'err' : undeclared identifier c:\users\administrator\documents\visual studio 2010\projects\magma_test\magmatest\test.cpp 13 1 magmaTest
Error 5 error C2065: 'err' : undeclared identifier c:\users\administrator\documents\visual studio 2010\projects\magma_test\magmatest\test.cpp 15 1 magmaTest
I would like to know did I miss anything in my program or visual studio configuration? My code(which is actually a example from Matrix computations on the GPU CUBLAS and MAGMA by example) is shown below:
Code: Select all
#include<stdlib.h>
#include<stdio.h>
#include<cmath>
#include "magma.h"
int main ( int argc , char ** argv ){
magma_init (); // initialize Magma
magma_int_t m = 1024; // length of a
float *a; // a - m- vector on the host
float *d_a; // d_a - m- vector a on the device
magma_err_t err;
// allocate the vector on the host
err = magma_smalloc_cpu ( &a , m ); // host memory for a
// allocate the vector on the device
err = magma_smalloc ( &d_a , m ); // device memory for a
// a={ sin (0) , sin (1) ,... , sin (m -1)}
for(int j=0;j<m;j++) a[j]=sin((float)j);
// copy data from host to device
magma_ssetvector ( m, a, 1 , d_a , 1 ); // copy a -> d_a
// find the smallest index of the element of d_a with maximum
// absolute value
int i = magma_isamax( m, d_a, 1 );
printf ("max |a[i]|: %f\n", fabs(a[i -1]));
printf (" fortran index : %d\n",i);
free (a); // free host memory
magma_free (d_a ); // free device memory
magma_finalize (); // finalize Magma
return 0;
}
// max |a[i]|: 0.999990
//
// fortran index : 700
I also tried to comment out all magma_err_t err related code and I will got error when do the compilation :
Error 2 error LNK2019: unresolved external symbol MKL_Get_Version referenced in function magma_print_environment C:\Users\Administrator\Documents\Visual Studio 2010\Projects\magma_test\magmaTest\magma.lib(interface.obj) magmaTest
Error 1 error LNK2019: unresolved external symbol MKL_Get_Max_Threads referenced in function magma_print_environment C:\Users\Administrator\Documents\Visual Studio 2010\Projects\magma_test\magmaTest\magma.lib(interface.obj) magmaTest
Error 3 error LNK1120: 2 unresolved externals C:\Users\Administrator\Documents\Visual Studio 2010\Projects\magma_test\x64\Debug\magmaTest.exe 1 1 magmaTest
The code comment out magma_err_t err related code is below. I would like to know does the error means in my magma.lib is not building correctly so the MKL_Get_Version is not properly referenced?
Code: Select all
#include<stdlib.h>
#include<stdio.h>
#include<cmath>
#include "magma.h"
int main ( int argc , char ** argv ){
magma_init (); // initialize Magma
magma_int_t m = 1024; // length of a
float *a; // a - m- vector on the host
float *d_a; // d_a - m- vector a on the device
//magma_err_t err;
// allocate the vector on the host
magma_smalloc_cpu ( &a , m ); // host memory for a
// allocate the vector on the device
magma_smalloc ( &d_a , m ); // device memory for a
// a={ sin (0) , sin (1) ,... , sin (m -1)}
for(int j=0;j<m;j++) a[j]=sin((float)j);
// copy data from host to device
magma_ssetvector ( m, a, 1 , d_a , 1 ); // copy a -> d_a
// find the smallest index of the element of d_a with maximum
// absolute value
int i = magma_isamax( m, d_a, 1 );
printf ("max |a[i]|: %f\n", fabs(a[i -1]));
printf (" fortran index : %d\n",i);
free (a); // free host memory
magma_free (d_a ); // free device memory
magma_finalize (); // finalize Magma
return 0;
}
// max |a[i]|: 0.999990
//
// fortran index : 700