Browse Source

misc windows fixes

Samuel Thibault 14 years ago
parent
commit
f534ed4a44

+ 4 - 0
src/common/fxt.c

@@ -20,6 +20,10 @@
 
 #include <common/fxt.h>
 
+#ifdef STARPU_HAVE_WINDOWS
+#include <windows.h>
+#endif
+		
 #define PROF_BUFFER_SIZE  (8*1024*1024)
 
 static char PROF_FILE_USER[128];

+ 4 - 0
src/core/perfmodel/perfmodel.c

@@ -25,6 +25,10 @@
 #include <core/workers.h>
 #include <datawizard/datawizard.h>
 
+#ifdef STARPU_HAVE_WINDOWS
+#include <windows.h>
+#endif
+		
 /* This flag indicates whether performance models should be calibrated or not.
  *	0: models need not be calibrated
  *	1: models must be calibrated

+ 4 - 0
src/core/perfmodel/perfmodel.h

@@ -59,7 +59,11 @@ struct starpu_history_entry_t {
 	unsigned nsample;
 
 	uint32_t footprint;
+#ifdef STARPU_HAVE_WINDOWS
+	unsigned size; /* in bytes */
+#else
 	size_t size; /* in bytes */
+#endif
 };
 
 struct starpu_history_list_t {

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

@@ -31,6 +31,10 @@
 #include <core/workers.h>
 #include <core/perfmodel/perfmodel.h>
 
+#ifdef STARPU_HAVE_WINDOWS
+#include <windows.h>
+#endif
+		
 #define SIZE	(32*1024*1024*sizeof(char))
 #define NITER	128
 

+ 9 - 1
src/core/perfmodel/perfmodel_history.c

@@ -27,6 +27,10 @@
 #include <core/perfmodel/regression.h>
 #include <common/config.h>
 
+#ifdef STARPU_HAVE_WINDOWS
+#include <windows.h>
+#endif
+		
 static pthread_rwlock_t registered_models_rwlock;
 static struct starpu_model_list_t *registered_models = NULL;
 
@@ -79,7 +83,11 @@ static void scan_history_entry(FILE *f, struct starpu_history_entry_t *entry)
 
 	_starpu_drop_comments(f);
 
-	res = fscanf(f, "%x\t%zu\t%le\t%le\t%le\t%le\t%u\n", &entry->footprint, &entry->size, &entry->mean, &entry->deviation, &entry->sum, &entry->sum2, &entry->nsample);
+	res = fscanf(f, "%x\t%"
+#ifndef STARPU_HAVE_WINDOWS
+	"z"
+#endif
+	"u\t%le\t%le\t%le\t%le\t%u\n", &entry->footprint, &entry->size, &entry->mean, &entry->deviation, &entry->sum, &entry->sum2, &entry->nsample);
 	STARPU_ASSERT(res == 7);
 }
 

+ 1 - 1
src/core/topology.c

@@ -31,7 +31,7 @@
 #endif
 #endif
 
-#if defined(__MINGW32__) || defined(__CYGWIN__)
+#ifdef STARPU_HAVE_WINDOWS
 #include <windows.h>
 #endif
 		

+ 3 - 0
tools/calibrate_bus.c

@@ -15,6 +15,9 @@
  */
 
 #include <starpu.h>
+#ifdef __MINGW32__
+#include <windows.h>
+#endif
 
 int main(int argc, char **argv)
 {

+ 4 - 0
tools/perfmodel_display.c

@@ -22,6 +22,10 @@
 #include <starpu_perfmodel.h>
 #include <core/perfmodel/perfmodel.h> // we need to browse the list associated to history-based models
 
+#ifdef __MINGW32__
+#include <windows.h>
+#endif
+
 static struct starpu_perfmodel_t model;
 
 /* display all available models */