- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I downloaded and built the latest version of the intel c/c++ compilers yesterday and have been trying to do some simple random number generation examples, but keep getting the compile error:
icpc test.cpp -o test -lmkl_rt
>> test.cpp(40): error: identifier "VSL_METHOD_DGAUSSIAN_ICDF" is undefined
>> errcode = vdRngGaussian( METHOD, stream, N, A, a, sigma );
My example code is given below. If I uncomment out the line redefining method to be 2, the constant from mkl_vsl_defines.h, the code compiles and runs as expected.
Does anybody know why this could be happening? And if in the meantime, is it possible to add a dynamically linked library to workaround not finding these constants.
#include <mkl.h> #include <iostream> #define SEED 0 #define BRNG VSL_BRNG_MCG31 #define METHOD VSL_METHOD_DGAUSSIAN_ICDF //#define METHOD 2 using namespace std; int main(int argc, char **argv) { const int N = 1000; double A__attribute__((aligned(64))); int status; double a = 0, sigma = 1.0; VSLStreamStatePtr stream; int errcode; errcode = vslNewStream( &stream, BRNG, SEED ); errcode = vdRngGaussian( METHOD, stream, N, A, a, sigma ); errcode = vslDeleteStream( &stream ); cout << errcode; return 0; }
- Tags:
- CC++
- Development Tools
- Intel® C++ Compiler
- Intel® Parallel Studio XE
- Intel® System Studio
- Optimization
- Parallel Computing
- Vectorization
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I solved it.
This was a silly mistake, I was going off old guides but I think the constant names have changed. The help for vRngGaussian found here:
has the list of constants available and I should have been using
#define METHOD VSL_RNG_METHOD_GAUSSIAN_ICDF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Glad you were able to figure out. If the question pertains to MKL I would ask any future questions like this in that forum, i.e.:
https://software.intel.com/en-us/forums/intel-math-kernel-library

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page