<?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 Calling ipp functions corrupts variables in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/Calling-ipp-functions-corrupts-variables/m-p/1125736#M25654</link>
    <description>&lt;P&gt;I have picked up coding with IPP again after some time and an update from windows 7 to windows 10. But now it seems to corrupt the value of variables when I can an ipp malloc function.&lt;/P&gt;&lt;P&gt;For instance this code:&lt;/P&gt;
&lt;PRE class="brush:cpp;"&gt;#include &amp;lt;stdio.h&amp;gt;
#include "ipp.h"


int main(void)
{
    IppiSize roiSize = {128,128};
    IppiSize  kernelSize= {3,3};
	int srcStep = 0;
	Ipp8u* pSrc = NULL;
	
	printf("%d %d \n", roiSize.width, roiSize.height);
	printf("%d %d \n", kernelSize.width, kernelSize.height);
	
    pSrc = ippsMalloc_8u(0);
	
	printf("%d %d \n", roiSize.width, roiSize.height);	
	printf("%d %d \n", kernelSize.width, kernelSize.height);	
    return 0;
}&lt;/PRE&gt;

&lt;P&gt;returns:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;128 128
3 3
128 0
3 128&lt;/PRE&gt;

&lt;P&gt;so it modifies the value of roiSize and kernelSize even though it's not intended to. A standard C malloc works fine and dose not corrupt the variables. I compiled (without any warning) with cygwin x86 g++ 7.4.0, on windows 10 pro version 1709, using&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;HDIR = "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.1.144\windows\ipp\include"
LDADD = "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.1.144\windows\redist\ia32_win\ipp" -lippi -lipps -lippvm  -lippcore -lippvm  -lm
CXXFLAGS = -O0 
SOURCES= test.cpp 
OBJECTS1=$(patsubst %.cpp,%.o,$(SOURCES))
OBJECTS=$(patsubst %.c,%.o,$(OBJECTS1))

all debug profile static depend: $(OBJECTS)
	g++ -o test.exe test.o $(CXXFLAGS) -L$(LDADD) 

	
%.o: %.cpp
	g++ -c $&amp;lt; $(CXXFLAGS) -I $(HDIR)  

%.o: %.c
	g++ -c $&amp;lt; $(CXXFLAGS) -I $(HDIR) 
	
clean:
	rm -f *.o&lt;/PRE&gt;

&lt;P&gt;Anybody has already seen anything like this? I'm at a loss to find the root cause of the issue.&lt;/P&gt;</description>
    <pubDate>Thu, 03 Jan 2019 16:13:13 GMT</pubDate>
    <dc:creator>marti__clement</dc:creator>
    <dc:date>2019-01-03T16:13:13Z</dc:date>
    <item>
      <title>Calling ipp functions corrupts variables</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Calling-ipp-functions-corrupts-variables/m-p/1125736#M25654</link>
      <description>&lt;P&gt;I have picked up coding with IPP again after some time and an update from windows 7 to windows 10. But now it seems to corrupt the value of variables when I can an ipp malloc function.&lt;/P&gt;&lt;P&gt;For instance this code:&lt;/P&gt;
&lt;PRE class="brush:cpp;"&gt;#include &amp;lt;stdio.h&amp;gt;
#include "ipp.h"


int main(void)
{
    IppiSize roiSize = {128,128};
    IppiSize  kernelSize= {3,3};
	int srcStep = 0;
	Ipp8u* pSrc = NULL;
	
	printf("%d %d \n", roiSize.width, roiSize.height);
	printf("%d %d \n", kernelSize.width, kernelSize.height);
	
    pSrc = ippsMalloc_8u(0);
	
	printf("%d %d \n", roiSize.width, roiSize.height);	
	printf("%d %d \n", kernelSize.width, kernelSize.height);	
    return 0;
}&lt;/PRE&gt;

&lt;P&gt;returns:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;128 128
3 3
128 0
3 128&lt;/PRE&gt;

&lt;P&gt;so it modifies the value of roiSize and kernelSize even though it's not intended to. A standard C malloc works fine and dose not corrupt the variables. I compiled (without any warning) with cygwin x86 g++ 7.4.0, on windows 10 pro version 1709, using&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;HDIR = "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.1.144\windows\ipp\include"
LDADD = "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019.1.144\windows\redist\ia32_win\ipp" -lippi -lipps -lippvm  -lippcore -lippvm  -lm
CXXFLAGS = -O0 
SOURCES= test.cpp 
OBJECTS1=$(patsubst %.cpp,%.o,$(SOURCES))
OBJECTS=$(patsubst %.c,%.o,$(OBJECTS1))

all debug profile static depend: $(OBJECTS)
	g++ -o test.exe test.o $(CXXFLAGS) -L$(LDADD) 

	
%.o: %.cpp
	g++ -c $&amp;lt; $(CXXFLAGS) -I $(HDIR)  

%.o: %.c
	g++ -c $&amp;lt; $(CXXFLAGS) -I $(HDIR) 
	
clean:
	rm -f *.o&lt;/PRE&gt;

&lt;P&gt;Anybody has already seen anything like this? I'm at a loss to find the root cause of the issue.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 16:13:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Calling-ipp-functions-corrupts-variables/m-p/1125736#M25654</guid>
      <dc:creator>marti__clement</dc:creator>
      <dc:date>2019-01-03T16:13:13Z</dc:date>
    </item>
  </channel>
</rss>

