Browse Source

followup to simplify perfmodel API

Nathalie Furmento 9 years ago
parent
commit
fa4120aa82

+ 2 - 2
tests/perfmodels/memory.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2014  CNRS
+ * Copyright (C) 2014, 2015  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -50,7 +50,7 @@ int main(int argc, char **argv)
 	if (ret == -ENODEV) return STARPU_TEST_SKIPPED;
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
-	starpu_perfmodel_init(NULL, &my_model);
+	starpu_perfmodel_init(&my_model);
 	starpu_perfmodel_set_per_devices_cost_function(&my_model, 0, cuda_cost_function, STARPU_CUDA_WORKER, 0, 1, -1);
 
 	ret = starpu_task_insert(&my_codelet, 0);

+ 7 - 2
tests/perfmodels/valid_model.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2012, 2013, 2014  CNRS
+ * Copyright (C) 2012, 2013, 2014, 2015  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -102,7 +102,12 @@ static int submit(struct starpu_codelet *codelet, struct starpu_perfmodel *model
 	// We need to call starpu_init again to initialise values used by perfmodels
 	ret = starpu_init(NULL);
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
-	ret = starpu_perfmodel_load_symbol(codelet->model->symbol, &lmodel);
+
+	char path[256];
+	starpu_perfmodel_get_model_path(codelet->model->symbol, path, 256);
+	FPRINTF(stderr, "Perfmodel File <%s>\n", path);
+	ret = starpu_perfmodel_load_file(path, &lmodel);
+
 	if (ret == 1)
 	{
 		FPRINTF(stderr, "The performance model for the symbol <%s> could not be loaded\n", codelet->model->symbol);

+ 2 - 2
tests/sched_policies/simple_cpu_gpu_sched.c

@@ -121,8 +121,8 @@ init_perfmodels(void)
 {
 	unsigned devid, ncore;
 
-	starpu_perfmodel_init(NULL, &model_cpu_task);
-	starpu_perfmodel_init(NULL, &model_gpu_task);
+	starpu_perfmodel_init(&model_cpu_task);
+	starpu_perfmodel_init(&model_gpu_task);
 
 	starpu_perfmodel_set_per_devices_cost_function(&model_cpu_task, 0, cpu_task_cpu, STARPU_CPU_WORKER, 0, 1, -1);
 	starpu_perfmodel_set_per_devices_cost_function(&model_gpu_task, 0, gpu_task_cpu, STARPU_CPU_WORKER, 0, 1, -1);