Explorar o código

finish to prefix GET_BLAS_* helpers

Cédric Augonnet %!s(int64=15) %!d(string=hai) anos
pai
achega
8b213605f2

+ 38 - 38
examples/pastix-wrappers/starpu-blas-wrapper.c

@@ -256,12 +256,12 @@ void STARPU_DECLARE_WORK_BLOCKS(float *maxbloktab1, float *maxbloktab2, unsigned
 void _cpu_cblk_strsm(void *descr[], void *arg __attribute__((unused)))
 {
 	uint32_t nx, ny, ld;
-	nx = GET_BLAS_NX(descr[0]);
-	ny = GET_BLAS_NY(descr[0]);
-	ld = GET_BLAS_LD(descr[0]);
+	nx = STARPU_GET_BLAS_NX(descr[0]);
+	ny = STARPU_GET_BLAS_NY(descr[0]);
+	ld = STARPU_GET_BLAS_LD(descr[0]);
 
 	float *diag_cblkdata, *extra_cblkdata;
-	diag_cblkdata = (float *)GET_BLAS_PTR(descr[0]);
+	diag_cblkdata = (float *)STARPU_GET_BLAS_PTR(descr[0]);
 	extra_cblkdata = diag_cblkdata + ny;
 
 	unsigned m = nx - ny;
@@ -278,12 +278,12 @@ void _cpu_cblk_strsm(void *descr[], void *arg __attribute__((unused)))
 void _cublas_cblk_strsm(void *descr[], void *arg __attribute__((unused)))
 {
 	uint32_t nx, ny, ld;
-	nx = GET_BLAS_NX(descr[0]);
-	ny = GET_BLAS_NY(descr[0]);
-	ld = GET_BLAS_LD(descr[0]);
+	nx = STARPU_GET_BLAS_NX(descr[0]);
+	ny = STARPU_GET_BLAS_NY(descr[0]);
+	ld = STARPU_GET_BLAS_LD(descr[0]);
 
 	float *diag_cblkdata, *extra_cblkdata;
-	diag_cblkdata = (float *)GET_BLAS_PTR(descr[0]);
+	diag_cblkdata = (float *)STARPU_GET_BLAS_PTR(descr[0]);
 	extra_cblkdata = diag_cblkdata + ny;
 
 	unsigned m = nx - ny;
@@ -358,11 +358,11 @@ void _cpu_compute_contrib_compact(void *descr[], void *arg)
 {
 	struct starpu_compute_contrib_compact_args *args = arg;
 
-	float *gaik = (float *)GET_BLAS_PTR(descr[0]) + args->dima;
-	float *gb = (float *)GET_BLAS_PTR(descr[1]); 
-	unsigned strideb = (unsigned)GET_BLAS_LD(descr[1]);
-	float *gc = (float *)GET_BLAS_PTR(descr[2]);
-	unsigned stridec = (unsigned)GET_BLAS_LD(descr[2]);
+	float *gaik = (float *)STARPU_GET_BLAS_PTR(descr[0]) + args->dima;
+	float *gb = (float *)STARPU_GET_BLAS_PTR(descr[1]); 
+	unsigned strideb = (unsigned)STARPU_GET_BLAS_LD(descr[1]);
+	float *gc = (float *)STARPU_GET_BLAS_PTR(descr[2]);
+	unsigned stridec = (unsigned)STARPU_GET_BLAS_LD(descr[2]);
 
 	cpu_sgemm++;
 
@@ -379,11 +379,11 @@ void _cublas_compute_contrib_compact(void *descr[], void *arg)
 {
 	struct starpu_compute_contrib_compact_args *args = arg;
 
-	float *gaik = (float *)GET_BLAS_PTR(descr[0]) + args->dima;
-	float *gb = (float *)GET_BLAS_PTR(descr[1]);
-	unsigned strideb = (unsigned)GET_BLAS_LD(descr[1]);
-	float *gc = (float *)GET_BLAS_PTR(descr[2]);
-	unsigned stridec = (unsigned)GET_BLAS_LD(descr[2]);
+	float *gaik = (float *)STARPU_GET_BLAS_PTR(descr[0]) + args->dima;
+	float *gb = (float *)STARPU_GET_BLAS_PTR(descr[1]);
+	unsigned strideb = (unsigned)STARPU_GET_BLAS_LD(descr[1]);
+	float *gc = (float *)STARPU_GET_BLAS_PTR(descr[2]);
+	unsigned stridec = (unsigned)STARPU_GET_BLAS_LD(descr[2]);
 	
 	cublas_sgemm++;
 
@@ -515,20 +515,20 @@ void _cublas_sgemm(void *descr[], void *arg)
 	uint32_t nxB, nyB, ldB;
 	uint32_t nxC, nyC, ldC;
 
-	A = (float *)GET_BLAS_PTR(descr[0]);
-	nxA = GET_BLAS_NX(descr[0]);
-	nyA = GET_BLAS_NY(descr[0]);
-	ldA = GET_BLAS_LD(descr[0]);
+	A = (float *)STARPU_GET_BLAS_PTR(descr[0]);
+	nxA = STARPU_GET_BLAS_NX(descr[0]);
+	nyA = STARPU_GET_BLAS_NY(descr[0]);
+	ldA = STARPU_GET_BLAS_LD(descr[0]);
 
-	B = (float *)GET_BLAS_PTR(descr[1]);
-	nxB = GET_BLAS_NX(descr[1]);
-	nyB = GET_BLAS_NY(descr[1]);
-	ldB = GET_BLAS_LD(descr[1]);
+	B = (float *)STARPU_GET_BLAS_PTR(descr[1]);
+	nxB = STARPU_GET_BLAS_NX(descr[1]);
+	nyB = STARPU_GET_BLAS_NY(descr[1]);
+	ldB = STARPU_GET_BLAS_LD(descr[1]);
 
-	C = (float *)GET_BLAS_PTR(descr[2]);
-	nxC = GET_BLAS_NX(descr[2]);
-	nyC = GET_BLAS_NY(descr[2]);
-	ldC = GET_BLAS_LD(descr[2]);
+	C = (float *)STARPU_GET_BLAS_PTR(descr[2]);
+	nxC = STARPU_GET_BLAS_NX(descr[2]);
+	nyC = STARPU_GET_BLAS_NY(descr[2]);
+	ldC = STARPU_GET_BLAS_LD(descr[2]);
 
 	struct sgemm_args *args = arg;
 
@@ -662,15 +662,15 @@ struct strsm_args {
 //	uint32_t nxA, nyA, ldA;
 //	uint32_t nxB, nyB, ldB;
 //
-//	A = (float *)GET_BLAS_PTR(descr[0]);
-//	nxA = GET_BLAS_NX(descr[0]);
-//	nyA = GET_BLAS_NY(descr[0]);
-//	ldA = GET_BLAS_LD(descr[0]);
+//	A = (float *)STARPU_GET_BLAS_PTR(descr[0]);
+//	nxA = STARPU_GET_BLAS_NX(descr[0]);
+//	nyA = STARPU_GET_BLAS_NY(descr[0]);
+//	ldA = STARPU_GET_BLAS_LD(descr[0]);
 //
-//	B = (float *)GET_BLAS_PTR(descr[1]);
-//	nxB = GET_BLAS_NX(descr[1]);
-//	nyB = GET_BLAS_NY(descr[1]);
-//	ldB = GET_BLAS_LD(descr[1]);
+//	B = (float *)STARPU_GET_BLAS_PTR(descr[1]);
+//	nxB = STARPU_GET_BLAS_NX(descr[1]);
+//	nyB = STARPU_GET_BLAS_NY(descr[1]);
+//	ldB = STARPU_GET_BLAS_LD(descr[1]);
 //
 //	struct strsm_args *args = arg;
 //

+ 4 - 4
examples/spmv/dw_block_spmv_kernels.c

@@ -23,14 +23,14 @@
 static inline void common_block_spmv(void *descr[], int s, __attribute__((unused)) void *_args)
 {
 	//printf("22\n");
-	float *block 	= (float *)GET_BLAS_PTR(descr[0]);
+	float *block 	= (float *)STARPU_GET_BLAS_PTR(descr[0]);
 	float *in 	= (float *)STARPU_GET_VECTOR_PTR(descr[1]);
 	float *out 	= (float *)STARPU_GET_VECTOR_PTR(descr[2]);
 
-	unsigned dx = GET_BLAS_NX(descr[0]);
-	unsigned dy = GET_BLAS_NY(descr[0]);
+	unsigned dx = STARPU_GET_BLAS_NX(descr[0]);
+	unsigned dy = STARPU_GET_BLAS_NY(descr[0]);
 
-	unsigned ld = GET_BLAS_LD(descr[0]);
+	unsigned ld = STARPU_GET_BLAS_LD(descr[0]);
 
 	switch (s) {
 		case 0:

+ 24 - 24
mpi/examples/mpi_lu/pxlu_kernels.c

@@ -27,17 +27,17 @@
 static inline void STARPU_PLU(common_u22)(void *descr[],
 				int s, __attribute__((unused)) void *_args)
 {
-	TYPE *right 	= (TYPE *)GET_BLAS_PTR(descr[0]);
-	TYPE *left 	= (TYPE *)GET_BLAS_PTR(descr[1]);
-	TYPE *center 	= (TYPE *)GET_BLAS_PTR(descr[2]);
+	TYPE *right 	= (TYPE *)STARPU_GET_BLAS_PTR(descr[0]);
+	TYPE *left 	= (TYPE *)STARPU_GET_BLAS_PTR(descr[1]);
+	TYPE *center 	= (TYPE *)STARPU_GET_BLAS_PTR(descr[2]);
 
-	unsigned dx = GET_BLAS_NX(descr[2]);
-	unsigned dy = GET_BLAS_NY(descr[2]);
-	unsigned dz = GET_BLAS_NY(descr[0]);
+	unsigned dx = STARPU_GET_BLAS_NX(descr[2]);
+	unsigned dy = STARPU_GET_BLAS_NY(descr[2]);
+	unsigned dz = STARPU_GET_BLAS_NY(descr[0]);
 
-	unsigned ld12 = GET_BLAS_LD(descr[0]);
-	unsigned ld21 = GET_BLAS_LD(descr[1]);
-	unsigned ld22 = GET_BLAS_LD(descr[2]);
+	unsigned ld12 = STARPU_GET_BLAS_LD(descr[0]);
+	unsigned ld21 = STARPU_GET_BLAS_LD(descr[1]);
+	unsigned ld22 = STARPU_GET_BLAS_LD(descr[2]);
 
 #ifdef VERBOSE_KERNELS
 	struct debug_info *info = _args;
@@ -127,14 +127,14 @@ static inline void STARPU_PLU(common_u12)(void *descr[],
 	TYPE *sub11;
 	TYPE *sub12;
 
-	sub11 = (TYPE *)GET_BLAS_PTR(descr[0]);	
-	sub12 = (TYPE *)GET_BLAS_PTR(descr[1]);
+	sub11 = (TYPE *)STARPU_GET_BLAS_PTR(descr[0]);	
+	sub12 = (TYPE *)STARPU_GET_BLAS_PTR(descr[1]);
 
-	unsigned ld11 = GET_BLAS_LD(descr[0]);
-	unsigned ld12 = GET_BLAS_LD(descr[1]);
+	unsigned ld11 = STARPU_GET_BLAS_LD(descr[0]);
+	unsigned ld12 = STARPU_GET_BLAS_LD(descr[1]);
 
-	unsigned nx12 = GET_BLAS_NX(descr[1]);
-	unsigned ny12 = GET_BLAS_NY(descr[1]);
+	unsigned nx12 = STARPU_GET_BLAS_NX(descr[1]);
+	unsigned ny12 = STARPU_GET_BLAS_NY(descr[1]);
 
 #ifdef VERBOSE_KERNELS
 	struct debug_info *info = _args;
@@ -234,14 +234,14 @@ static inline void STARPU_PLU(common_u21)(void *descr[],
 	TYPE *sub11;
 	TYPE *sub21;
 
-	sub11 = (TYPE *)GET_BLAS_PTR(descr[0]);
-	sub21 = (TYPE *)GET_BLAS_PTR(descr[1]);
+	sub11 = (TYPE *)STARPU_GET_BLAS_PTR(descr[0]);
+	sub21 = (TYPE *)STARPU_GET_BLAS_PTR(descr[1]);
 
-	unsigned ld11 = GET_BLAS_LD(descr[0]);
-	unsigned ld21 = GET_BLAS_LD(descr[1]);
+	unsigned ld11 = STARPU_GET_BLAS_LD(descr[0]);
+	unsigned ld21 = STARPU_GET_BLAS_LD(descr[1]);
 
-	unsigned nx21 = GET_BLAS_NX(descr[1]);
-	unsigned ny21 = GET_BLAS_NY(descr[1]);
+	unsigned nx21 = STARPU_GET_BLAS_NX(descr[1]);
+	unsigned ny21 = STARPU_GET_BLAS_NY(descr[1]);
 	
 #ifdef VERBOSE_KERNELS
 	struct debug_info *info = _args;
@@ -342,10 +342,10 @@ static inline void STARPU_PLU(common_u11)(void *descr[],
 {
 	TYPE *sub11;
 
-	sub11 = (TYPE *)GET_BLAS_PTR(descr[0]); 
+	sub11 = (TYPE *)STARPU_GET_BLAS_PTR(descr[0]); 
 
-	unsigned long nx = GET_BLAS_NX(descr[0]);
-	unsigned long ld = GET_BLAS_LD(descr[0]);
+	unsigned long nx = STARPU_GET_BLAS_NX(descr[0]);
+	unsigned long ld = STARPU_GET_BLAS_LD(descr[0]);
 
 	unsigned long z;
 

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

@@ -80,11 +80,11 @@ struct starpu_data_interface_ops_t interface_blas_ops = {
 static int convert_blas_to_gordon(void *interface, uint64_t *ptr, gordon_strideSize_t *ss) 
 {
 	size_t elemsize = GET_BLAS_ELEMSIZE(interface);
-	uint32_t nx = GET_BLAS_NX(interface);
-	uint32_t ny = GET_BLAS_NY(interface);
-	uint32_t ld = GET_BLAS_LD(interface);
+	uint32_t nx = STARPU_GET_BLAS_NX(interface);
+	uint32_t ny = STARPU_GET_BLAS_NY(interface);
+	uint32_t ld = STARPU_GET_BLAS_LD(interface);
 
-	*ptr = GET_BLAS_PTR(interface);
+	*ptr = STARPU_GET_BLAS_PTR(interface);
 
 	/* The gordon_stride_init function may use a contiguous buffer
  	 * in case nx = ld (in that case, (*ss).size = elemsize*nx*ny */