Does Inspector XE work with TBB application?

Does Inspector XE work with TBB application?

It seems Valgrind doesn't work with TBB memory allocator.How about Inspector XE? Does it detect problem using TBB memory allocators? Not false violation report?Do I need to turn on some special settings? I am working on Linux.Any examples on using Inspector XE with TBB application?Thanks.

5 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

Hello,

Yes, Intel Inspector XE supports TBB memory allocator, it should work without special settings.

Regards,
Kirill

I just wrote a simple tbb example, which used scalable_malloc() and forgot to use scalable_free()

#include 
#include 
#include "tbb/scalable_allocator.h"

#define LEN_STR 1024

using namespace tbb;

int main()
{

    char *str = (char *)scalable_malloc(LEN_STR*sizeof(char));
    strcpy (str, "This is an example to use tbb scalable");
    printf ("%sn",str);

    // Forget to do "scalable_free"
    return(1);

}

#source /opt/intel/composer_xe_2011_sp1.7.256/bin/compilervars.sh intel64
# icpc -g tbb_scalable.cpp -ltbb_debug -ltbbmalloc -o tbb_scalable
# source /opt/intel/inspector_xe_2011/inspxe-vars.sh
Copyright (C) 2009-2011 Intel Corporation. All rights reserved.
Intel Inspector XE 2011 (build 186554)

# inspxe-cl -collect mi3 -module-filter-mode=include -module-filter=tbb_scalable -- ./tbb_scalable
Used suppression file(s): []
This is an example to use tbb scalable

1 new problem(s) found
1 Memory leak problem(s) detected

# inspxe-cl -report problems
Used suppression file(s): []
Problem P1: Error: Memory leak
/home/peter/tbb_scalable.cpp(12): Error X3: P1: Memory leak: Allocation site: Function main: Module /home/peter/tbb_scalable

You can see one memory leak detected, allocation site is at source line #12.
So Inspector XE can detect problem using TBB memory allocators.

Regards, Peter

Quoting zlwAny examples on using Inspector XE with TBB application?

If you have TBB v4.xinstalled on your system please take a look at \Examples folder. There are
24 test applications in the folderand anytest applicationcan be used with Inspector XE.

Best regards,
Sergey

Great. Thanks.

Faça login para deixar um comentário.