我从网站上下载了4.4版本,将其构建在我自己的目录中,并尝试编写一个小的main,它不断告诉我num_counters为零。然后,我查看了ctest并选择了hwinfo.c,从其中提取了一些代码(和testlib),并将其放入一个小的main中,如下所示:
#include <stdio.h>
#include <papi.h>
int main(int argc, char** argv)
{
int retval, i, j;
const PAPI_hw_info_t *hwinfo = NULL;
const PAPI_mh_info_t *mh;
retval = PAPI_library_init( PAPI_VER_CURRENT );
if ( retval != PAPI_VER_CURRENT )
cerr << "Failed at line " << __LINE__ << endl;
retval =
papi_print_header
( "Test case hwinfo.c: Check output of PAPI_get_hardware_info.\n",
&hwinfo );
if ( retval != PAPI_OK )
cerr << "Failed at line " << __LINE__ << endl;
}我使用以下代码构建此代码:
g++ main.cpp -I/home/pchan/rabbit/papi/include /home/pchan/rabbit/papi/lib/libpapi.a并使用以下命令运行:
./a.out我只想看看下面的输出:
C:检查PAPI_get_hardware_info的输出。
--------------------------------------------------------------------------------
PAPI Version : 4.4.0.0
Vendor string and code : (0)
Model string and code : (0)
CPU Revision : 0.000000
CPU Megahertz : 0.000000
CPU Clock Megahertz : 0
CPUs per Node : 0
Total CPUs : 0
Number Hardware Counters : 0
Max Multiplex Counters : 0
--------------------------------------------------------------------------------我对发生了什么有点迷惑,为什么这不是working...what的症状,我可以尝试修复它吗?我的处理器是英特尔至强X5760,我的无名-a说:
Linux chanbox 2.6.18-308.4.1.el5 #1 SMP Wed Mar 28 01:54:56 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux发布于 2012-09-12 17:28:35
尝试使用"papi_avail -a“以了解您的电脑支持哪些功能。
https://stackoverflow.com/questions/11695435
复制相似问题