Browse Source

fixed starpu_malloc error

Andra Hugo 14 years ago
parent
commit
c641a4796d
2 changed files with 3 additions and 4 deletions
  1. 3 3
      examples/lu/lu_example.c
  2. 0 1
      examples/lu/xlu_kernels.c

+ 3 - 3
examples/lu/lu_example.c

@@ -137,7 +137,7 @@ void copy_matrix_into_blocks(void)
 	for (bj = 0; bj < nblocks; bj++)
 	for (bj = 0; bj < nblocks; bj++)
 	for (bi = 0; bi < nblocks; bi++)
 	for (bi = 0; bi < nblocks; bi++)
 	{
 	{
-		starpu_malloc((void **)&A_blocks[bi+nblocks*bj], (size_t)blocksize*blocksize*sizeof(TYPE));
+		starpu_data_malloc_pinned_if_possible((void **)&A_blocks[bi+nblocks*bj], (size_t)blocksize*blocksize*sizeof(TYPE));
 
 
 		for (j = 0; j < blocksize; j++)
 		for (j = 0; j < blocksize; j++)
 		for (i = 0; i < blocksize; i++)
 		for (i = 0; i < blocksize; i++)
@@ -151,7 +151,7 @@ void copy_matrix_into_blocks(void)
 static void init_matrix(void)
 static void init_matrix(void)
 {
 {
 	/* allocate matrix */
 	/* allocate matrix */
-	starpu_malloc((void **)&A, (size_t)size*size*sizeof(TYPE));
+	starpu_data_malloc_pinned_if_possible((void **)&A, (size_t)size*size*sizeof(TYPE));
 	STARPU_ASSERT(A);
 	STARPU_ASSERT(A);
 
 
 	starpu_srand48((long int)time(NULL));
 	starpu_srand48((long int)time(NULL));
@@ -317,7 +317,7 @@ int main(int argc, char **argv)
 			unsigned n = size;
 			unsigned n = size;
 			double flop = (2.0f*n*n*n)/3.0f;
 			double flop = (2.0f*n*n*n)/3.0f;
 			FPRINTF(stderr, "Synthetic GFlops (TOTAL) : \n");
 			FPRINTF(stderr, "Synthetic GFlops (TOTAL) : \n");
-			FPRINTF(stdout, "%d	%6.2f\n", n, (flop/timing/1000.0f));
+			FPRINTF(stdout, "%u	%6.2f\n", n, (flop/timing/1000.0f));
 		}
 		}
 	}
 	}
 	else
 	else

+ 0 - 1
examples/lu/xlu_kernels.c

@@ -211,7 +211,6 @@ static inline void STARPU_LU(common_u21)(void *descr[],
 	
 	
 #ifdef STARPU_USE_CUDA
 #ifdef STARPU_USE_CUDA
 	cublasStatus status;
 	cublasStatus status;
-	cudaError_t cures;
 #endif
 #endif
 
 
 	switch (s) {
 	switch (s) {