|
|
@@ -36,7 +36,7 @@
|
|
|
#define PERTURBATE(a) (a)
|
|
|
#endif
|
|
|
|
|
|
-static double cpu_chol_task_11_cost(struct starpu_task *task, struct starpu_perfmodel_arch* arch, unsigned nimpl)
|
|
|
+double cpu_chol_task_11_cost(struct starpu_task *task, struct starpu_perfmodel_arch* arch, unsigned nimpl)
|
|
|
{
|
|
|
uint32_t n;
|
|
|
|
|
|
@@ -51,7 +51,7 @@ static double cpu_chol_task_11_cost(struct starpu_task *task, struct starpu_perf
|
|
|
return PERTURBATE(cost);
|
|
|
}
|
|
|
|
|
|
-static double cuda_chol_task_11_cost(struct starpu_task *task, struct starpu_perfmodel_arch* arch, unsigned nimpl)
|
|
|
+double cuda_chol_task_11_cost(struct starpu_task *task, struct starpu_perfmodel_arch* arch, unsigned nimpl)
|
|
|
{
|
|
|
uint32_t n;
|
|
|
|
|
|
@@ -66,7 +66,7 @@ static double cuda_chol_task_11_cost(struct starpu_task *task, struct starpu_per
|
|
|
return PERTURBATE(cost);
|
|
|
}
|
|
|
|
|
|
-static double cpu_chol_task_21_cost(struct starpu_task *task, struct starpu_perfmodel_arch* arch, unsigned nimpl)
|
|
|
+double cpu_chol_task_21_cost(struct starpu_task *task, struct starpu_perfmodel_arch* arch, unsigned nimpl)
|
|
|
{
|
|
|
uint32_t n;
|
|
|
|
|
|
@@ -81,7 +81,7 @@ static double cpu_chol_task_21_cost(struct starpu_task *task, struct starpu_perf
|
|
|
return PERTURBATE(cost);
|
|
|
}
|
|
|
|
|
|
-static double cuda_chol_task_21_cost(struct starpu_task *task, struct starpu_perfmodel_arch* arch, unsigned nimpl)
|
|
|
+double cuda_chol_task_21_cost(struct starpu_task *task, struct starpu_perfmodel_arch* arch, unsigned nimpl)
|
|
|
{
|
|
|
uint32_t n;
|
|
|
|
|
|
@@ -96,7 +96,7 @@ static double cuda_chol_task_21_cost(struct starpu_task *task, struct starpu_per
|
|
|
return PERTURBATE(cost);
|
|
|
}
|
|
|
|
|
|
-static double cpu_chol_task_22_cost(struct starpu_task *task, struct starpu_perfmodel_arch* arch, unsigned nimpl)
|
|
|
+double cpu_chol_task_22_cost(struct starpu_task *task, struct starpu_perfmodel_arch* arch, unsigned nimpl)
|
|
|
{
|
|
|
uint32_t n;
|
|
|
|
|
|
@@ -111,7 +111,7 @@ static double cpu_chol_task_22_cost(struct starpu_task *task, struct starpu_perf
|
|
|
return PERTURBATE(cost);
|
|
|
}
|
|
|
|
|
|
-static double cuda_chol_task_22_cost(struct starpu_task *task, struct starpu_perfmodel_arch* arch, unsigned nimpl)
|
|
|
+double cuda_chol_task_22_cost(struct starpu_task *task, struct starpu_perfmodel_arch* arch, unsigned nimpl)
|
|
|
{
|
|
|
uint32_t n;
|
|
|
|
|
|
@@ -126,63 +126,14 @@ static double cuda_chol_task_22_cost(struct starpu_task *task, struct starpu_per
|
|
|
return PERTURBATE(cost);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-void initialize_chol_model(struct starpu_perfmodel* model, int i)
|
|
|
+void initialize_chol_model(struct starpu_perfmodel* model, char * symbol,
|
|
|
+ double (*cpu_cost_function)(struct starpu_task *, struct starpu_perfmodel_arch*, unsigned),
|
|
|
+ double (*cuda_cost_function)(struct starpu_task *, struct starpu_perfmodel_arch*, unsigned))
|
|
|
{
|
|
|
intialize_model(model);
|
|
|
model.type = STARPU_HISTORY_BASED;
|
|
|
- switch(i)
|
|
|
- {
|
|
|
- case(11):
|
|
|
- model.per_arch[STARPU_CPU_WORKER][0][0][0] = { .cost_function = cpu_chol_task_11_cost };
|
|
|
- model.per_arch[STARPU_CUDA_WORKER][0][0][0] = { .cost_function = cuda_chol_task_11_cost };
|
|
|
- model.symbol = "chol_model_11";
|
|
|
- break;
|
|
|
- case(21):
|
|
|
- model.per_arch[STARPU_CPU_WORKER][0][0][0] = { .cost_function = cpu_chol_task_21_cost };
|
|
|
- model.per_arch[STARPU_CUDA_WORKER][0][0][0] = { .cost_function = cuda_chol_task_21_cost };
|
|
|
- model.symbol = "chol_model_21";
|
|
|
- break;
|
|
|
- case(22):
|
|
|
- model.per_arch[STARPU_CPU_WORKER][0][0][0] = { .cost_function = cpu_chol_task_22_cost };
|
|
|
- model.per_arch[STARPU_CUDA_WORKER][0][0][0] = { .cost_function = cuda_chol_task_22_cost };
|
|
|
- model.symbol = "chol_model_22";
|
|
|
- break;
|
|
|
- default:
|
|
|
- STARPU_ABORT();
|
|
|
- break;
|
|
|
- }
|
|
|
+ model.symbol = symbol;
|
|
|
+ model.per_arch[STARPU_CPU_WORKER][0][0][0].cost_function = cpu_cost_function;
|
|
|
+ model.per_arch[STARPU_CUDA_WORKER][0][0][0].cost_function = cuda_cost_function;
|
|
|
}
|
|
|
-/*
|
|
|
-struct starpu_perfmodel chol_model_11 =
|
|
|
-{
|
|
|
- .per_arch =
|
|
|
- {
|
|
|
- [STARPU_CPU_DEFAULT][0] = { .cost_function = cpu_chol_task_11_cost },
|
|
|
- [STARPU_CUDA_DEFAULT][0] = { .cost_function = cuda_chol_task_11_cost }
|
|
|
- },
|
|
|
- .type = STARPU_HISTORY_BASED,
|
|
|
- .symbol = "chol_model_11"
|
|
|
-};
|
|
|
-
|
|
|
-struct starpu_perfmodel chol_model_21 =
|
|
|
-{
|
|
|
- .per_arch =
|
|
|
- {
|
|
|
- [STARPU_CPU_DEFAULT][0] = { .cost_function = cpu_chol_task_21_cost },
|
|
|
- [STARPU_CUDA_DEFAULT][0] = { .cost_function = cuda_chol_task_21_cost }
|
|
|
- },
|
|
|
- .type = STARPU_HISTORY_BASED,
|
|
|
- .symbol = "chol_model_21"
|
|
|
-};
|
|
|
-
|
|
|
-struct starpu_perfmodel chol_model_22 =
|
|
|
-{
|
|
|
- .per_arch =
|
|
|
- {
|
|
|
- [STARPU_CPU_DEFAULT][0] = { .cost_function = cpu_chol_task_22_cost },
|
|
|
- [STARPU_CUDA_DEFAULT][0] = { .cost_function = cuda_chol_task_22_cost }
|
|
|
- },
|
|
|
- .type = STARPU_HISTORY_BASED,
|
|
|
- .symbol = "chol_model_22"
|
|
|
-};*/
|
|
|
+
|