ADTast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change
on this file since 26d944c was
d363634,
checked in by Thierry Delisle <tdelisle@…>, 3 years ago
|
Added bare-bones test for device cpu
|
-
Property mode set to
100644
|
File size:
745 bytes
|
Line | |
---|
1 | // |
---|
2 | // Cforall Version 1.0.0 Copyright (C) 2021 University of Waterloo |
---|
3 | // |
---|
4 | // The contents of this file are covered under the licence agreement in the |
---|
5 | // file "LICENCE" distributed with Cforall. |
---|
6 | // |
---|
7 | // cpu.cfa -- checks that libcfa correctly counts the number of cpus. |
---|
8 | // |
---|
9 | // Author : Thierry Delisle |
---|
10 | // Created On : Mon Jun 14 13:59:01 2021 |
---|
11 | // Last Modified By : |
---|
12 | // Last Modified On : |
---|
13 | // Update Count : |
---|
14 | // |
---|
15 | |
---|
16 | |
---|
17 | #include <fstream.hfa> |
---|
18 | #include <device/cpu.hfa> |
---|
19 | extern "C" { |
---|
20 | #include <sys/sysinfo.h> |
---|
21 | } |
---|
22 | |
---|
23 | int main() { |
---|
24 | int ret1 = get_nprocs(); |
---|
25 | int ret2 = cpu_info.hthrd_count; |
---|
26 | if(ret1 != ret2) { |
---|
27 | sout | "No match! libcfa says" | ret2 | "hardware threads but linux counts" | ret1 | "processors"; |
---|
28 | } |
---|
29 | else { |
---|
30 | sout | "Match!"; |
---|
31 | } |
---|
32 | |
---|
33 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.