소스 검색

- The different data interfaces are now indexed between 0 and
STARPU_NINTERFACES_ID - 1 (so that we can implement per-interface functions
from third party tools for instance).
- Cleanup src/datawizard/interfaces/ a little by removing now useless headers

Cédric Augonnet 15 년 전
부모
커밋
e51aadfda3

+ 8 - 0
include/starpu-data-interfaces.h

@@ -151,6 +151,14 @@ uint32_t starpu_get_bcsr_r(starpu_data_handle);
 uint32_t starpu_get_bcsr_c(starpu_data_handle);
 size_t starpu_get_bcsr_elemsize(struct starpu_data_state_t *state);
 
+#define STARPU_BLAS_INTERFACE_ID	0
+#define STARPU_BLOCK_INTERFACE_ID	1
+#define STARPU_VECTOR_INTERFACE_ID	2
+#define STARPU_CSR_INTERFACE_ID		3
+#define STARPU_CSC_INTERFACE_ID		4
+#define STARPU_BCSCR_INTERFACE_ID	5
+#define STARPU_NINTERFACES_ID		6 /* number of data interfaces */
+
 typedef union {
 	starpu_blas_interface_t blas;	/* dense BLAS representation */
 	starpu_block_interface_t block;	/* BLOCK interface for 3D dense blocks */

+ 0 - 10
src/Makefile.am

@@ -62,17 +62,7 @@ noinst_HEADERS = 						\
 	datawizard/copy-driver.h				\
 	datawizard/coherency.h					\
 	datawizard/memory_nodes.h				\
-	datawizard/interfaces/blas_interface.h			\
-	datawizard/interfaces/block_interface.h			\
-	datawizard/interfaces/csr_filters.h			\
-	datawizard/interfaces/csc_interface.h			\
-	datawizard/interfaces/bcsr_filters.h			\
-	datawizard/interfaces/bcsr_interface.h			\
 	datawizard/interfaces/data_interface.h			\
-	datawizard/interfaces/vector_filters.h			\
-	datawizard/interfaces/vector_interface.h		\
-	datawizard/interfaces/blas_filters.h			\
-	datawizard/interfaces/csr_interface.h			\
 	common/hash.h						\
 	common/timing.h						\
 	common/htable32.h					\

+ 0 - 12
src/datawizard/datawizard.h

@@ -27,16 +27,4 @@
 
 #include <datawizard/interfaces/data_interface.h>
 
-#include <datawizard/interfaces/blas_interface.h>
-#include <datawizard/interfaces/block_interface.h>
-#include <datawizard/interfaces/vector_interface.h>
-#include <datawizard/interfaces/csr_interface.h>
-#include <datawizard/interfaces/csc_interface.h>
-#include <datawizard/interfaces/bcsr_interface.h>
-
-#include <datawizard/interfaces/blas_filters.h>
-#include <datawizard/interfaces/vector_filters.h>
-#include <datawizard/interfaces/csr_filters.h>
-#include <datawizard/interfaces/bcsr_filters.h>
-
 #endif // __DATAWIZARD_H__

+ 3 - 4
src/datawizard/interfaces/bcsr_filters.c

@@ -14,10 +14,9 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
-#include "bcsr_filters.h"
-#include "bcsr_interface.h"
-#include "blas_filters.h"
-#include "blas_interface.h"
+#include <starpu.h>
+#include <common/config.h>
+#include <datawizard/hierarchy.h>
 
 extern struct data_interface_ops_t interface_blas_ops;
 

+ 0 - 22
src/datawizard/interfaces/bcsr_filters.h

@@ -1,22 +0,0 @@
-/*
- * StarPU
- * Copyright (C) INRIA 2008-2009 (see AUTHORS file)
- *
- * This program 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.
- *
- * This program 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.
- */
-
-#ifndef __BCSR_FILTERS_H__
-#define __BCSR_FILTERS_H__
-
-#include <datawizard/hierarchy.h>
-
-#endif // __BCSR_FILTERS_H__

+ 4 - 7
src/datawizard/interfaces/bcsr_interface.c

@@ -14,18 +14,15 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <starpu.h>
+#include <common/config.h>
+
 #include <datawizard/data_parameters.h>
 #include <datawizard/coherency.h>
 #include <datawizard/copy-driver.h>
 #include <datawizard/hierarchy.h>
-#include <starpu.h>
-
 #include <common/hash.h>
 
-#ifdef USE_CUDA
-#include <cuda.h>
-#endif
-
 /*
  * BCSR : blocked CSR, we use blocks of size (r x c)
  */
@@ -62,7 +59,7 @@ struct data_interface_ops_t interface_bcsr_ops = {
 	.copy_methods = &bcsr_copy_data_methods_s,
 	.dump_data_interface = dump_bcsr_interface,
 	.get_size = bcsr_interface_get_size,
-	.interfaceid = BCSR_INTERFACE,
+	.interfaceid = STARPU_BCSCR_INTERFACE_ID,
 	.footprint = footprint_bcsr_interface_crc32
 };
 

+ 0 - 26
src/datawizard/interfaces/bcsr_interface.h

@@ -1,26 +0,0 @@
-/*
- * StarPU
- * Copyright (C) INRIA 2008-2009 (see AUTHORS file)
- *
- * This program 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.
- *
- * This program 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.
- */
-
-#ifndef __BCSR_INTERFACE_H__
-#define __BCSR_INTERFACE_H__
-
-#include <stdint.h>
-
-/* this interface is used for Sparse matrices */
-
-#define BCSR_INTERFACE	0x118504
-
-#endif // __BCSR_INTERFACE_H__

+ 3 - 2
src/datawizard/interfaces/blas_filters.c

@@ -14,8 +14,9 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
-#include "blas_filters.h"
-#include "blas_interface.h"
+#include <starpu.h>
+#include <common/config.h>
+#include <datawizard/hierarchy.h>
 
 /*
  * an example of a dummy partition function : blocks ...

+ 0 - 22
src/datawizard/interfaces/blas_filters.h

@@ -1,22 +0,0 @@
-/*
- * StarPU
- * Copyright (C) INRIA 2008-2009 (see AUTHORS file)
- *
- * This program 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.
- *
- * This program 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.
- */
-
-#ifndef __BLAS_FILTERS_H__
-#define __BLAS_FILTERS_H__
-
-#include <datawizard/hierarchy.h>
-
-#endif // __BLAS_FILTERS_H__

+ 1 - 1
src/datawizard/interfaces/blas_interface.c

@@ -74,7 +74,7 @@ struct data_interface_ops_t interface_blas_ops = {
 #ifdef USE_GORDON
 	.convert_to_gordon = convert_blas_to_gordon,
 #endif
-	.interfaceid = BLAS_INTERFACE, 
+	.interfaceid = STARPU_BLAS_INTERFACE_ID, 
 	.display = display_blas_interface
 };
 

+ 0 - 24
src/datawizard/interfaces/blas_interface.h

@@ -1,24 +0,0 @@
-/*
- * StarPU
- * Copyright (C) INRIA 2008-2009 (see AUTHORS file)
- *
- * This program 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.
- *
- * This program 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.
- */
-
-#ifndef __BLAS_INTERFACE_H__
-#define __BLAS_INTERFACE_H__
-
-#include <stdint.h>
-
-#define BLAS_INTERFACE   0x118501
-
-#endif // __BLAS_INTERFACE_H__

+ 2 - 7
src/datawizard/interfaces/block_interface.c

@@ -14,6 +14,7 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <starpu.h>
 #include <common/config.h>
 #include <datawizard/data_parameters.h>
 #include <datawizard/coherency.h>
@@ -22,12 +23,6 @@
 
 #include <common/hash.h>
 
-#include <starpu.h>
-
-#ifdef USE_CUDA
-#include <cuda.h>
-#endif
-
 static int dummy_copy_ram_to_ram(struct starpu_data_state_t *state, uint32_t src_node, uint32_t dst_node);
 #ifdef USE_CUDA
 static int copy_ram_to_cublas(struct starpu_data_state_t *state, uint32_t src_node, uint32_t dst_node);
@@ -73,7 +68,7 @@ struct data_interface_ops_t interface_block_ops = {
 #ifdef USE_GORDON
 	.convert_to_gordon = convert_block_to_gordon,
 #endif
-	.interfaceid = BLOCK_INTERFACE, 
+	.interfaceid = STARPU_BLOCK_INTERFACE_ID, 
 	.display = display_block_interface
 };
 

+ 0 - 24
src/datawizard/interfaces/block_interface.h

@@ -1,24 +0,0 @@
-/*
- * StarPU
- * Copyright (C) INRIA 2008-2009 (see AUTHORS file)
- *
- * This program 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.
- *
- * This program 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.
- */
-
-#ifndef __BLOCK_INTERFACE_H__
-#define __BLOCK_INTERFACE_H__
-
-#include <stdint.h>
-
-#define BLOCK_INTERFACE   0x118512
-
-#endif // __BLOCK_INTERFACE_H__

+ 0 - 24
src/datawizard/interfaces/csc_interface.h

@@ -1,24 +0,0 @@
-/*
- * StarPU
- * Copyright (C) INRIA 2008-2009 (see AUTHORS file)
- *
- * This program 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.
- *
- * This program 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.
- */
-
-#ifndef __CSC_INTERFACE_H__
-#define __CSC_INTERFACE_H__
-
-/* this interface is used for Sparse matrices */
-
-#define CSC_INTERFACE	0x118505
-
-#endif // __CSC_INTERFACE_H__

+ 3 - 2
src/datawizard/interfaces/csr_filters.c

@@ -14,8 +14,9 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
-#include "csr_filters.h"
-#include "csr_interface.h"
+#include <starpu.h>
+#include <common/config.h>
+#include <datawizard/hierarchy.h>
 
 unsigned starpu_vertical_block_filter_func_csr(starpu_filter *f, data_state *root_data)
 {

+ 0 - 22
src/datawizard/interfaces/csr_filters.h

@@ -1,22 +0,0 @@
-/*
- * StarPU
- * Copyright (C) INRIA 2008-2009 (see AUTHORS file)
- *
- * This program 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.
- *
- * This program 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.
- */
-
-#ifndef __CSR_FILTERS_H__
-#define __CSR_FILTERS_H__
-
-#include <datawizard/hierarchy.h>
-
-#endif // __CSR_FILTERS_H__

+ 2 - 6
src/datawizard/interfaces/csr_interface.c

@@ -14,6 +14,7 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
+#include <starpu.h>
 #include <datawizard/data_parameters.h>
 #include <datawizard/coherency.h>
 #include <datawizard/copy-driver.h>
@@ -21,11 +22,6 @@
 
 #include <common/hash.h>
 
-#include <starpu.h>
-
-#ifdef USE_CUDA
-#include <cuda.h>
-#endif
 
 static int dummy_copy_ram_to_ram(struct starpu_data_state_t *state, uint32_t src_node, uint32_t dst_node);
 #ifdef USE_CUDA
@@ -60,7 +56,7 @@ struct data_interface_ops_t interface_csr_ops = {
 	.copy_methods = &csr_copy_data_methods_s,
 	.dump_data_interface = dump_csr_interface,
 	.get_size = csr_interface_get_size,
-	.interfaceid = CSR_INTERFACE,
+	.interfaceid = STARPU_CSR_INTERFACE_ID,
 	.footprint = footprint_csr_interface_crc32
 };
 

+ 0 - 26
src/datawizard/interfaces/csr_interface.h

@@ -1,26 +0,0 @@
-/*
- * StarPU
- * Copyright (C) INRIA 2008-2009 (see AUTHORS file)
- *
- * This program 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.
- *
- * This program 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.
- */
-
-#ifndef __CSR_INTERFACE_H__
-#define __CSR_INTERFACE_H__
-
-#include <stdint.h>
-
-/* this interface is used for Sparse matrices */
-
-#define CSR_INTERFACE	0x118502
-
-#endif // __CSR_INTERFACE_H__

+ 0 - 6
src/datawizard/interfaces/data_interface.h

@@ -21,12 +21,6 @@
 
 #include <common/config.h>
 #include <datawizard/data_parameters.h>
-#include "blas_interface.h"
-#include "block_interface.h"
-#include "vector_interface.h"
-#include "csr_interface.h"
-#include "csc_interface.h"
-#include "bcsr_interface.h"
 
 #ifdef USE_GORDON
 /* to get the gordon_strideSize_t data structure from gordon */

+ 3 - 2
src/datawizard/interfaces/vector_filters.c

@@ -14,8 +14,9 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
-#include "vector_filters.h"
-#include "vector_interface.h"
+#include <starpu.h>
+#include <common/config.h>
+#include <datawizard/hierarchy.h>
 
 unsigned starpu_block_filter_func_vector(starpu_filter *f, data_state *root_data)
 {

+ 0 - 22
src/datawizard/interfaces/vector_filters.h

@@ -1,22 +0,0 @@
-/*
- * StarPU
- * Copyright (C) INRIA 2008-2009 (see AUTHORS file)
- *
- * This program 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.
- *
- * This program 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.
- */
-
-#ifndef __VECTOR_FILTERS_H__
-#define __VECTOR_FILTERS_H__
-
-#include <datawizard/hierarchy.h>
-
-#endif // __VECTOR_FILTERS_H__

+ 1 - 1
src/datawizard/interfaces/vector_interface.c

@@ -72,7 +72,7 @@ struct data_interface_ops_t interface_vector_ops = {
 #ifdef USE_GORDON
 	.convert_to_gordon = convert_vector_to_gordon,
 #endif
-	.interfaceid = VECTOR_INTERFACE,
+	.interfaceid = STARPU_VECTOR_INTERFACE_ID,
 	.display = display_vector_interface
 };
 

+ 0 - 24
src/datawizard/interfaces/vector_interface.h

@@ -1,24 +0,0 @@
-/*
- * StarPU
- * Copyright (C) INRIA 2008-2009 (see AUTHORS file)
- *
- * This program 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.
- *
- * This program 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.
- */
-
-#ifndef __VECTOR_INTERFACE_H__
-#define __VECTOR_INTERFACE_H__
-
-#include <stdint.h>
-
-#define VECTOR_INTERFACE   0x118503
-
-#endif // __VECTOR_INTERFACE_H__