Explorar el Código

move disk.h to starpu disk.h and add in starpu.h

Corentin Salingue hace 12 años
padre
commit
371338bfb6
Se han modificado 2 ficheros con 43 adiciones y 0 borrados
  1. 1 0
      include/starpu.h
  2. 42 0
      include/starpu_disk.h

+ 1 - 0
include/starpu.h

@@ -45,6 +45,7 @@ typedef UINT_PTR uintptr_t;
 #include <starpu_thread_util.h>
 #include <starpu_util.h>
 #include <starpu_data.h>
+#include <starpu_disk.h>
 #include <starpu_data_interfaces.h>
 #include <starpu_data_filters.h>
 #include <starpu_stdlib.h>

+ 42 - 0
include/starpu_disk.h

@@ -0,0 +1,42 @@
+/* StarPU --- Runtime system for heterogeneous multicore architectures.
+ *
+ * Copyright (C) 2013 Corentin Salingue
+ *
+ * StarPU is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or (at
+ * your option) any later version.
+ *
+ * StarPU is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * See the GNU Lesser General Public License in COPYING.LGPL for more details.
+ */
+
+typedef void * (*disk_function)(void *, unsigned);
+
+/* list of functions to use on disk */
+struct disk_ops {
+	 void *  (*alloc)  (void *base, size_t size); /* nom de fichier: mkstemp, et retourne obj */
+	 void    (*free)   (void *base, void *obj, size_t size); /* supprime et libère l'obj */
+	 void *  (*open)   (void *base, void *pos, size_t size); /* open dans le répertoire  un fichier existant, retourne l'obj */
+	 void    (*close)  (void *base, void *obj, size_t size); /* libère l'obj */
+	ssize_t  (*read)   (void *base, void *obj, void *buf, off_t offset, size_t size); /* ~= pread */
+	ssize_t  (*write)  (void *base, void *obj, const void *buf, off_t offset, size_t size);
+	/* readv, writev, read2d, write2d, etc. */
+	 void *  (*plug)   (void *parameter); /* en posix, directory, retourne base */
+	 void    (*unplug) (void *base); /* libère la base */
+};
+
+/* en posix, base = le répertoire, pos = le fichier, obj = la donnée renvoyée à starpu, ici un FILE* */
+
+extern struct disk_ops write_on_file;
+
+unsigned
+starpu_disk_register(struct disk_ops * func, void *parameter);
+
+void
+starpu_disk_free(unsigned node);
+
+