Mercurial > hg > Game > Cerium
view example/word_count/task_init.cc @ 1941:f19885ea776d draft
add wordcount for cuda. fix CudaScheduler. add makefile
author | Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 04 Feb 2014 02:18:07 +0900 |
parents | 53c074e60b08 |
children | 8fbe022126e1 |
line wrap: on
line source
#include "Func.h" #include "Scheduler.h" #ifdef __CERIUM_GPU__ #include "GpuScheduler.h" #endif #ifdef __CERIUM_CUDA__ #include "CudaScheduler.h" #endif /* 必ずこの位置に書いて */ SchedExternTask(Exec); SchedExternTask(Exec_Data_Parallel); SchedExternTask(Print); SchedExternTask(RUN_TASK_BLOCKS); /** * この関数は ../spe/spe-main と違って * 自分で呼び出せばいい関数なので * 好きな関数名でおk (SchedRegisterTask は必須) */ void task_init(void) { #ifdef __CERIUM_GPU__ GpuSchedRegister(TASK_EXEC, "gpu/Exec.cl", "wordcount"); GpuSchedRegister(TASK_EXEC_DATA_PARALLEL, "gpu/Exec_Data_Parallel.cl","wordcount_parallel"); #endif #ifdef __CERIUM_CUDA__ CudaSchedRegister(TASK_EXEC, "cuda/Exec.ptx", "wordcount"); CudaSchedRegister(TASK_EXEC_DATA_PARALLEL, "cuda/Exec_Data_Parallel.ptx","wordcount_parallel"); #endif SchedRegisterTask(TASK_EXEC, Exec); SchedRegisterTask(TASK_EXEC_DATA_PARALLEL, Exec_Data_Parallel); SchedRegisterTask(TASK_PRINT, Print); SchedRegister(RUN_TASK_BLOCKS); }