<?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 Thank you for the code in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippiResize-Threading-Problems/m-p/1081746#M24771</link>
    <description>&lt;P&gt;Thank you for the code example, Shawn. We will investigate the problem.&lt;/P&gt;

&lt;P&gt;Best regards,&lt;BR /&gt;
	valentin&lt;/P&gt;</description>
    <pubDate>Thu, 13 Apr 2017 15:06:21 GMT</pubDate>
    <dc:creator>Valentin_K_Intel</dc:creator>
    <dc:date>2017-04-13T15:06:21Z</dc:date>
    <item>
      <title>ippiResize Threading Problems</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippiResize-Threading-Problems/m-p/1081742#M24767</link>
      <description>&lt;P&gt;I have been migrating a very large application from using the very old IPP 6.x to the latest IPP 2017 (R2). &amp;nbsp;This is a direct migration, I have not used IPP 7, IPP 8, or IPP 9. &amp;nbsp;I would say I have about 98% functionality with the new API, but I ran into some problems with image resizing.&lt;/P&gt;

&lt;P&gt;In IPP 6.x, we were using the ippiResizeSqrPixel function call. &amp;nbsp;In this case we are scaling the image down, so we were using IPPI_INTER_SUPER.&lt;/P&gt;

&lt;P&gt;status = ippiResizeSqrPixel_8u_C3R(pImageData, srcSize, iStride * sizeof(Ipp8u), srcRect, pDst, (dstWidth * channels * sizeof(Ipp8u)), dstRect, scale, scale, 0, 0, IPPI_INTER_SUPER, pExtBuffer);&lt;/P&gt;

&lt;P&gt;I figured out how to do this with IPP 2017 using the standard functions and all was working.&lt;/P&gt;

&lt;P&gt;ippiResizeGetSize_8u, ippiResizeSuperInit_8u, ippiResizeGetBufferSize_8u, to set things up and then call ippiResizeSuper_8u_C3R.&lt;/P&gt;

&lt;P&gt;However I noticed this methodology was much slower than the older call to ippiResizeSqrPixel. &amp;nbsp;Roughly 5 - 10 times slower depending. &amp;nbsp;I read somewhere on these forums that ippiResizeSqrPixel used internal threading, hence its speed. &amp;nbsp;With the latest API, I ran across the _LT methods, ippiResizeGetSize_LT, ippiResizeSuperInit_LT, ippiResizeGetBufferSize_LT, and finally ippiResizeSuper_8u_C3R_LT.&lt;/P&gt;

&lt;P&gt;Upon implementing this resize path, the times were now much more comparable to ippiResizeSqrPixel...however the images are now garbled in the 'y' direction, sometimes replicating previous sections in the image. &amp;nbsp;If I call ippSetNumThreads_LT(1) before using the _LT methods, then the image is now correct again, however there is no speed up and its times are comparable (if not slighly slower) to just using ippiResize without _LT.&lt;/P&gt;

&lt;P&gt;Since setting ippSetNumThreads_LT(1) causes the code to work properly, this seems like a bug, or more likely I haven't quite figured out how to use the new functionality correctly. &amp;nbsp;Is this a known issue?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2017 23:38:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippiResize-Threading-Problems/m-p/1081742#M24767</guid>
      <dc:creator>Shawn_Gibson</dc:creator>
      <dc:date>2017-04-12T23:38:22Z</dc:date>
    </item>
    <item>
      <title>"In Intel® Integrated</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippiResize-Threading-Problems/m-p/1081743#M24768</link>
      <description>&lt;P&gt;"In Intel® Integrated Performance Primitives (Intel® IPP) 8.2 and later versions, multi-threading (internal threading) libraries are deprecated due to issues with performance and interoperability with other threading models, but made available for legacy applications....&lt;/P&gt;

&lt;P&gt;For new application development, it is highly recommended to use the single-threaded versions with application-level threading"&lt;/P&gt;

