11 #include <starpu_opencl.h>
19 #include <OpenCL/opencl.h>
36 #define MAX_REDUCE_PART 10
59 template <
typename ReduceFunc,
typename T>
65 starpu_data_handle_t scalar_result_handle;
68 Reduce(ReduceFunc* reduceFunc);
79 starpu_data_unregister(scalar_result_handle);
80 isScalarStarPU =
false;
92 void setOutput(T *out)
95 starpu_data_acquire(scalar_result_handle, STARPU_W);
100 starpu_data_release(scalar_result_handle);
108 starpu_data_acquire(scalar_result_handle, STARPU_R);
110 starpu_data_release(scalar_result_handle);
118 void finishAll() {m_environment->
finishAll();}
119 void setExecPlan(
ExecPlan& plan) {m_execPlan = plan;}
123 ReduceFunc* m_reduceFunc;
126 #ifdef USE_STARPU_HISTORY_MODEL
127 starpu_perfmodel *red_perf_model;
130 struct starpu_codelet *codelet;
133 struct starpu_codelet *codelet2;
142 static void cpu_func(
void *buffers[],
void *arg);
146 static void omp_func(
void *buffers[],
void *arg);
151 static void cuda_func(
void *buffers[],
void *arg);
156 static void opencl_func(
void *buffers[],
void *arg);
159 struct starpu_opencl_program opencl_codelet;
162 char kernelNameArray[1028];
164 void replaceText(std::string& text, std::string find, std::string replace);
169 std::string perfmodel_str;
static void opencl_func(void *buffers[], void *arg)
Definition: reduce_cl.inl:92
Reduce(ReduceFunc *reduceFunc)
Definition: reduce.inl:19
Includes the macro files needed for the defined backends.
Contains the definitions of OpenMP specific functions for the Reduce skeleton.
void finishAll()
Definition: environment.inl:119
void replaceText(std::string &text, std::string find, std::string replace)
Definition: reduce_cl.inl:26
void createOpenCLProgram()
Definition: reduce_cl.inl:47
Contains the definitions of CPU specific functions for the Reduce skeleton.
Contains a class declaration for the object that represents an OpenCL device.
static void omp_func(void *buffers[], void *arg)
Definition: reduce_omp.inl:27
Contains the definitions of non-backend specific functions for the Reduce skeleton.
Contains the definitions of CUDA specific functions for the Reduce skeleton.
A vector container class, implemented as a wrapper for std::vector. It is configured to use StarPU DS...
Definition: vector.h:40
~Reduce()
Definition: reduce.inl:209
A class that describes an execution plan, not used very much in this case as decision is mostly left ...
Definition: exec_plan.h:75
Contains a class definition for Task.
A class representing a Task for the farm skeleton.
Definition: task.h:31
Contains a class declaration for the Vector container.
A class representing the Reduce skeleton.
Definition: reduce.h:60
Contains a class declaration for Environment class.
static void cuda_func(void *buffers[], void *arg)
Definition: reduce_cu.inl:27
static void cpu_func(void *buffers[], void *arg)
Definition: reduce_cpu.inl:21
void run_async()
Definition: reduce.inl:237
T operator()(Vector< T > &input)
Definition: reduce.inl:260
Contains a class that stores information about which back ends to use when executing.
Contains the definitions of OpenCL specific functions for the Reduce skeleton.