|
@@ -15,6 +15,10 @@
|
|
*/
|
|
*/
|
|
|
|
|
|
#include "dw_mult.h"
|
|
#include "dw_mult.h"
|
|
|
|
+#ifdef USE_GORDON
|
|
|
|
+#include "gordon/func_sgemm_ibm.h"
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
|
|
static pthread_mutex_t mutex;
|
|
static pthread_mutex_t mutex;
|
|
static pthread_cond_t cond;
|
|
static pthread_cond_t cond;
|
|
@@ -269,6 +273,8 @@ static void init_problem_data(void)
|
|
conf.m = BLOCKSIZEY;
|
|
conf.m = BLOCKSIZEY;
|
|
conf.n = BLOCKSIZEX;
|
|
conf.n = BLOCKSIZEX;
|
|
|
|
|
|
|
|
+ fprintf(stderr, "block size : x %d y %d z %d\n", BLOCKSIZEX, BLOCKSIZEY, BLOCKSIZEZ);
|
|
|
|
+
|
|
display_memory_consumption();
|
|
display_memory_consumption();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -356,16 +362,32 @@ static starpu_codelet cl = {
|
|
.cublas_func = cublas_mult,
|
|
.cublas_func = cublas_mult,
|
|
#endif
|
|
#endif
|
|
#ifdef USE_GORDON
|
|
#ifdef USE_GORDON
|
|
-#ifdef SPU_FUNC_SGEMM
|
|
|
|
- .gordon_func = SPU_FUNC_SGEMM,
|
|
|
|
-#else
|
|
|
|
-#warning SPU_FUNC_SGEMM is not available
|
|
|
|
-#endif
|
|
|
|
|
|
+ /* .gordon_func will be set by load_elf_sgemm */
|
|
#endif
|
|
#endif
|
|
.nbuffers = 3
|
|
.nbuffers = 3
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
+#ifdef USE_GORDON
|
|
|
|
+static const char *spu_func_sgemm_elf_file = "./gordon/func_sgemm_ibm.spuelf";
|
|
|
|
+static unsigned spu_func_sgemm_elf_id;
|
|
|
|
+static unsigned spu_func_sgemm_ibm_id;
|
|
|
|
+
|
|
|
|
+static void load_elf_sgemm(void)
|
|
|
|
+{
|
|
|
|
+ spu_func_sgemm_elf_id =
|
|
|
|
+ gordon_register_elf_plugin(spu_func_sgemm_elf_file);
|
|
|
|
+
|
|
|
|
+ spu_func_sgemm_ibm_id = gordon_register_kernel(spu_func_sgemm_elf_id, "func_sgemm_ibm");
|
|
|
|
+
|
|
|
|
+ gordon_load_plugin_on_all_spu(spu_func_sgemm_elf_id);
|
|
|
|
+ gordon_load_kernel_on_all_spu(spu_func_sgemm_ibm_id);
|
|
|
|
+
|
|
|
|
+ cl.gordon_func = spu_func_sgemm_ibm_id;
|
|
|
|
+}
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+
|
|
static void construct_task(unsigned x, unsigned y, unsigned z, unsigned iter, struct pos *posp)
|
|
static void construct_task(unsigned x, unsigned y, unsigned z, unsigned iter, struct pos *posp)
|
|
{
|
|
{
|
|
struct starpu_task *task;
|
|
struct starpu_task *task;
|
|
@@ -384,7 +406,7 @@ static void construct_task(unsigned x, unsigned y, unsigned z, unsigned iter, st
|
|
task->callback_arg = posp;
|
|
task->callback_arg = posp;
|
|
|
|
|
|
task->cl_arg = &conf;
|
|
task->cl_arg = &conf;
|
|
- task->cl_arg_size = sizeof(struct block_conf);
|
|
|
|
|
|
+ task->cl_arg_size = sizeof(struct ibm_sgemm_block_conf);
|
|
|
|
|
|
posp->z = z;
|
|
posp->z = z;
|
|
posp->iter = iter;
|
|
posp->iter = iter;
|
|
@@ -470,6 +492,10 @@ int main(__attribute__ ((unused)) int argc,
|
|
/* start the runtime */
|
|
/* start the runtime */
|
|
starpu_init(NULL);
|
|
starpu_init(NULL);
|
|
|
|
|
|
|
|
+#ifdef USE_GORDON
|
|
|
|
+ load_elf_sgemm();
|
|
|
|
+#endif
|
|
|
|
+
|
|
pthread_mutex_init(&mutex, NULL);
|
|
pthread_mutex_init(&mutex, NULL);
|
|
pthread_cond_init(&cond, NULL);
|
|
pthread_cond_init(&cond, NULL);
|
|
|
|
|