Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

ippGetCpuFreqMhz segmentation fault

Grant_S_2
Beginner
562 Views

I get a segmentation fault when I call ippGetCpuFreqMhz(). 

Ubuntu 12.04 LTS

Intel® Core™ i7-4610M CPU @ 3.00GHz × 4

static libraries

Netbeans IDE 7.4

gcc -o dist/Debug/GNU-Linux-x86/timingtestipp build/Debug/GNU-Linux-x86/src/CicDownSamp.o build/Debug/GNU-Linux-x86/src/TimingTestIpp.o -L../lib -L/opt/intel/ipp/lib/intel64 -lsidekiq__x86_64 /opt/intel/ipp/lib/intel64/libippcc.a /opt/intel/ipp/lib/intel64/libippch.a /opt/intel/ipp/lib/intel64/libippcore.a /opt/intel/ipp/lib/intel64/libippcv.a /opt/intel/ipp/lib/intel64/libippdc.a /opt/intel/ipp/lib/intel64/libippi.a /opt/intel/ipp/lib/intel64/libipps.a /opt/intel/ipp/lib/intel64/libippvm.a -lpthread -lm -lrt -ldl

Let me know if you need more.

Thanks,

Grant Schmick

 

0 Kudos
1 Solution
Igor_A_Intel
Employee
562 Views

Hi Grant,

pMhz is not initialized in your case, correct code is below:

 int *pMhz;
 int iCpuMhz;

 pMhz = &iCpuMhz;
 ippStatus = ippGetCpuFreqMhz(pMhz);

or simpler one:


 int iCpuMhz;

 ippStatus = ippGetCpuFreqMhz(&iCpuMhz);

regards, Igor

View solution in original post

0 Kudos
4 Replies
Grant_S_2
Beginner
562 Views

Also:  IPP_VERSION_STR "8.2.2"

Language: C

0 Kudos
Jonghak_K_Intel
Employee
562 Views

Hi Grant,

 

Can I see how you declare a variable for and call ippGetCpuFreqMhz() in your code?

Thank you

- Jon

0 Kudos
Grant_S_2
Beginner
562 Views

Jon,

Here's the relevant code:

...
#define READ_CPU_FREQ

#ifdef READ_CPU_FREQ
int *pMhz;
int iCpuMhz;
#endif
...
#ifdef READ_CPU_FREQ
    // read the processor speed
    ippStatus = ippGetCpuFreqMhz(pMhz);
    iCpuMhz = *pMhz;
#endif
...

The fault occurs on the function call; if I comment it out, it doesn't occur.

Thanks,

Grant

0 Kudos
Igor_A_Intel
Employee
563 Views

Hi Grant,

pMhz is not initialized in your case, correct code is below:

 int *pMhz;
 int iCpuMhz;

 pMhz = &iCpuMhz;
 ippStatus = ippGetCpuFreqMhz(pMhz);

or simpler one:


 int iCpuMhz;

 ippStatus = ippGetCpuFreqMhz(&iCpuMhz);

regards, Igor

0 Kudos
Reply