Explorar el Código

Do not forget to display the OpenCL drivers in the FxT trace.

Cédric Augonnet hace 15 años
padre
commit
f1f038ed56
Se han modificado 4 ficheros con 15 adiciones y 2 borrados
  1. 1 0
      src/common/fxt.h
  2. 4 2
      src/drivers/opencl/driver_opencl.c
  3. 3 0
      tools/fxt_tool.c
  4. 7 0
      tools/fxt_tool_common.c

+ 1 - 0
src/common/fxt.h

@@ -34,6 +34,7 @@
 #define STARPU_FUT_APPS_KEY	0x100
 #define STARPU_FUT_CPU_KEY	0x101
 #define STARPU_FUT_CUDA_KEY	0x102
+#define STARPU_FUT_OPENCL_KEY	0x103
 
 #define STARPU_FUT_WORKER_INIT_START	0x5133
 #define STARPU_FUT_WORKER_INIT_END	0x5134

+ 4 - 2
src/drivers/opencl/driver_opencl.c

@@ -194,9 +194,12 @@ void *_starpu_opencl_worker(void *arg)
 	fxt_register_thread(args->bindid);
 #endif
 
+	unsigned memnode = args->memory_node;
+	STARPU_TRACE_WORKER_INIT_START(STARPU_FUT_OPENCL_KEY, memnode);
+
 	_starpu_bind_thread_on_cpu(args->config, args->bindid);
 
-	_starpu_set_local_memory_node_key(&(args->memory_node));
+	_starpu_set_local_memory_node_key(&memnode);
 
 	_starpu_set_local_queue(jobq);
 
@@ -229,7 +232,6 @@ void *_starpu_opencl_worker(void *arg)
 
 	struct starpu_sched_policy_s *policy = _starpu_get_sched_policy();
 	struct starpu_jobq_s *queue = policy->starpu_get_local_queue(policy);
-	unsigned memnode = args->memory_node;
 
 	while (_starpu_machine_is_running())
 	{

+ 3 - 0
tools/fxt_tool.c

@@ -196,6 +196,9 @@ static void handle_worker_init_start(void)
 		case STARPU_FUT_CUDA_KEY:
 			set_next_cuda_worker_color(workerid);
 			break;
+		case STARPU_FUT_OPENCL_KEY:
+			set_next_opencl_worker_color(workerid);
+			break;
 		default:
 			STARPU_ABORT();
 	}

+ 7 - 0
tools/fxt_tool_common.c

@@ -18,9 +18,11 @@
 
 static char *cpus_worker_colors[MAXWORKERS] = {"/greens9/7", "/greens9/6", "/greens9/5", "/greens9/4",  "/greens9/9", "/greens9/3",  "/greens9/2",  "/greens9/1"  };
 static char *cuda_worker_colors[MAXWORKERS] = {"/ylorrd9/9", "/ylorrd9/6", "/ylorrd9/3", "/ylorrd9/1", "/ylorrd9/8", "/ylorrd9/7", "/ylorrd9/4", "/ylorrd9/2",  "/ylorrd9/1"};
+static char *opencl_worker_colors[MAXWORKERS] = {"/blues9/9", "/blues9/6", "/blues9/3", "/blues9/1", "/blues9/8", "/blues9/7", "/blues9/4", "/blues9/2",  "/blues9/1"};
 static char *other_worker_colors[MAXWORKERS] = {"/greys9/9", "/greys9/8", "/greys9/7", "/greys9/6"};
 static char *worker_colors[MAXWORKERS];
 
+static unsigned opencl_index = 0;
 static unsigned cuda_index = 0;
 static unsigned cpus_index = 0;
 static unsigned other_index = 0;
@@ -40,6 +42,11 @@ void set_next_cuda_worker_color(int workerid)
 	worker_colors[workerid] = cuda_worker_colors[cuda_index++];
 }
 
+void set_next_opencl_worker_color(int workerid)
+{
+	worker_colors[workerid] = opencl_worker_colors[opencl_index++];
+}
+
 const char *get_worker_color(int workerid)
 {
 	return worker_colors[workerid];