&lt;P&gt;&lt;A href="https://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-threading-openmp-faq" target="_blank"&gt;https://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-threading-openmp-faq&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2017 03:53:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippiResize-Threading-Problems/m-p/1081743#M24768</guid>
      <dc:creator>Aleksey_Y_</dc:creator>
      <dc:date>2017-04-13T03:53:44Z</dc:date>
    </item>
    <item>
      <title>Hi Shawn,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippiResize-Threading-Problems/m-p/1081744#M24769</link>
      <description>&lt;P&gt;Hi Shawn,&lt;/P&gt;

&lt;P&gt;Could you please provide a code example, where &lt;SPAN style="font-size: 12px;"&gt;ippiResizeSuper_8u_C3R_LT&lt;/SPAN&gt;&amp;nbsp;works incorrectly?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
	Valentin&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2017 08:58:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippiResize-Threading-Problems/m-p/1081744#M24769</guid>
      <dc:creator>Valentin_K_Intel</dc:creator>
      <dc:date>2017-04-13T08:58:33Z</dc:date>
    </item>
    <item>
      <title>This is the main entry call.</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippiResize-Threading-Problems/m-p/1081745#M24770</link>
      <description>&lt;PRE class="brush:cpp;"&gt;This is the main entry call.  Usually before getting to this stage, setNumThreads has already been called (tested on a laptop with 8 logical cores, and workstation with 48).  The incoming image will get scaled 2 different times.
Original image size: 7296 x 13200, stride = 21888 (BGR image).
1st scale down will be 0.5 in x &amp;amp; y, so the new size will be 3648 x 6600, strid = 10944.
A 2nd 'thumbnail' image will also be created with a 2nd call to this method and will be scaled down massively (53 x 96, stride = 159).

template&amp;lt;&amp;gt;
	inline IppStatus IppiFunction&amp;lt;Ipp8u, Any&amp;gt;::ResizeImage_LT(double scale, int32_t channels, const Ipp8u* pSrc, IppiSize srcSize, int32_t srcStep, IppiRect srcRect,
		Ipp8u* pDst, IppiRect dstRect)
	{
		IppStatus status;

		IppiInterpolationType interpolation;

		if (scale &amp;lt; 1)
		{
			interpolation = IppiInterpolationType::ippSuper; //IPPI_INTER_SUPER only works with downsizing an image
		}
		else
		{
			interpolation = IppiInterpolationType::ippLinear;
		}

		IppiSizeL srcSizeL;
		srcSizeL.width = srcSize.width;
		srcSizeL.height = srcSize.height;

		IppiSizeL dstSizeL;
		dstSizeL.width = dstRect.width;
		dstSizeL.height = dstRect.height;

		IppSizeL init_buffer_size = 0; // may not be required
		IppSizeL spec_size;

		status = ippiResizeGetSize_LT(srcSizeL, dstSizeL, IppDataType::ipp8u, interpolation, 0, &amp;amp;spec_size, &amp;amp;init_buffer_size);

		if (ippStsNoErr == status)
		{
			IppiResizeSpec_LT* pSpec = (IppiResizeSpec_LT*)IppsFunction&amp;lt;IppSizeL&amp;gt;::Malloc(spec_size);

			if (scale &amp;lt; 1)
			{
				status = ippiResizeSuperInit_LT(srcSizeL, dstSizeL, IppDataType::ipp8u, channels, pSpec);
			}
			else
			{
				status = ippiResizeLinearInit_LT(srcSizeL, dstSizeL, IppDataType::ipp8u, channels, pSpec);
			}

			IppSizeL working_buffer_size = 0;
			status = ippiResizeGetBufferSize_LT(pSpec, &amp;amp;working_buffer_size);

			Ipp8u * pExtBuffer = IppsFunction&amp;lt;Ipp8u&amp;gt;::Malloc(working_buffer_size); // a working buffer is required for resizing

			IppSizeL srcStepL = srcStep * sizeof(Ipp8u);
			IppSizeL dstStepL = dstRect.width * channels * sizeof(Ipp8u);

			status = IppiFunction&amp;lt;Ipp8u, Any&amp;gt;::Resize_LT(channels, interpolation, pSrc, srcStepL, pDst, dstStepL, pSpec, pExtBuffer);

			IppsFixedFunction::Free(pExtBuffer);
			IppsFixedFunction::Free(pSpec);
		}

		return status;
	}&lt;/PRE&gt;

