<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Hi Aaron, in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/Uniform-Random-Noise-Generation-problem/m-p/1158343#M26484</link>
    <description>&lt;P&gt;Hi Aaron,&lt;/P&gt;&lt;P&gt;your understanding is absolutely correct: starting from 9.0 version IPP doesn't make any internal memory allocations - all of them must be done at the application side. The algorithm is very simple -&lt;/P&gt;&lt;P&gt;1) query required amount of memory for internal spec/state structure&lt;/P&gt;&lt;P&gt;2) allocate this memory at the app side&lt;/P&gt;&lt;P&gt;3) init this memory with the corresponding IPP function&amp;nbsp;&lt;/P&gt;&lt;P&gt;4) then use corresponding processing function&lt;/P&gt;&lt;P&gt;5) free this memory at the app side when your app doesn't need this functionality any more&lt;/P&gt;&lt;P&gt;I slightly modified your example in order to show that it works properly:&lt;/P&gt;&lt;P&gt;#include &amp;lt;stdio.h&amp;gt;&lt;BR /&gt;#include "ipp.h"&lt;/P&gt;&lt;P&gt;#define LEN 15&lt;/P&gt;&lt;P&gt;int main(void){&lt;BR /&gt;&amp;nbsp; &amp;nbsp; int halfLen = LEN;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Ipp64f* phaseArr = ippsMalloc_64f(halfLen+1);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; int randUniSize;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ippsRandUniformGetSize_64f(&amp;amp;randUniSize);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; IppsRandUniState_64f* ipRandState = (IppsRandUniState_64f*)ippMalloc(randUniSize);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ippsRandUniformInit_64f(ipRandState, 0, IPP_2PI, 0);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ippsRandUniform_64f(phaseArr, halfLen+1, ipRandState);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if( ipRandState )&lt;BR /&gt;&amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ippFree(ipRandState);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp; for (int i = 0; i &amp;lt; halfLen + 1; i++ )&lt;BR /&gt;&amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; printf("phaseArr[%d] = %f\n", i, phaseArr&lt;I&gt;);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ippsFree( phaseArr);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return 0;&lt;BR /&gt;}&lt;/I&gt;&lt;/P&gt;&lt;P&gt;output:&lt;/P&gt;&lt;P&gt;phaseArr[0] = 2.212923&lt;BR /&gt;phaseArr[1] = 4.827087&lt;BR /&gt;phaseArr[2] = 5.894064&lt;BR /&gt;phaseArr[3] = 0.542820&lt;BR /&gt;phaseArr[4] = 0.041538&lt;BR /&gt;phaseArr[5] = 3.993393&lt;BR /&gt;phaseArr[6] = 1.864890&lt;BR /&gt;phaseArr[7] = 5.064686&lt;BR /&gt;phaseArr[8] = 3.053310&lt;BR /&gt;phaseArr[9] = 6.279690&lt;BR /&gt;phaseArr[10] = 4.524316&lt;BR /&gt;phaseArr[11] = 3.683678&lt;BR /&gt;phaseArr[12] = 6.067083&lt;BR /&gt;phaseArr[13] = 2.589079&lt;BR /&gt;phaseArr[14] = 2.736621&lt;BR /&gt;phaseArr[15] = 5.487123&lt;BR /&gt;Press any key to continue . . .&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards, Igor&lt;/P&gt;</description>
    <pubDate>Wed, 27 Feb 2019 08:48:52 GMT</pubDate>
    <dc:creator>Igor_A_Intel</dc:creator>
    <dc:date>2019-02-27T08:48:52Z</dc:date>
    <item>
      <title>Uniform Random Noise Generation problem</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Uniform-Random-Noise-Generation-problem/m-p/1158342#M26483</link>
      <description>&lt;P&gt;I'm trying to generate some random uniform noise using IPP but am stuck.&amp;nbsp; The&amp;nbsp;IppsRandUniState_64f is not fully defined, so I'm not sure how to allocate the necessary&amp;nbsp;memory.&amp;nbsp; In&amp;nbsp;the past in IPP, one used RandUniformInitAlloc, but this is deprecated and gone.&amp;nbsp; 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.&lt;/P&gt;&lt;P&gt;My code:&lt;/P&gt;
