From e3e2dd5e78e9ef1d1da20b2bde606d908410a959 Mon Sep 17 00:00:00 2001 From: Andreas Beckmann Date: Wed, 14 Dec 2022 18:28:36 +0100 Subject: [PATCH] [PATCH 28/42] add llvm_cpu to the long device name Gbp-Pq: Name 0028-add-llvm_cpu-to-the-long-device-name.patch --- lib/CL/devices/cpuinfo.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/CL/devices/cpuinfo.c b/lib/CL/devices/cpuinfo.c index 8e3cda6..a5330b6 100644 --- a/lib/CL/devices/cpuinfo.c +++ b/lib/CL/devices/cpuinfo.c @@ -400,9 +400,12 @@ pocl_cpuinfo_get_cpu_name_and_vendor(cl_device_id device) #endif /* create the descriptive long_name for device */ - int len = strlen (device->short_name) + (end-start) + 2; + int len = strlen (device->short_name) + 1 + + (device->llvm_cpu ? strlen (device->llvm_cpu) : 0) + 1 + + (end - start) + 1; char *new_name = (char*)malloc (len); - snprintf (new_name, len, "%s-%s", device->short_name, start); + snprintf (new_name, len, "%s-%s-%s", device->short_name, + (device->llvm_cpu ? device->llvm_cpu : ""), start); device->long_name = new_name; /* If the vendor_id field is still empty, we should get the PCI ID associated -- 2.30.2