&lt;P&gt;The method IppiFunction&amp;lt;Ipp8u, Any&amp;gt;::Resize_LT will essentially call the ResizeSuper function. &amp;nbsp;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;template&amp;lt;&amp;gt;
	inline IppStatus IppiFunction&amp;lt;Ipp8u, Any&amp;gt;::ResizeSuper_LT(int32_t channels, const Ipp8u* pSrc, IppSizeL srcStep, Ipp8u* pDst, IppSizeL dstStep,
		const IppiResizeSpec_LT* pSpec, Ipp8u* pBuffer)
	{
		IppStatus status;

		switch (channels)
		{
		case 1:
			status = ippiResizeSuper_8u_C1R_LT(pSrc, srcStep, pDst, dstStep, pSpec, pBuffer);
			break;
		case 3:
			status = ippiResizeSuper_8u_C3R_LT(pSrc, srcStep, pDst, dstStep, pSpec, pBuffer);
			break;
		case 4:
			status = ippiResizeSuper_8u_C4R_LT(pSrc, srcStep, pDst, dstStep, pSpec, pBuffer);
			break;
		}

		return status;
	}&lt;/PRE&gt;

&lt;P&gt;If setNumThreads is 8 on the laptop, or 12 on the desktop, a scaled image is created, however the image is usually not correct with multiple chunks of the image being replicated in the y direction, or with chunks of the image being misplaced (pieces that should be at the top end up and the bottom, or vice versa).&lt;/P&gt;

&lt;P&gt;Timing information&lt;/P&gt;

&lt;P&gt;ippiResizeSqrPixel (Ipp v6)&lt;/P&gt;

&lt;P&gt;Original size by a scale of 0.5: Average is around 37 ms. &amp;nbsp;Original size to thumbnail by a scale of about 0.00727: Average is around 230.7 ms.&lt;/P&gt;

&lt;P&gt;ippiResize (Ipp 2017)&lt;/P&gt;

&lt;P&gt;Original size by a scale of 0.5: Average is around 182.5 ms. &amp;nbsp;Original size to thumbnail: Average is around 58.1 ms. &amp;nbsp;Found this interesting that the thumbnail scaling is much faster. &amp;nbsp;The image however is correct.&lt;/P&gt;

&lt;P&gt;ippiResize_LT (Ipp 2017) - setNumThreads = 12&lt;/P&gt;

&lt;P&gt;Original size by a scale of 0.5: Average is around 33 ms. &amp;nbsp;Original size to thumbnail: Average is around 59.4 ms. &amp;nbsp;The image is incorrect and garbled.&lt;/P&gt;

&lt;P&gt;ippiResize_LT (Ipp 2017) - setNumThreads = 1&lt;/P&gt;

&lt;P&gt;Original size by a scale of 0.5: Average is around 187.2 ms. &amp;nbsp;Original size to thumbnail: Average is around 72.3 ms. &amp;nbsp;The image is correct.&lt;/P&gt;

&lt;P&gt;Hope this is enough information.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2017 15:00:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippiResize-Threading-Problems/m-p/1081745#M24770</guid>
      <dc:creator>Shawn_Gibson</dc:creator>
      <dc:date>2017-04-13T15:00:25Z</dc:date>
    </item>
    <item>
      <title>Thank you for the code</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippiResize-Threading-Problems/m-p/1081746#M24771</link>
      <description>&lt;P&gt;Thank you for the code example, Shawn. We will investigate the problem.&lt;/P&gt;

