<?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 short int or char in viRngUniform in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/short-int-or-char-in-viRngUniform/m-p/901451#M11306</link>
    <description>&lt;P&gt;Hi Sergey,&lt;/P&gt;
&lt;P&gt;Thanks. The idea of blocking seems very good. I'll implement it and see the effect on memory and performance.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Daro&lt;/P&gt;</description>
    <pubDate>Thu, 04 Feb 2010 16:18:12 GMT</pubDate>
    <dc:creator>dario_suarez</dc:creator>
    <dc:date>2010-02-04T16:18:12Z</dc:date>
    <item>
      <title>short int or char in viRngUniform</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/short-int-or-char-in-viRngUniform/m-p/901449#M11304</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I'm usign large array of very small random numbers, often between 0 and 10. This large arrays consume 4 bytes per entry (int), and I would like to know if there is a way for generating arrays of short int and chars to save memory.&lt;/P&gt;
&lt;P&gt;Thanks in advance for your help,&lt;/P&gt;
&lt;P&gt;Daro&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2010 11:05:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/short-int-or-char-in-viRngUniform/m-p/901449#M11304</guid>
      <dc:creator>dario_suarez</dc:creator>
      <dc:date>2010-02-04T11:05:32Z</dc:date>
    </item>
    <item>
      <title>short int or char in viRngUniform</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/short-int-or-char-in-viRngUniform/m-p/901450#M11305</link>
      <description>Hello Dario,&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Unfortunately there is no 8-bit or 16-bit variant of the uniform RNG in MKL. The only workaround that I see is to generate the data by portions as 32-bit integers and process those integers in a way you need. It will save the storage.&lt;/P&gt;
&lt;P&gt;If for some reason youneed to store entire array of chars you still can generate it by blocks by converting each block into array of bytes, something like this:&lt;P&gt;&lt;/P&gt;&lt;/P&gt;
&lt;P&gt;#define N (1024*1000)&lt;P&gt;&lt;/P&gt;&lt;/P&gt;
&lt;P&gt;#define BLOCK_SIZE 1024&lt;P&gt;&lt;/P&gt;&lt;/P&gt;
&lt;P&gt;int block[BLOCK_SIZE];&lt;P&gt;&lt;/P&gt;&lt;/P&gt;
&lt;P&gt;char urng&lt;N&gt;;&lt;P&gt;&lt;/P&gt;&lt;/N&gt;&lt;/P&gt;
&lt;P&gt;... //Create the random stream&lt;P&gt;&lt;/P&gt;&lt;/P&gt;
&lt;P&gt;for (i=0; i&lt;N&gt;&lt;/N&gt;&lt;/P&gt;
&lt;P&gt;{&lt;P&gt;&lt;/P&gt;&lt;/P&gt;
&lt;P&gt; // Generate block of 32-bit integers&lt;P&gt;&lt;/P&gt;&lt;/P&gt;
&lt;P&gt; viRndUniform(0, stream, BLOCK_SIZE, block, 0, 10);&lt;P&gt;&lt;/P&gt;&lt;/P&gt;
&lt;P&gt; for (j=0; j&lt;BLOCK_SIZE&gt;&lt;/BLOCK_SIZE&gt;&lt;/P&gt;
&lt;P&gt; {&lt;P&gt;&lt;/P&gt;&lt;/P&gt;
&lt;P&gt; urng[i+j] = (char)block&lt;J&gt;;&lt;P&gt;&lt;/P&gt;&lt;/J&gt;&lt;/P&gt;
&lt;P&gt; }&lt;P&gt;&lt;/P&gt;&lt;/P&gt;
&lt;P&gt;}&lt;P&gt;&lt;/P&gt;&lt;/P&gt;
&lt;P&gt;... // Delete the random stream&lt;P&gt;&lt;/P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;That may help,&lt;P&gt;&lt;/P&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;P&gt;&lt;/P&gt;&lt;/P&gt;
&lt;P&gt;Sergey&lt;P&gt;&lt;/P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2010 11:39:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/short-int-or-char-in-viRngUniform/m-p/901450#M11305</guid>
      <dc:creator>Sergey_M_Intel2</dc:creator>
      <dc:date>2010-02-04T11:39:15Z</dc:date>
    </item>
    <item>
      <title>short int or char in viRngUniform</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/short-int-or-char-in-viRngUniform/m-p/901451#M11306</link>
      <description>&lt;P&gt;Hi Sergey,&lt;/P&gt;
&lt;P&gt;Thanks. The idea of blocking seems very good. I'll implement it and see the effect on memory and performance.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Daro&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2010 16:18:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/short-int-or-char-in-viRngUniform/m-p/901451#M11306</guid>
      <dc:creator>dario_suarez</dc:creator>
      <dc:date>2010-02-04T16:18:12Z</dc:date>
    </item>
  </channel>
</rss>

