File: testinfo.c

package info (click to toggle)
libspe2 2.2.80-95-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 940 kB
  • ctags: 1,214
  • sloc: ansic: 9,316; makefile: 551; ada: 448; sh: 24
file content (25 lines) | stat: -rw-r--r-- 532 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25


#include <stdio.h>

#include "libspe2.h"

int main(void)
{
	int no, nocpus , i;

	nocpus  = spe_cpu_info_get(SPE_COUNT_PHYSICAL_CPU_NODES, -2);
	printf("-2 ==> %d (%d)\n", nocpus, errno);

	nocpus  = spe_cpu_info_get(SPE_COUNT_PHYSICAL_CPU_NODES, -1);
	printf("-1 ==> %d (%d)\n", nocpus, errno);

	for (i=-2; i <= nocpus; i++) {
		no = spe_cpu_info_get(SPE_COUNT_PHYSICAL_SPES, i);
		printf("%2d ==> %d (%d)\n",i, no, errno);
		
		no = spe_cpu_info_get(SPE_COUNT_USABLE_SPES, i);
		printf("%2d ==> %d (%d)\n",i, no, errno);
	}
}