&lt;P&gt;Best regards,&lt;BR /&gt;
	valentin&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2017 15:06:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippiResize-Threading-Problems/m-p/1081746#M24771</guid>
      <dc:creator>Valentin_K_Intel</dc:creator>
      <dc:date>2017-04-13T15:06:21Z</dc:date>
    </item>
    <item>
      <title>Hi Shawn,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippiResize-Threading-Problems/m-p/1081747#M24772</link>
      <description>&lt;P&gt;Hi Shawn,&lt;/P&gt;

&lt;P&gt;I cannot reproduce the problem. Could you please provide some details?&lt;BR /&gt;
	1. What platform (CPU, OS, ia32 or intel64) do you use?&lt;BR /&gt;
	2. Does the problem appear for IPP 2017 Update 2?&lt;/P&gt;

&lt;P&gt;Best regards,&lt;BR /&gt;
	Valentin&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2017 10:58:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippiResize-Threading-Problems/m-p/1081747#M24772</guid>
      <dc:creator>Valentin_K_Intel</dc:creator>
      <dc:date>2017-04-26T10:58:30Z</dc:date>
    </item>
    <item>
      <title>I have repeated the problem</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippiResize-Threading-Problems/m-p/1081748#M24773</link>
      <description>&lt;P&gt;I have repeated the problem on 2 different systems:&lt;/P&gt;

&lt;P&gt;System 1:&lt;/P&gt;

&lt;OL&gt;
	&lt;LI&gt;
		&lt;P&gt;Win7, intel64, Intel Core i7-4800MQ CPU @ 2.70 GHz, 4 cores, 8 logical processors.&lt;/P&gt;
	&lt;/LI&gt;
	&lt;LI&gt;
		&lt;P&gt;IPP2017 Update 2.&lt;/P&gt;
	&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;System 2:&lt;/P&gt;

&lt;OL&gt;
	&lt;LI&gt;
		&lt;P&gt;Win7, intel64, Intel Xeon E5-2690 v3 @ 2.6 GHz, 2x12 cores, 48 logical processors&lt;/P&gt;
	&lt;/LI&gt;
	&lt;LI&gt;
		&lt;P&gt;IPP2017 Update 2.&lt;/P&gt;
	&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Wed, 26 Apr 2017 14:21:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippiResize-Threading-Problems/m-p/1081748#M24773</guid>
      <dc:creator>Shawn_Gibson</dc:creator>
      <dc:date>2017-04-26T14:21:37Z</dc:date>
    </item>
    <item>
      <title>Hi Shawn,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippiResize-Threading-Problems/m-p/1081749#M24774</link>
      <description>&lt;P&gt;Hi Shawn,&lt;/P&gt;

&lt;P&gt;Thank you very much for providing the details. I have reproduced the issue. The problem will be fixed in next IPP releases.&lt;/P&gt;

&lt;P&gt;Best regards,&lt;BR /&gt;
	Valentin&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2017 14:58:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippiResize-Threading-Problems/m-p/1081749#M24774</guid>
      <dc:creator>Valentin_K_Intel</dc:creator>
      <dc:date>2017-04-28T14:58:07Z</dc:date>
    </item>
    <item>
      <title>Hi Shawn,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippiResize-Threading-Problems/m-p/1081750#M24775</link>
      <description>&lt;P style="word-wrap: break-word; font-size: 12px;"&gt;Hi Shawn,&lt;/P&gt;

&lt;P style="word-wrap: break-word; font-size: 12px;"&gt;As workaround you can build TL libraries from the sources. The instructions can be found here:&amp;nbsp;https://software.intel.com/en-us/node/684665&lt;/P&gt;

&lt;P style="word-wrap: break-word; font-size: 12px;"&gt;Best regards,&lt;BR /&gt;
	Valentin&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 11:00:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippiResize-Threading-Problems/m-p/1081750#M24775</guid>
      <dc:creator>Valentin_K_Intel</dc:creator>
      <dc:date>2017-05-10T11:00:13Z</dc:date>
    </item>
  </channel>
</rss>

