<?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 Re: RS &amp; GF(2) functions usage in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/RS-GF-2-functions-usage/m-p/902236#M12943</link>
    <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;there are two ways to use context (or state) in IPP functions. They are InitAlloc kind of functions, which takes care on structure allocation and initialization in one step and separate GetBufSize, alloc and Init functions. For the last case you determine number of bytes required to keep the particular structure with GetBufSize function, then you allocate this memory either with IPP mem allocation function or any other way and finaly you initialize that memory with Init function.&lt;BR /&gt;&lt;BR /&gt;To be honest, I do not see any issue with piece of code you refer to (8*sizeof(Ipp8u)). You may not need to specify size of element you if you allocate bytes with ippMalloc_8u function, that's correct although there is ni mistake if you do that. But when you allocate for example memory for array of 32-bit integers with ippMalloc_8u function you just have to specify size of element and the best way to do that is - sizeof(elelment type). So the piece of code in IPP is just good rule in programming for general case. I basically meanit is a good habbit if you write code in that way because this is kind of error free style of code writing.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt; Vladimir</description>
    <pubDate>Wed, 18 Feb 2009 10:55:30 GMT</pubDate>
    <dc:creator>Vladimir_Dudnik</dc:creator>
    <dc:date>2009-02-18T10:55:30Z</dc:date>
    <item>
      <title>RS &amp; GF(2) functions usage</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/RS-GF-2-functions-usage/m-p/902235#M12942</link>
      <description>Hi i'm trying to use the Reed Solomon Decoder Functions. But unfortunately there is absolutly no example code for all of these functions.&lt;BR /&gt;&lt;BR /&gt;The problem i have is the following:&lt;BR /&gt;When i want to use e.g. the function GFInit_8u&lt;BR /&gt;The documentation says:&lt;BR /&gt;&lt;BR /&gt;+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;BR /&gt;GFInit_8u&lt;BR /&gt;Initializes user-supplied memory as&lt;BR /&gt;IppsGFSpec_8u context for future use.&lt;BR /&gt;&lt;BR /&gt;Syntax&lt;BR /&gt;&lt;BR /&gt;IppStatus ippsGFInit_8u(int feBitSize, const Ipp8u* pPolynomial, IppsGFSpec_8u* pGF);&lt;BR /&gt;&lt;BR /&gt;Parameters&lt;BR /&gt;&lt;BR /&gt;feBitSize Size of the field element (in bits).&lt;BR /&gt;pPolynomial Pointer to the polynomial generating the finite field.&lt;BR /&gt;pGF Pointer to the finite field context to be initialized.&lt;BR /&gt;&lt;BR /&gt;Description&lt;BR /&gt;&lt;BR /&gt;This function is declared in the ippdi.h file. The function initializes the user-supplied&lt;BR /&gt;buffer as the context of the finite field GF(2feBitzise). The context is necessary for each&lt;BR /&gt;operation over the field.&lt;BR /&gt;&lt;SPAN style="text-decoration: underline;"&gt;The buffer for the context must have size that the function GFGetSize_8u returns.&lt;/SPAN&gt;&lt;BR /&gt;The polynomial is represented as an array of elements having type Ipp8u and length&lt;BR /&gt;(feBitSize+1). In Intel IPP, the lower index of an array corresponds to the lower power of&lt;BR /&gt;the independent variable. For example, to define the polynomial f(x) = x3 + x + 1, use the&lt;BR /&gt;array {1,1,0,1}.&lt;BR /&gt;Return Values&lt;BR /&gt;ippStsNoErr Indicates no error. Any other value indicates an error or warning.&lt;BR /&gt;ippStsNullPtrErr Indicates an error condition if any of the specified pointers is NULL.&lt;BR /&gt;ippStsRangeErr Indicates an error condition if the value of the parameter&lt;BR /&gt;feBitSize is less than 1 or greater than 8.&lt;BR /&gt;ippStsBadArgErr Indicates an error condition if the value of the parameter pointed&lt;BR /&gt;by pPolynomial is not irreducible.&lt;BR /&gt;+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;BR /&gt;&lt;BR /&gt;The underlined text says, that i have to alloate memory for the "IppsGFSpec_8u".&lt;BR /&gt;But how? Is there any function that allocates memory for that type, or do i have to allocate an&lt;BR /&gt;Ipp8u array and cast it to IppsGFSpec_8u ? Anyhow the normal ippsMalloc_8u function don't work for the IppsGFSpec_8u type. &lt;BR /&gt;Thanks in advance for help.&lt;BR /&gt;&lt;BR /&gt;Btw. there's an issue about the documentation of the ippsMalloc function.&lt;BR /&gt;In the code snipped that shows the usage is an mistake (in my opinion). &lt;BR /&gt;The code is:&lt;BR /&gt;&lt;BR /&gt;+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;BR /&gt;void func_malloc(void)&lt;BR /&gt;{&lt;BR /&gt;Ipp8u* pBuf = ippsMalloc_8u(8&lt;SPAN style="text-decoration: underline;"&gt;*sizeof(Ipp8u)&lt;/SPAN&gt;);&lt;BR /&gt;if(NULL == pBuf)&lt;BR /&gt;// not enough memory&lt;BR /&gt;ippsFree(pBuf);&lt;BR /&gt;}&lt;BR /&gt;+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+&lt;BR /&gt;&lt;BR /&gt;Why do i have to multiply the size of the Ipp8u type (in my code it was Ipp64fc) with the number of elements if the function only allocates memory for the Ipp8u type ? I deleted the "*sizeof(Ipp64fc)" part and my code still worked. So i assume that the memory allocator just needs the number of elements to be allocated. &lt;BR /&gt;</description>
      <pubDate>Tue, 17 Feb 2009 15:04:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/RS-GF-2-functions-usage/m-p/902235#M12942</guid>
      <dc:creator>jenni80</dc:creator>
      <dc:date>2009-02-17T15:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: RS &amp; GF(2) functions usage</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/RS-GF-2-functions-usage/m-p/902236#M12943</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;there are two ways to use context (or state) in IPP functions. They are InitAlloc kind of functions, which takes care on structure allocation and initialization in one step and separate GetBufSize, alloc and Init functions. For the last case you determine number of bytes required to keep the particular structure with GetBufSize function, then you allocate this memory either with IPP mem allocation function or any other way and finaly you initialize that memory with Init function.&lt;BR /&gt;&lt;BR /&gt;To be honest, I do not see any issue with piece of code you refer to (8*sizeof(Ipp8u)). You may not need to specify size of element you if you allocate bytes with ippMalloc_8u function, that's correct although there is ni mistake if you do that. But when you allocate for example memory for array of 32-bit integers with ippMalloc_8u function you just have to specify size of element and the best way to do that is - sizeof(elelment type). So the piece of code in IPP is just good rule in programming for general case. I basically meanit is a good habbit if you write code in that way because this is kind of error free style of code writing.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt; Vladimir</description>
      <pubDate>Wed, 18 Feb 2009 10:55:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/RS-GF-2-functions-usage/m-p/902236#M12943</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2009-02-18T10:55:30Z</dc:date>
    </item>
  </channel>
</rss>

