Samuel Thibault 13 年 前
コミット
fd3c505415
共有3 個のファイルを変更した21 個の追加2 個の削除を含む
  1. 17 0
      examples/heat/dw_factolu.c
  2. 2 1
      examples/heat/heat.c
  3. 2 1
      examples/heat/heat.h

+ 17 - 0
examples/heat/dw_factolu.c

@@ -268,6 +268,7 @@ void dw_callback_v2_codelet_update_u12(void *argcb)
 			}
 		}
 	}
+	free(argcb);
 }
 
 void dw_callback_v2_codelet_update_u21(void *argcb)
@@ -327,6 +328,7 @@ void dw_callback_v2_codelet_update_u21(void *argcb)
 			}
 		}
 	}
+	free(argcb);
 }
 
 void dw_callback_v2_codelet_update_u11(void *argcb)
@@ -443,6 +445,7 @@ void dw_callback_v2_codelet_update_u11(void *argcb)
 			}
 		}
 	}
+	free(argcb);
 }
 
 
@@ -736,6 +739,20 @@ void initialize_system(float **A, float **B, unsigned dim, unsigned pinned)
 	}
 }
 
+void free_system(float *A, float *B, unsigned dim, unsigned pinned)
+{
+	if (pinned)
+	{
+		starpu_free(A);
+		starpu_free(B);
+	}
+	else
+	{
+		free(A);
+		free(B);
+	}
+}
+
 void dw_factoLU(float *matA, unsigned size, 
 		unsigned ld, unsigned nblocks, 
 		unsigned version, unsigned _no_prio)

+ 2 - 1
examples/heat/heat.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009, 2010  Université de Bordeaux 1
+ * Copyright (C) 2009, 2010, 2012  Université de Bordeaux 1
  * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -789,6 +789,7 @@ int main(int argc, char **argv)
 			solve_system(DIM, newsize, result, RefArray, Bformer, A, B);
 
 		starpu_shutdown();
+		free_system(A, B, newsize, pinned);
 	}
 
 #ifdef STARPU_OPENGL_RENDER

+ 2 - 1
examples/heat/heat.h

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009, 2010, 2011  Université de Bordeaux 1
+ * Copyright (C) 2009, 2010, 2011-2012  Université de Bordeaux 1
  * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -62,6 +62,7 @@ extern void dw_factoLU(float *matA, unsigned size, unsigned ld, unsigned nblocks
 extern void dw_factoLU_tag(float *matA, unsigned size, unsigned ld, unsigned nblocks, unsigned no_prio);
 extern void dw_factoLU_grain(float *matA, unsigned size, unsigned ld, unsigned nblocks, unsigned nbigblocks);
 extern void initialize_system(float **A, float **B, unsigned dim, unsigned pinned);
+extern void free_system(float *A, float *B, unsigned dim, unsigned pinned);
 
 void display_stat_heat(void);