How correctly to use Parallel Inspector?

How correctly to use Parallel Inspector?

Good afternoon.

Can You prompting why Parallel
Inspector shows memory leak in a following example?

#include "stdafx.h"
#include 
#include 
#include 

class SimpleSum 
{
	float* my_a;

public:

	float sum;
	
	void operator( )( const tbb::blocked_range& r )
	{
		float *a = my_a;

		for( size_t i=r.begin(); i!=r.end( ); ++i )
			sum += a[i];
	}

	SimpleSum( SimpleSum& x, tbb::split ) : my_a(x.my_a), sum(0) {}

	void join( const SimpleSum& y )
	{
		sum += y.sum;
	}
	
	SimpleSum(float a[] ) :
	my_a	(a), 
	sum		(0)
	{
	}
};

int _tmain(int argc, _TCHAR* argv[])
{
	UINT	Size = 1000;
	float*	Mass = (float*) _aligned_malloc(Size * sizeof(float), 16 );

	for (UINT i = 0; i < Size; i++)
	{
		Mass[i] = (float) i;
	}

	SimpleSum sf( Mass );

	parallel_reduce( tbb::blocked_range(0, Size), sf );

	printf("Result: %fn", sf.sum);

	_aligned_free( Mass );

	return 0;
}

Errors (level mi4):

ID  Problem Sources Modules Object Size State
P1  Memory leak parallel_reduce.h TBB_reduce.exe 140 Not fixed
P2  Memory leak parallel_reduce.h TBB_reduce.exe 40 Not fixed
P3  Memory leak parallel_reduce.h TBB_reduce.exe 40 Not fixed
P4  Memory leak parallel_reduce.h TBB_reduce.exe 40 Not fixed
P5  Memory leak parallel_reduce.h TBB_reduce.exe 140 Not fixed
P6  Memory leak parallel_reduce.h TBB_reduce.exe 60 Not fixed
P7  Memory leak parallel_reduce.h TBB_reduce.exe 40 Not fixed
P8  Memory leak parallel_reduce.h TBB_reduce.exe 40 Not fixed
P9  Memory leak parallel_reduce.h TBB_reduce.exe 112 Not fixed
P10  Memory leak parallel_reduce.h TBB_reduce.exe 56 Not fixed
P11  Memory leak parallel_reduce.h TBB_reduce.exe 56 Not fixed
P12  Memory leak parallel_reduce.h TBB_reduce.exe 56 Not fixed
P13  Memory leak parallel_reduce.h TBB_reduce.exe 56 Not fixed
P14  Memory leak parallel_reduce.h TBB_reduce.exe 84 Not fixed
P15  Memory leak parallel_reduce.h TBB_reduce.exe 56 Not fixed
P16  Memory leak parallel_reduce.h TBB_reduce.exe 56 Not fixed
P17  Memory leak task.cpp tbb_debug.dll 28 Not fixed

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Please, specify which version/build # of Parallel Inspector you were using.

Intel Parallel Inspector Update 2, (build 75522)

Inspector. parallel_reduce Inspector TBB- . parallel_for pipeline . . Inspector, parallel_reduce .

:
Notebook MSI GT740
Core i7 Q720
Windows 7 x64
Visual Studio 2008 v.9.0.30729 + Sp1

Inspector-, i7, .

.

Inspector'. ., .

Leave a Comment

Please sign in to add a comment. Not a member? Join today