Browse Source

Make get_*_nth_implementation inlines, since they are called a lot while being extremely simple and completely internal

Samuel Thibault 11 years ago
parent
commit
967d336628
2 changed files with 30 additions and 38 deletions
  1. 0 30
      src/core/task.c
  2. 30 8
      src/core/task.h

+ 0 - 30
src/core/task.c

@@ -1049,21 +1049,6 @@ _starpu_handle_needs_conversion_task_for_arch(starpu_data_handle_t handle,
 	return -EINVAL;
 	return -EINVAL;
 }
 }
 
 
-starpu_cpu_func_t _starpu_task_get_cpu_nth_implementation(struct starpu_codelet *cl, unsigned nimpl)
-{
-	return cl->cpu_funcs[nimpl];
-}
-
-starpu_cuda_func_t _starpu_task_get_cuda_nth_implementation(struct starpu_codelet *cl, unsigned nimpl)
-{
-	return cl->cuda_funcs[nimpl];
-}
-
-starpu_opencl_func_t _starpu_task_get_opencl_nth_implementation(struct starpu_codelet *cl, unsigned nimpl)
-{
-	return cl->opencl_funcs[nimpl];
-}
-
 void starpu_task_set_implementation(struct starpu_task *task, unsigned impl)
 void starpu_task_set_implementation(struct starpu_task *task, unsigned impl)
 {
 {
 	_starpu_get_job_associated_to_task(task)->nimpl = impl;
 	_starpu_get_job_associated_to_task(task)->nimpl = impl;
@@ -1074,21 +1059,6 @@ unsigned starpu_task_get_implementation(struct starpu_task *task)
 	return _starpu_get_job_associated_to_task(task)->nimpl;
 	return _starpu_get_job_associated_to_task(task)->nimpl;
 }
 }
 
 
-starpu_mic_func_t _starpu_task_get_mic_nth_implementation(struct starpu_codelet *cl, unsigned nimpl)
-{
-	return cl->mic_funcs[nimpl];
-}
-
-starpu_scc_func_t _starpu_task_get_scc_nth_implementation(struct starpu_codelet *cl, unsigned nimpl)
-{
-	return cl->scc_funcs[nimpl];
-}
-
-char *_starpu_task_get_cpu_name_nth_implementation(struct starpu_codelet *cl, unsigned nimpl)
-{
-	return cl->cpu_funcs_name[nimpl];
-}
-
 static starpu_pthread_t watchdog_thread;
 static starpu_pthread_t watchdog_thread;
 
 
 /* Check from times to times that StarPU does finish some tasks */
 /* Check from times to times that StarPU does finish some tasks */

+ 30 - 8
src/core/task.h

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  *
- * Copyright (C) 2009-2013  Université de Bordeaux
+ * Copyright (C) 2009-2014  Université de Bordeaux
  * Copyright (C) 2010, 2011, 2013  Centre National de la Recherche Scientifique
  * Copyright (C) 2010, 2011, 2013  Centre National de la Recherche Scientifique
  * Copyright (C) 2011, 2014 INRIA
  * Copyright (C) 2011, 2014 INRIA
  *
  *
@@ -78,13 +78,35 @@ int _starpu_task_submit_conversion_task(struct starpu_task *task,
 void _starpu_task_check_deprecated_fields(struct starpu_task *task);
 void _starpu_task_check_deprecated_fields(struct starpu_task *task);
 void _starpu_codelet_check_deprecated_fields(struct starpu_codelet *cl);
 void _starpu_codelet_check_deprecated_fields(struct starpu_codelet *cl);
 
 
-starpu_cpu_func_t _starpu_task_get_cpu_nth_implementation(struct starpu_codelet *cl, unsigned nimpl);
-starpu_cuda_func_t _starpu_task_get_cuda_nth_implementation(struct starpu_codelet *cl, unsigned nimpl);
-starpu_opencl_func_t _starpu_task_get_opencl_nth_implementation(struct starpu_codelet *cl, unsigned nimpl);
-starpu_mic_func_t _starpu_task_get_mic_nth_implementation(struct starpu_codelet *cl, unsigned nimpl);
-starpu_scc_func_t _starpu_task_get_scc_nth_implementation(struct starpu_codelet *cl, unsigned nimpl);
-
-char *_starpu_task_get_cpu_name_nth_implementation(struct starpu_codelet *cl, unsigned nimpl);
+static inline starpu_cpu_func_t _starpu_task_get_cpu_nth_implementation(struct starpu_codelet *cl, unsigned nimpl)
+{
+	return cl->cpu_funcs[nimpl];
+}
+
+static inline starpu_cuda_func_t _starpu_task_get_cuda_nth_implementation(struct starpu_codelet *cl, unsigned nimpl)
+{
+	return cl->cuda_funcs[nimpl];
+}
+
+static inline starpu_opencl_func_t _starpu_task_get_opencl_nth_implementation(struct starpu_codelet *cl, unsigned nimpl)
+{
+	return cl->opencl_funcs[nimpl];
+}
+
+static inline starpu_mic_func_t _starpu_task_get_mic_nth_implementation(struct starpu_codelet *cl, unsigned nimpl)
+{
+	return cl->mic_funcs[nimpl];
+}
+
+static inline starpu_scc_func_t _starpu_task_get_scc_nth_implementation(struct starpu_codelet *cl, unsigned nimpl)
+{
+	return cl->scc_funcs[nimpl];
+}
+
+static inline char *_starpu_task_get_cpu_name_nth_implementation(struct starpu_codelet *cl, unsigned nimpl)
+{
+	return cl->cpu_funcs_name[nimpl];
+}
 
 
 #define _STARPU_TASK_SET_INTERFACE(task, interface, i) do { if (task->dyn_handles) task->dyn_interfaces[i] = interface; else task->interfaces[i] = interface;} while(0)
 #define _STARPU_TASK_SET_INTERFACE(task, interface, i) do { if (task->dyn_handles) task->dyn_interfaces[i] = interface; else task->interfaces[i] = interface;} while(0)
 #define _STARPU_TASK_GET_INTERFACES(task) ((task->dyn_handles) ? task->dyn_interfaces : task->interfaces)
 #define _STARPU_TASK_GET_INTERFACES(task) ((task->dyn_handles) ? task->dyn_interfaces : task->interfaces)