MAGMA  1.2.0
MatrixAlgebraonGPUandMulticoreArchitectures
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
codelet_zplgsy.c
Go to the documentation of this file.
1 
17 #include "morse_starpu.h"
18 
19 /*
20  * Codelet CPU
21  */
22 static void cl_zplgsy_cpu_func(void *descr[], void *cl_arg)
23 {
24  PLASMA_Complex64_t bump;
25  int m;
26  int n;
27  PLASMA_Complex64_t *A;
28  int lda;
29  int bigM;
30  int m0;
31  int n0;
32  unsigned long long int seed;
33 
34  starpu_unpack_cl_args( cl_arg, &bump, &m, &n, &lda, &bigM, &m0, &n0, &seed );
35 
36  A = (PLASMA_Complex64_t *)STARPU_MATRIX_GET_PTR(descr[0]);
37 
38  CORE_zplgsy( bump, m, n, A, lda, bigM, m0, n0, seed );
39 }
40 
41 /*
42  * Codelet Multi-cores
43  */
44 #if defined(MORSE_USE_MULTICORE) && 0
45 static void cl_zplgsy_mc_func(void *descr[], void *cl_arg)
46 {
47 }
48 #endif
49 
50 /*
51  * Codelet GPU
52  */
53 #if (defined MORSE_USE_CUDA) && 0
54 static void cl_zplgsy_cuda_func(void *descr[], void *cl_arg)
55 {
56  cudaThreadSynchronize();
57 }
58 #endif
59 
60 /*
61  * Codelet definition
62  */
64 
65 /*
66  * Wrapper
67  */
68 void MORSE_zplgsy( MorseOption_t *options,
69  PLASMA_Complex64_t bump, int m, int n, magma_desc_t *A, int Am, int An,
70  int bigM, int m0, int n0, unsigned long long int seed )
71 {
72  starpu_codelet *zplgsy_codelet;
73  void (*callback)(void*) = options->profiling ? cl_zplgsy_callback : NULL;
74  int lda = BLKLDD( A, Am );
75 
76 #ifdef MORSE_USE_MULTICORE
77  zplgsy_codelet = options->parallel ? &cl_zplgsy_mc : &cl_zplgsy;
78 #else
79  zplgsy_codelet = &cl_zplgsy;
80 #endif
81 
83  &cl_zplgsy,
84  VALUE, &bump, sizeof(PLASMA_Complex64_t),
85  VALUE, &m, sizeof(int),
86  VALUE, &n, sizeof(int),
87  OUTPUT, BLKADDR( A, PLASMA_Complex64_t, Am, An ),
88  VALUE, &lda, sizeof(int),
89  VALUE, &bigM, sizeof(int),
90  VALUE, &m0, sizeof(int),
91  VALUE, &n0, sizeof(int),
92  VALUE, &seed, sizeof(unsigned long long int),
93  PRIORITY, options->priority,
94  CALLBACK, callback, NULL,
95  0);
96 }