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
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
連結已複製
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
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
