Lines 1-5
Link Here
|
1 |
--- lib/CL/devices/cpuinfo.c.orig 2017-04-05 14:15:40 UTC |
1 |
--- lib/CL/devices/cpuinfo.c.orig 2017-12-18 19:45:26.000000000 +0100 |
2 |
+++ lib/CL/devices/cpuinfo.c |
2 |
+++ lib/CL/devices/cpuinfo.c 2017-12-23 03:18:38.821984000 +0100 |
3 |
@@ -34,6 +34,12 @@ |
3 |
@@ -34,6 +34,12 @@ |
4 |
#include "config.h" |
4 |
#include "config.h" |
5 |
#include "cpuinfo.h" |
5 |
#include "cpuinfo.h" |
Lines 13-19
Link Here
|
13 |
static const char* cpuinfo = "/proc/cpuinfo"; |
13 |
static const char* cpuinfo = "/proc/cpuinfo"; |
14 |
#define MAX_CPUINFO_SIZE 64*1024 |
14 |
#define MAX_CPUINFO_SIZE 64*1024 |
15 |
//#define DEBUG_POCL_CPUINFO |
15 |
//#define DEBUG_POCL_CPUINFO |
16 |
@@ -153,8 +159,51 @@ pocl_cpuinfo_detect_max_clock_frequency( |
16 |
@@ -153,8 +159,51 @@ |
17 |
} |
17 |
} |
18 |
return -1; |
18 |
return -1; |
19 |
} |
19 |
} |
Lines 65-71
Link Here
|
65 |
/** |
65 |
/** |
66 |
* Detects the number of parallel hardware threads supported by |
66 |
* Detects the number of parallel hardware threads supported by |
67 |
* the CPU by parsing the cpuinfo. |
67 |
* the CPU by parsing the cpuinfo. |
68 |
@@ -232,6 +281,19 @@ pocl_cpuinfo_detect_compute_unit_count() |
68 |
@@ -232,6 +281,19 @@ |
69 |
} |
69 |
} |
70 |
return -1; |
70 |
return -1; |
71 |
} |
71 |
} |
Lines 85-91
Link Here
|
85 |
|
85 |
|
86 |
#ifdef POCL_ANDROID |
86 |
#ifdef POCL_ANDROID |
87 |
|
87 |
|
88 |
@@ -270,6 +332,7 @@ pocl_cpuinfo_get_cpu_name_and_vendor(cl_ |
88 |
@@ -326,6 +388,7 @@ |
89 |
* short_name is in the .data anyways.*/ |
89 |
* short_name is in the .data anyways.*/ |
90 |
device->long_name = device->short_name; |
90 |
device->long_name = device->short_name; |
91 |
|
91 |
|
Lines 93-99
Link Here
|
93 |
/* default vendor and vendor_id, in case it cannot be found by other means */ |
93 |
/* default vendor and vendor_id, in case it cannot be found by other means */ |
94 |
device->vendor = cpuvendor_default; |
94 |
device->vendor = cpuvendor_default; |
95 |
if (device->vendor_id == 0) |
95 |
if (device->vendor_id == 0) |
96 |
@@ -318,7 +381,25 @@ pocl_cpuinfo_get_cpu_name_and_vendor(cl_ |
96 |
@@ -425,6 +488,25 @@ |
97 |
char *new_name = (char*)malloc (len); |
97 |
char *new_name = (char*)malloc (len); |
98 |
snprintf (new_name, len, "%s-%s", device->short_name, start); |
98 |
snprintf (new_name, len, "%s-%s", device->short_name, start); |
99 |
device->long_name = new_name; |
99 |
device->long_name = new_name; |
Lines 101-107
Link Here
|
101 |
+ int mib[2]; |
101 |
+ int mib[2]; |
102 |
+ size_t len = 0; |
102 |
+ size_t len = 0; |
103 |
+ char *model; |
103 |
+ char *model; |
104 |
|
104 |
+ |
105 |
+ mib[0] = CTL_HW; |
105 |
+ mib[0] = CTL_HW; |
106 |
+ mib[1] = HW_MODEL; |
106 |
+ mib[1] = HW_MODEL; |
107 |
+ if (sysctl(mib, 2, NULL, &len, NULL, 0)) |
107 |
+ if (sysctl(mib, 2, NULL, &len, NULL, 0)) |