Lines 1-5
Link Here
|
1 |
--- lib/CL/devices/cpuinfo.c.orig 2021-10-12 16:33:15.000000000 +0200 |
1 |
--- lib/CL/devices/cpuinfo.c.orig 2022-06-10 10:09:05 UTC |
2 |
+++ lib/CL/devices/cpuinfo.c 2021-10-16 09:29:13.414668000 +0200 |
2 |
+++ lib/CL/devices/cpuinfo.c |
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 |
@@ -41,9 +47,6 @@ |
16 |
@@ -41,9 +47,6 @@ static const char* cpufreq_file="/sys/devices/system/c |
17 |
//Linux' cpufrec interface |
17 |
//Linux' cpufrec interface |
18 |
static const char* cpufreq_file="/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq"; |
18 |
static const char* cpufreq_file="/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq"; |
19 |
|
19 |
|
Lines 23-29
Link Here
|
23 |
/* Strings to parse in /proc/cpuinfo. Else branch is for x86, x86_64 */ |
23 |
/* Strings to parse in /proc/cpuinfo. Else branch is for x86, x86_64 */ |
24 |
#if defined __powerpc__ |
24 |
#if defined __powerpc__ |
25 |
#define FREQSTRING "clock" |
25 |
#define FREQSTRING "clock" |
26 |
@@ -156,8 +159,51 @@ |
26 |
@@ -156,8 +159,51 @@ pocl_cpuinfo_detect_max_clock_frequency() |
27 |
} |
27 |
} |
28 |
return -1; |
28 |
return -1; |
29 |
} |
29 |
} |
Lines 75-81
Link Here
|
75 |
/** |
75 |
/** |
76 |
* Detects the number of parallel hardware threads supported by |
76 |
* Detects the number of parallel hardware threads supported by |
77 |
* the CPU by parsing the cpuinfo. |
77 |
* the CPU by parsing the cpuinfo. |
78 |
@@ -235,6 +281,19 @@ |
78 |
@@ -235,6 +281,19 @@ pocl_cpuinfo_detect_compute_unit_count() |
79 |
} |
79 |
} |
80 |
return -1; |
80 |
return -1; |
81 |
} |
81 |
} |
Lines 95-101
Link Here
|
95 |
|
95 |
|
96 |
#if __arm__ || __aarch64__ |
96 |
#if __arm__ || __aarch64__ |
97 |
enum |
97 |
enum |
98 |
@@ -302,6 +361,7 @@ |
98 |
@@ -302,6 +361,7 @@ pocl_cpuinfo_get_cpu_name_and_vendor(cl_device_id devi |
99 |
* short_name is in the .data anyways.*/ |
99 |
* short_name is in the .data anyways.*/ |
100 |
device->long_name = device->short_name; |
100 |
device->long_name = device->short_name; |
101 |
|
101 |
|
Lines 103-109
Link Here
|
103 |
/* default vendor and vendor_id, in case it cannot be found by other means */ |
103 |
/* default vendor and vendor_id, in case it cannot be found by other means */ |
104 |
device->vendor = cpuvendor_default; |
104 |
device->vendor = cpuvendor_default; |
105 |
if (device->vendor_id == 0) |
105 |
if (device->vendor_id == 0) |
106 |
@@ -404,7 +464,26 @@ |
106 |
@@ -404,7 +464,26 @@ pocl_cpuinfo_get_cpu_name_and_vendor(cl_device_id devi |
107 |
char *new_name = (char*)malloc (len); |
107 |
char *new_name = (char*)malloc (len); |
108 |
snprintf (new_name, len, "%s-%s", device->short_name, start); |
108 |
snprintf (new_name, len, "%s-%s", device->short_name, start); |
109 |
device->long_name = new_name; |
109 |
device->long_name = new_name; |
Lines 130-136
Link Here
|
130 |
/* If the vendor_id field is still empty, we should get the PCI ID associated |
130 |
/* If the vendor_id field is still empty, we should get the PCI ID associated |
131 |
* with the CPU vendor (if there is one), to be ready for the (currently |
131 |
* with the CPU vendor (if there is one), to be ready for the (currently |
132 |
* provisional) OpenCL 3.0 specification that has finally clarified the |
132 |
* provisional) OpenCL 3.0 specification that has finally clarified the |
133 |
@@ -415,13 +494,23 @@ |
133 |
@@ -415,13 +494,23 @@ pocl_cpuinfo_get_cpu_name_and_vendor(cl_device_id devi |
134 |
*/ |
134 |
*/ |
135 |
if (!device->vendor_id) |
135 |
if (!device->vendor_id) |
136 |
{ |
136 |
{ |