[PATCH 1006/1017] always use runtime determined llvm_cpu to compute build_hash
authorAndreas Beckmann <anbe@debian.org>
Wed, 16 Mar 2022 15:10:50 +0000 (16:10 +0100)
committerAndreas Beckmann <anbe@debian.org>
Wed, 3 Aug 2022 23:54:01 +0000 (00:54 +0100)
Gbp-Pq: Name 1006-always-use-runtime-determined-llvm_cpu-to-compute-bu.patch

CMakeLists.txt
lib/CL/devices/basic/basic.c
lib/CL/devices/pthread/pthread.c

index a31872cabbad67662d5fff5da7704e5038248b85..919f8ba3378c6a83e0b24d34d7e36a4c9938a2e5 100644 (file)
@@ -479,11 +479,7 @@ if(ENABLE_LLVM)
 
   if(ENABLE_HOST_CPU_DEVICES)
   if(NOT DEFINED HOST_DEVICE_BUILD_HASH)
-    if(KERNELLIB_HOST_CPU_VARIANTS STREQUAL "distro")
       set(HOST_DEVICE_BUILD_HASH "${LLC_TRIPLE}")
-    else()
-      set(HOST_DEVICE_BUILD_HASH "${LLC_TRIPLE}-${LLC_HOST_CPU}")
-    endif()
   endif()
 
   if(INTEL_SDE_AVX512)
index 689af0909f045efc186d7075e708562d97df878e..8caf07483c87d5fc2ed2897be45476a1b81ae22a 100644 (file)
@@ -143,13 +143,8 @@ char *
 pocl_basic_build_hash (cl_device_id device)
 {
   char* res = calloc(1000, sizeof(char));
-#ifdef KERNELLIB_HOST_DISTRO_VARIANTS
-  char *name = pocl_get_llvm_cpu_name ();
-  snprintf (res, 1000, "basic-%s-%s", HOST_DEVICE_BUILD_HASH, name);
-  POCL_MEM_FREE (name);
-#else
-  snprintf (res, 1000, "basic-%s", HOST_DEVICE_BUILD_HASH);
-#endif
+  snprintf (res, 1000, "basic-%s-%s", HOST_DEVICE_BUILD_HASH,
+            device->llvm_cpu);
   return res;
 }
 
index 9d250c06399b2e58599d42a855d19025c9a843a6..150c879acb110ef99678df2582258b389ce6c074 100644 (file)
@@ -101,13 +101,8 @@ char *
 pocl_pthread_build_hash (cl_device_id device)
 {
   char* res = calloc(1000, sizeof(char));
-#ifdef KERNELLIB_HOST_DISTRO_VARIANTS
-  char *name = pocl_get_llvm_cpu_name ();
-  snprintf (res, 1000, "pthread-%s-%s", HOST_DEVICE_BUILD_HASH, name);
-  POCL_MEM_FREE (name);
-#else
-  snprintf (res, 1000, "pthread-%s", HOST_DEVICE_BUILD_HASH);
-#endif
+  snprintf (res, 1000, "pthread-%s-%s", HOST_DEVICE_BUILD_HASH,
+            device->llvm_cpu);
   return res;
 }