void-packages/srcpkgs/openblas/patches/v0.2.20-init.patch

58 lines
2.1 KiB
Diff

--- driver/others/init.c.orig 2017-07-30 17:32:46.798217004 +0200
+++ driver/others/init.c 2017-07-30 17:07:26.933137836 +0200
@@ -781 +781 @@ void gotoblas_affinity_init(void) {
-#ifndef USE_OPENMP
+#ifndef USE_OPENMP
@@ -785 +785 @@ void gotoblas_affinity_init(void) {
-
+
@@ -829,4 +828,0 @@ void gotoblas_affinity_init(void) {
- cpu_set_t *cpusetp;
- int nums;
- int ret;
-
@@ -838,36 +834 @@ void gotoblas_affinity_init(void) {
-
- nums = sysconf(_SC_NPROCESSORS_CONF);
-
-#if !defined(__GLIBC_PREREQ) || !__GLIBC_PREREQ(2, 3)
- common->num_procs = nums;
-#elif __GLIBC_PREREQ(2, 7)
- cpusetp = CPU_ALLOC(nums);
- if (cpusetp == NULL) {
- common->num_procs = nums;
- } else {
- size_t size;
- size = CPU_ALLOC_SIZE(nums);
- ret = sched_getaffinity(0,size,cpusetp);
- if (ret!=0)
- common->num_procs = nums;
- else
- common->num_procs = CPU_COUNT_S(size,cpusetp);
- }
- CPU_FREE(cpusetp);
-#else
- ret = sched_getaffinity(0,sizeof(cpu_set_t), cpusetp);
- if (ret!=0) {
- common->num_procs = nums;
- } else {
-#if !__GLIBC_PREREQ(2, 6)
- int i;
- int n = 0;
- for (i=0;i<nums;i++)
- if (CPU_ISSET(i,cpusetp)) n++;
- common->num_procs = n;
- }
-#else
- common->num_procs = CPU_COUNT(sizeof(cpu_set_t),cpusetp);
-#endif
-
-#endif
+ common -> num_procs = sysconf(_SC_NPROCESSORS_CONF);;
@@ -876 +837 @@ void gotoblas_affinity_init(void) {
- fprintf(stderr, "\nOpenBLAS Warning : The number of CPU/Cores(%d) is beyond the limit(%d). Terminated.\n", common->num_procs, MAX_CPUS);
+ fprintf(stderr, "\nOpenBLAS Warining : The number of CPU/Cores(%d) is beyond the limit(%d). Terminated.\n", common->num_procs, MAX_CPUS);
@@ -889 +850 @@ void gotoblas_affinity_init(void) {
- for(i = 0; i < common -> avail_count; i++) common -> final_num_procs += rcount(common -> avail[i]) + 1; //Make the max cpu number.
+ for(i = 0; i < common -> avail_count; i++) common -> final_num_procs += rcount(common -> avail[i]) + 1; //Make the max cpu number.