Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Grant_S_2
Beginner
84 Views

ippGetCpuFreqMhz segmentation fault

Jump to solution

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
84 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

4 Replies
Grant_S_2
Beginner
84 Views

Also:  IPP_VERSION_STR "8.2.2"

Language: C

Jonghak_K_Intel
Employee
84 Views

Hi Grant,

 

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

Thank you

- Jon

Grant_S_2
Beginner
84 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

Igor_A_Intel
Employee
85 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

Reply