<?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 Any problems casting as Ipp32f*? in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/Any-problems-casting-as-Ipp32f/m-p/882107#M10316</link>
    <description>&lt;P&gt;Yes, Ipp32f is 4 bytes single precision floating point data type so your calculationshould be fine. Could you please check that using IPP memory allocation (which provide alignment on 32-bytes boundary) does not cause issue?&lt;/P&gt;
&lt;P&gt;You can try either ippMalloc(NumElements*sizeof(Ipp32f)) or ippsMalloc_32f(NumElements) instead of _mm_malloc call. Note you will need to use ippFree or ippsFree accordingly.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt; Vladimir&lt;/P&gt;</description>
    <pubDate>Fri, 26 Feb 2010 21:45:38 GMT</pubDate>
    <dc:creator>Vladimir_Dudnik</dc:creator>
    <dc:date>2010-02-26T21:45:38Z</dc:date>
    <item>
      <title>Any problems casting as Ipp32f*?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Any-problems-casting-as-Ipp32f/m-p/882104#M10313</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I'm getting strange crashes when deallocating memory and it occured to me it may be the way I'm casting my buffers to the IPP functions. For example, I'm allocating memory as follows:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;float* SourceBuffer = (float*)_mm_malloc(BufferSize, 16);&lt;/P&gt;
&lt;P&gt;float* TargetBuffer = (float*)_mm_malloc(BufferSize, 16);&lt;/P&gt;
&lt;P&gt;etc...&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;When passing to an IPP function, I cast as follows:&lt;/P&gt;
&lt;P&gt;ippResult =ippsAbs_32f((const Ipp32f*)SourceBuffer, (Ipp32f*)TargetBuffer, NumElements);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Is this kosher?&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2010 20:05:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Any-problems-casting-as-Ipp32f/m-p/882104#M10313</guid>
      <dc:creator>lkeene</dc:creator>
      <dc:date>2010-02-26T20:05:45Z</dc:date>
    </item>
    <item>
      <title>Any problems casting as Ipp32f*?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Any-problems-casting-as-Ipp32f/m-p/882105#M10314</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;correct use of _mm_malloc function should not cause issues. Are you sure you calculate correct BufferSize? It should be something like BufferSize = NumElements * sizeof(Ipp32f)&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt; Vladimir&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2010 20:33:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Any-problems-casting-as-Ipp32f/m-p/882105#M10314</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2010-02-26T20:33:30Z</dc:date>
    </item>
    <item>
      <title>Any problems casting as Ipp32f*?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Any-problems-casting-as-Ipp32f/m-p/882106#M10315</link>
      <description>I'm actually calculating BufferSize as (NumElements * 4). Ipp32f is 32-bits, no?</description>
      <pubDate>Fri, 26 Feb 2010 21:23:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Any-problems-casting-as-Ipp32f/m-p/882106#M10315</guid>
      <dc:creator>lkeene</dc:creator>
      <dc:date>2010-02-26T21:23:02Z</dc:date>
    </item>
    <item>
      <title>Any problems casting as Ipp32f*?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Any-problems-casting-as-Ipp32f/m-p/882107#M10316</link>
      <description>&lt;P&gt;Yes, Ipp32f is 4 bytes single precision floating point data type so your calculationshould be fine. Could you please check that using IPP memory allocation (which provide alignment on 32-bytes boundary) does not cause issue?&lt;/P&gt;
&lt;P&gt;You can try either ippMalloc(NumElements*sizeof(Ipp32f)) or ippsMalloc_32f(NumElements) instead of _mm_malloc call. Note you will need to use ippFree or ippsFree accordingly.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt; Vladimir&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2010 21:45:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Any-problems-casting-as-Ipp32f/m-p/882107#M10316</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2010-02-26T21:45:38Z</dc:date>
    </item>
    <item>
      <title>Any problems casting as Ipp32f*?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Any-problems-casting-as-Ipp32f/m-p/882108#M10317</link>
      <description>&lt;P&gt;Using the IPP allocations has no effect on the error. Still crashing at "_mm_free(Buffer)". Some buffers crash upon deallocations whereas others don't. I've noticed that the ones that are problematic are implicated with functions that require packing/unpacking, and these happen to be the ones where I was a little unsure of the arguments. For example, I've got the following:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;
