Quantcast
Channel: Intel® Software - Intel® Integrated Performance Primitives
Viewing all articles
Browse latest Browse all 1489

Uniform Random Noise Generation problem

$
0
0

I'm trying to generate some random uniform noise using IPP but am stuck.  The IppsRandUniState_64f is not fully defined, so I'm not sure how to allocate the necessary memory.  In the past in IPP, one used RandUniformInitAlloc, but this is deprecated and gone.  I can't find any examples, so if someone can point out how to allocate and free the memory for the random state variable it would be greatly appreciated.

My code:

		Ipp64f* phaseArr = ippsMalloc_64f(halfLen+1);
		int randUniSize;
		ippsRandUniformGetSize_64f(&randUniSize);
		IppsRandUniState_64f* ipRandState = (IppsRandUniState_64f*)ippMalloc_8u(randUniSize);

		ippsRandUniformInit_64f(ipRandState, 0, 2*M_PI, clock());
		ippsRandUniform_64f(phaseArr, halfLen+1, ipRandState);
		if( ipRandState )
			ippFree(ipRandState);

Edit: Simple fix.  4th line of code fixed and it compiles fine.


Viewing all articles
Browse latest Browse all 1489

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>