Browse Source

do not systematically include sched.h

Samuel Thibault 15 years ago
parent
commit
52331b4652

+ 7 - 0
src/core/perfmodel/perfmodel_bus.c

@@ -14,6 +14,12 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#ifdef USE_CUDA
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+#include <sched.h>
+#endif
 #include <unistd.h>
 #include <sys/time.h>
 #include <stdlib.h>
@@ -217,6 +223,7 @@ static void benchmark_all_cuda_devices(void)
 		measure_bandwith_between_host_and_dev(i, ncpus);
 	}
 
+	/* FIXME: use hwloc */
 	/* Restore the former affinity */
 	ret = sched_setaffinity(0, sizeof(former_process_affinity), &former_process_affinity);
 	if (ret)

+ 0 - 6
src/drivers/cpu/driver_cpu.h

@@ -17,12 +17,6 @@
 #ifndef __DRIVER_CPU_H__
 #define __DRIVER_CPU_H__
 
-/* to bind threads onto a given cpu */
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-#include <sched.h>
-
 #include <common/config.h>
 #include <core/jobs.h>
 

+ 0 - 5
src/drivers/cuda/driver_cuda.h

@@ -17,11 +17,6 @@
 #ifndef __DRIVER_CUDA_H__
 #define __DRIVER_CUDA_H__
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-#include <sched.h>
-
 #include <assert.h>
 #include <math.h>
 #include <stdio.h>