&lt;/P&gt;&lt;DIV id="_mcePaste"&gt;int columns = 32;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;int rows  = 32;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;IppiSize sizeOb;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;sizeOb.height = rows;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;sizeOb.width = columns;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;int BytesPerScanline = columns * 4;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;int BufferSize = rows * columns * 4;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;IppiFFTSpec_R_32f* fftSpec;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;IppResult = ippiFFTInitAlloc_R_32f(&amp;amp;fftSpec, Xorder, Yorder, IPP_FFT_DIV_FWD_BY_N, ippAlgHintFast);&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;int bufferSize;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;IppResult         = ippiFFTGetBufSize_R_32f(fftSpec, &amp;amp;bufferSize);&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;Ipp8u* ExternalFFTBuffer = (Ipp8u*)ippMalloc(bufferSize);&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;float* TempBuffer  = (float*)_mm_malloc(BufferSize, 16);&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;float* SourceBuffer = (float*)_mm_malloc(BufferSize, 16);&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;float* UnpackBuffer = (float*)_mm_malloc(BufferSize * 2, 16);&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;.&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;.&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;.&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;// Load source buffer with data...&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;.&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;.&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;.&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;// Forward FFT:&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;ippResult = ippiFFTFwd_RToPack_32f_C1R((const Ipp32f*)SourceBuffer, BytesPerScanline, (Ipp32f*)TempBuffer, BytesPerScanline, (const IppiFFTSpec_R_32f*)transformSpec, externalFFTBuffer);&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;// Unpack to complex array:&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;ippResult = ippiPackToCplxExtend_32f32fc_C1R((const Ipp32f*)tempBuffer, sizeOb, BytesPerScanline, (Ipp32fc*)UnpackBuffer, BytesPerScanline*2);&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;.&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;.&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;.&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;_mm_free(TempBuffer); // Crash -&amp;gt; "CRT detected that the application wrote to memory after end of heap buffer"&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;_mm_free(UnpackBuffer); // Crash -&amp;gt; "CRT detected that the application wrote to memory after end of heap buffer"&lt;/DIV&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;This looks good to me. Have I misunderstood something in the docs?&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2010 23:01:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Any-problems-casting-as-Ipp32f/m-p/882108#M10317</guid>
      <dc:creator>lkeene</dc:creator>
      <dc:date>2010-02-26T23:01:46Z</dc:date>
    </item>
    <item>
      <title>Any problems casting as Ipp32f*?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Any-problems-casting-as-Ipp32f/m-p/882109#M10318</link>
      <description>&lt;P&gt;Did you get my point about using appropriate ipp memorydeallocation function when you use ipp memory allocation ?&lt;/P&gt;
&lt;P&gt;Vladimir&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2010 23:09:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Any-problems-casting-as-Ipp32f/m-p/882109#M10318</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2010-02-26T23:09:23Z</dc:date>
    </item>
    <item>
      <title>Any problems casting as Ipp32f*?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Any-problems-casting-as-Ipp32f/m-p/882110#M10319</link>
      <description>Yes, sorry...I meant to say still crashing even when using "ippsMalloc_32f /ippsFree()".</description>
      <pubDate>Fri, 26 Feb 2010 23:12:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Any-problems-casting-as-Ipp32f/m-p/882110#M10319</guid>
      <dc:creator>lkeene</dc:creator>
      <dc:date>2010-02-26T23:12:58Z</dc:date>
    </item>
    <item>
      <title>Any problems casting as Ipp32f*?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Any-problems-casting-as-Ipp32f/m-p/882111#M10320</link>
      <description>&lt;P&gt;Well, did you pay attention to different size of source and destination images for ippiPackToCplxExtend function you use? According to IPP documentation:&lt;/P&gt;
