Selaa lähdekoodia

Add STARPU_MATRIX_SET_LD too

Samuel Thibault 6 vuotta sitten
vanhempi
commit
944a8182fa
3 muutettua tiedostoa jossa 10 lisäystä ja 2 poistoa
  1. 1 1
      ChangeLog
  2. 1 1
      doc/doxygen/chapters/310_data_management.doxy
  3. 8 0
      include/starpu_data_interfaces.h

+ 1 - 1
ChangeLog

@@ -20,7 +20,7 @@ StarPU 1.4.0 (svn revision xxxx)
 ==============================================
 New features:
   * New schedulers modular-pheft, modular-prandom and modular-prandom-prio
-  * Add STARPU_MATRIX_SET_NX/NY to change a matrix tile size without
+  * Add STARPU_MATRIX_SET_NX/NY/LD to change a matrix tile size without
     reallocating the buffer.
 
 StarPU 1.3.0 (svn revision xxxx)

+ 1 - 1
doc/doxygen/chapters/310_data_management.doxy

@@ -152,7 +152,7 @@ Tasks are actually allowed to change the size of data interfaces.
 
 The simplest case is just changing the amount of data actually used within the
 allocated buffer. This is for instance implemented for the matrix interface: one
-can set the new NX/NY values with STARPU_MATRIX_SET_NX() and STARPU_MATRIX_SET_NY()
+can set the new NX/NY values with STARPU_MATRIX_SET_NX(), STARPU_MATRIX_SET_NY(), and STARPU_MATRIX_SET_LD()
 at the end of the task implementation. Data transfers achieved by StarPU will
 then use these values instead of the whole allocated size. The values of course
 need to be set within the original allocation. To reserve room for increasing

+ 8 - 0
include/starpu_data_interfaces.h

@@ -848,6 +848,14 @@ size_t starpu_matrix_get_allocsize(starpu_data_handle_t handle);
 #define STARPU_MATRIX_SET_NY(interface, newny)	        do { \
 	(((struct starpu_matrix_interface *)(interface))->ny) = (newny); \
 } while(0)
+/**
+   Set the number of elements between each row of the matrix
+   designated by \p interface. May be set to the same value as nx when there is
+   no padding.
+*/
+#define STARPU_MATRIX_SET_LD(interface, newld)	        do { \
+	(((struct starpu_matrix_interface *)(interface))->ld) = (newld); \
+} while(0)
 
 /** @} */