&lt;PRE class="brush:cpp; class-name:dark;"&gt;		Ipp64f* phaseArr = ippsMalloc_64f(halfLen+1);
		int randUniSize;
		ippsRandUniformGetSize_64f(&amp;amp;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);&lt;/PRE&gt;

&lt;P&gt;Edit: Simple fix.&amp;nbsp; 4th line of code fixed and it compiles fine.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 00:44:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Uniform-Random-Noise-Generation-problem/m-p/1158342#M26483</guid>
      <dc:creator>Aaron_A_</dc:creator>
      <dc:date>2019-02-25T00:44:34Z</dc:date>
    </item>
    <item>
      <title>Hi Aaron,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Uniform-Random-Noise-Generation-problem/m-p/1158343#M26484</link>
      <description>&lt;P&gt;Hi Aaron,&lt;/P&gt;&lt;P&gt;your understanding is absolutely correct: starting from 9.0 version IPP doesn't make any internal memory allocations - all of them must be done at the application side. The algorithm is very simple -&lt;/P&gt;&lt;P&gt;1) query required amount of memory for internal spec/state structure&lt;/P&gt;&lt;P&gt;2) allocate this memory at the app side&lt;/P&gt;&lt;P&gt;3) init this memory with the corresponding IPP function&amp;nbsp;&lt;/P&gt;&lt;P&gt;4) then use corresponding processing function&lt;/P&gt;&lt;P&gt;5) free this memory at the app side when your app doesn't need this functionality any more&lt;/P&gt;&lt;P&gt;I slightly modified your example in order to show that it works properly:&lt;/P&gt;&lt;P&gt;#include &amp;lt;stdio.h&amp;gt;&lt;BR /&gt;#include "ipp.h"&lt;/P&gt;&lt;P&gt;#define LEN 15&lt;/P&gt;&lt;P&gt;int main(void){&lt;BR /&gt;&amp;nbsp; &amp;nbsp; int halfLen = LEN;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Ipp64f* phaseArr = ippsMalloc_64f(halfLen+1);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; int randUniSize;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ippsRandUniformGetSize_64f(&amp;amp;randUniSize);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; IppsRandUniState_64f* ipRandState = (IppsRandUniState_64f*)ippMalloc(randUniSize);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ippsRandUniformInit_64f(ipRandState, 0, IPP_2PI, 0);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ippsRandUniform_64f(phaseArr, halfLen+1, ipRandState);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if( ipRandState )&lt;BR /&gt;&amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ippFree(ipRandState);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp; for (int i = 0; i &amp;lt; halfLen + 1; i++ )&lt;BR /&gt;&amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; printf("phaseArr[%d] = %f\n", i, phaseArr&lt;I&gt;);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ippsFree( phaseArr);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return 0;&lt;BR /&gt;}&lt;/I&gt;&lt;/P&gt;&lt;P&gt;output:&lt;/P&gt;&lt;P&gt;phaseArr[0] = 2.212923&lt;BR /&gt;phaseArr[1] = 4.827087&lt;BR /&gt;phaseArr[2] = 5.894064&lt;BR /&gt;phaseArr[3] = 0.542820&lt;BR /&gt;phaseArr[4] = 0.041538&lt;BR /&gt;phaseArr[5] = 3.993393&lt;BR /&gt;phaseArr[6] = 1.864890&lt;BR /&gt;phaseArr[7] = 5.064686&lt;BR /&gt;phaseArr[8] = 3.053310&lt;BR /&gt;phaseArr[9] = 6.279690&lt;BR /&gt;phaseArr[10] = 4.524316&lt;BR /&gt;phaseArr[11] = 3.683678&lt;BR /&gt;phaseArr[12] = 6.067083&lt;BR /&gt;phaseArr[13] = 2.589079&lt;BR /&gt;phaseArr[14] = 2.736621&lt;BR /&gt;phaseArr[15] = 5.487123&lt;BR /&gt;Press any key to continue . . .&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards, Igor&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 08:48:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Uniform-Random-Noise-Generation-problem/m-p/1158343#M26484</guid>
      <dc:creator>Igor_A_Intel</dc:creator>
      <dc:date>2019-02-27T08:48:52Z</dc:date>
    </item>
  </channel>
</rss>