PackToCplxExtend
&lt;P class="shortdesc"&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;P&gt;Converts an image in packed format to a complex data image.&lt;/P&gt;
&lt;DIV class="section"&gt;
Syntax
&lt;DIV class="dlsyntaxpara"&gt;
&lt;P class="dlsyntaxpara"&gt;IppStatus ippiPackToCplxExtend_32s32sc_C1R(const Ipp32s* pSrc, IppiSize srcSize, int srcStep, Ipp32sc* pDst, int dstStep);&lt;/P&gt;
&lt;P class="dlsyntaxpara"&gt;IppStatus ippiPackToCplxExtend_32f32fc_C1R(const Ipp32f* pSrc, IppiSize srcSize, int srcStep, Ipp32fc* pDst, int dstStep);&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="section"&gt;
Parameters
&lt;TABLE border="&amp;#0;" cellpadding="4" cellspacing="&amp;#0;" cols="&amp;#0;" width="90%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="noborder" valign="top" width="30%"&gt;
&lt;P&gt;pSrc&lt;/P&gt;
&lt;/TD&gt;
&lt;TD class="noborder" valign="top"&gt;Pointer to the source image ROI.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="noborder" valign="top" width="30%"&gt;
&lt;P&gt;srcSize&lt;/P&gt;
&lt;/TD&gt;
&lt;TD class="noborder" valign="top"&gt;Size in pixels of the source image ROI.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="noborder" valign="top" width="30%"&gt;
&lt;P&gt;srcStep&lt;/P&gt;
&lt;/TD&gt;
&lt;TD class="noborder" valign="top"&gt;Distance in bytes between starts of consecutive lines in the source buffer.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="noborder" valign="top" width="30%"&gt;
&lt;P&gt;pDst&lt;/P&gt;
&lt;/TD&gt;
&lt;TD class="noborder" valign="top"&gt;Pointer to the destination image buffer.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="noborder" valign="top" width="30%"&gt;
&lt;P&gt;dstStep&lt;/P&gt;
&lt;/TD&gt;
&lt;TD class="noborder" valign="top"&gt;Distance in bytes between starts of consecutive lines in the destination image buffer.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;DIV class="section"&gt;
Description
&lt;P&gt;The function ippiPackToCplxExtend is declared in the ippi.h file. It operates with ROI (see &lt;A href="mk:@MSITStore:C:Program%20FilesIntelParallel%20StudioComposerDocumentationen_USippippiman.chm::/ippi_ch2/ch2_regions_of_interest_in_intel_ipp.html#ch2_regions_of_interest_in_intel_ipp"&gt;Regions of Interest in Intel IPP&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;This function converts the source image pSrc in &lt;A href="mk:@MSITStore:C:Program%20FilesIntelParallel%20StudioComposerDocumentationen_USippippiman.chm::/ippi_ch10/ch10_real_complex_packed_rcpack2d_format.html#ch10_real_complex_packed_rcpack2d_format"&gt;RCPack2D format&lt;/A&gt; to complex data format and stores the results in pDst, which is a matrix with complete set of the Fourier coefficients. &lt;STRONG&gt;Note that if the pSrc in RCPack2D format is a real array of dimensions (NxM), then the pDst is a real array of dimensions (2xNxM). This should be taken into account when allocating memory for the function operation.&lt;/STRONG&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;Vladimir&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2010 23:28:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Any-problems-casting-as-Ipp32f/m-p/882111#M10320</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2010-02-26T23:28:31Z</dc:date>
    </item>
    <item>
      <title>Any problems casting as Ipp32f*?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Any-problems-casting-as-Ipp32f/m-p/882112#M10321</link>
      <description>&lt;P&gt;Yes. Please note my posted code has:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;TempBuffer = (float*)_mm_malloc(BufferSize, 16); // (M x N x NumBytesInFloat)&lt;/P&gt;
&lt;P&gt;UnpackBuffer = (float*)_mm_malloc(BufferSize * 2, 16); // (M x N x 2 x NumBytesInFloat)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Anyway, I may have misunderstood the documentation regarding one crucial aspect. Consider the following prototype:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;IppStatus ippsConj_32fc_I(Ipp32fc* pSrcDst, int len);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;where the docs state "int len =Number of elements in the vector."  This was a little ambiguous. I interpreted it as the sum of real and imaginary elements in the vector, i.e. I have&lt;/P&gt;
&lt;P&gt;int rows = 32;&lt;/P&gt;
&lt;P&gt;int columns = 32;&lt;/P&gt;
&lt;P&gt;int NumberOfValues = rows * columns;&lt;/P&gt;
&lt;P&gt;int NumberOfComplexElements = NumberOfValues * 2;&lt;/P&gt;
&lt;P&gt;ippResult = ippsConj_32fc_I((Ipp32fc*)UnpackBuffer, NumberOfComplexElements);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Could I have misunderstood something here?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2010 23:53:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Any-problems-casting-as-Ipp32f/m-p/882112#M10321</guid>
      <dc:creator>lkeene</dc:creator>
      <dc:date>2010-02-26T23:53:03Z</dc:date>
    </item>
    <item>
      <title>Any problems casting as Ipp32f*?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Any-problems-casting-as-Ipp32f/m-p/882113#M10322</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;IPP functions working with complex data type conisder elements as complex elements, so you should specify number of complex elements for ippsConj_32fs_I function as a lenght parameter (not sum of real and image parts).&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt; Vladimir&lt;/P&gt;</description>
      <pubDate>Sat, 27 Feb 2010 12:57:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Any-problems-casting-as-Ipp32f/m-p/882113#M10322</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2010-02-27T12:57:17Z</dc:date>
    </item>
  </channel>
</rss>

