summaryrefslogtreecommitdiff
path: root/ufo
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2016-10-26 12:28:57 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2016-10-26 12:28:57 +0200
commit20f716c309cc4ca716303713990567ad94ed09fd (patch)
tree139775e1c70e98a5ae93ea1e16e37445b93d52ce /ufo
parent8a6d34ac24dad1f635d7a98d44b2bc3af8b21e28 (diff)
Unify debug message output format
Diffstat (limited to 'ufo')
-rw-r--r--ufo/ufo-buffer.c6
-rw-r--r--ufo/ufo-gpu-node.c2
-rwxr-xr-xufo/ufo-plugin-manager.c4
-rw-r--r--ufo/ufo-resources.c33
-rwxr-xr-xufo/ufo-task-graph.c10
5 files changed, 32 insertions, 23 deletions
diff --git a/ufo/ufo-buffer.c b/ufo/ufo-buffer.c
index f7f9f40..853cd54 100644
--- a/ufo/ufo-buffer.c
+++ b/ufo/ufo-buffer.c
@@ -158,7 +158,7 @@ alloc_device_array (UfoBufferPrivate *priv)
UFO_RESOURCES_CHECK_CLERR (clReleaseMemObject (priv->device_array));
mem = clCreateBuffer (priv->context, CL_MEM_READ_WRITE, priv->size, NULL, &err);
- g_debug ("Allocated %p [size=%3.2f MB, type=buffer]", (gpointer) mem, priv->size / 1024. / 1024.);
+ g_debug ("ALOC %p [size=%3.2f MB, type=buffer]", (gpointer) mem, priv->size / 1024. / 1024.);
UFO_RESOURCES_CHECK_CLERR (err);
priv->device_array = mem;
@@ -234,11 +234,11 @@ alloc_device_image (UfoBufferPrivate *priv)
if (priv->requisition.n_dims == 2) {
mem = clCreateImage2D (priv->context, flags, &format, width, height, 0, NULL, &err);
- g_debug ("Allocated %p [size=%3.2f MB, type=2D image]", (gpointer) mem, width * height * 4 / 1024. / 1024.);
+ g_debug ("ALOC %p [size=%3.2f MB, type=2D image]", (gpointer) mem, width * height * 4 / 1024. / 1024.);
}
else if (priv->requisition.n_dims == 3) {
mem = clCreateImage3D (priv->context, flags, &format, width, height, depth, 0, 0, NULL, &err);
- g_debug ("Allocated %p [size=%3.2f MB, type=3D image]", (gpointer) mem, width * height * depth * 4 / 1024. / 1024.);
+ g_debug ("ALOC %p [size=%3.2f MB, type=3D image]", (gpointer) mem, width * height * depth * 4 / 1024. / 1024.);
}
UFO_RESOURCES_CHECK_CLERR (err);
diff --git a/ufo/ufo-gpu-node.c b/ufo/ufo-gpu-node.c
index 5463c63..644a69d 100644
--- a/ufo/ufo-gpu-node.c
+++ b/ufo/ufo-gpu-node.c
@@ -150,7 +150,7 @@ ufo_gpu_node_finalize (GObject *object)
priv = UFO_GPU_NODE_GET_PRIVATE (object);
if (priv->cmd_queue != NULL) {
- g_debug ("Release cmd_queue=%p", (gpointer) priv->cmd_queue);
+ g_debug ("FREE cmd_queue=%p", (gpointer) priv->cmd_queue);
UFO_RESOURCES_CHECK_CLERR (clReleaseCommandQueue (priv->cmd_queue));
priv->cmd_queue = NULL;
diff --git a/ufo/ufo-plugin-manager.c b/ufo/ufo-plugin-manager.c
index 42c3c98..2f51865 100755
--- a/ufo/ufo-plugin-manager.c
+++ b/ufo/ufo-plugin-manager.c
@@ -328,7 +328,7 @@ ufo_plugin_manager_get_task (UfoPluginManager *manager, const gchar *name, GErro
g_free (func_name);
g_free (module_name);
- g_debug ("UfoPluginManager: Created %s-%p", name, (gpointer) node);
+ g_debug ("NEW %s", ufo_task_node_get_identifier (node));
return node;
}
@@ -365,7 +365,7 @@ ufo_plugin_manager_get_task_from_package (UfoPluginManager *manager,
g_free (func_name);
g_free (so_name);
- g_debug ("UfoPluginManager: Created %s-%p", name, (gpointer) node);
+ g_debug ("NEW %s", ufo_task_node_get_identifier (node));
return node;
}
diff --git a/ufo/ufo-resources.c b/ufo/ufo-resources.c
index 3731ffa..ba736a2 100644
--- a/ufo/ufo-resources.c
+++ b/ufo/ufo-resources.c
@@ -213,14 +213,14 @@ read_file (const gchar *filename)
static void
release_kernel (cl_kernel kernel)
{
- g_debug ("Release kernel=%p", (gpointer) kernel);
+ g_debug ("FREE kernel=%p", (gpointer) kernel);
UFO_RESOURCES_CHECK_CLERR (clReleaseKernel (kernel));
}
static void
release_program (cl_program program)
{
- g_debug ("Release program=%p", (gpointer) program);
+ g_debug ("FREE program=%p", (gpointer) program);
UFO_RESOURCES_CHECK_CLERR (clReleaseProgram (program));
}
@@ -279,7 +279,7 @@ get_preferably_gpu_based_platform (UfoResourcesPrivate *priv)
platforms = g_malloc0 (n_platforms * sizeof (cl_platform_id));
UFO_RESOURCES_CHECK_CLERR (clGetPlatformIDs (n_platforms, platforms, NULL));
- g_debug ("Found %i OpenCL platforms %i", n_platforms, priv->platform_index);
+ g_debug ("INFO found %i OpenCL platforms %i", n_platforms, priv->platform_index);
/* Check if user set a preferred platform */
if (priv->platform_index >= 0 && priv->platform_index < (gint) n_platforms) {
@@ -400,8 +400,6 @@ initialize_opencl (UfoResourcesPrivate *priv)
errcode = clGetDeviceIDs (priv->platform, device_type, 0, NULL, &priv->n_devices);
UFO_RESOURCES_CHECK_AND_SET (errcode, &priv->construct_error);
- g_debug ("Platform `%p' has %i device(s)", (gpointer) priv->platform, priv->n_devices);
-
if (errcode != CL_SUCCESS)
return FALSE;
@@ -414,7 +412,6 @@ initialize_opencl (UfoResourcesPrivate *priv)
return FALSE;
restrict_to_gpu_subset (priv);
- g_debug ("Using %i device(s):", priv->n_devices);
for (guint i = 0; i < priv->n_devices; i++) {
size_t size;
@@ -424,7 +421,6 @@ initialize_opencl (UfoResourcesPrivate *priv)
name = g_malloc0 (size);
UFO_RESOURCES_CHECK_CLERR (clGetDeviceInfo (priv->devices[i], CL_DEVICE_NAME, size, name, NULL));
- g_debug(" Device %i: %s", i, name);
g_free (name);
}
@@ -437,7 +433,20 @@ initialize_opencl (UfoResourcesPrivate *priv)
priv->gpu_nodes = NULL;
for (guint i = 0; i < priv->n_devices; i++) {
- priv->gpu_nodes = g_list_append (priv->gpu_nodes, ufo_gpu_node_new (priv->context, priv->devices[i]));
+ UfoGpuNode *node;
+ size_t size;
+ gchar *name;
+
+ node = UFO_GPU_NODE (ufo_gpu_node_new (priv->context, priv->devices[i]));
+
+ UFO_RESOURCES_CHECK_CLERR (clGetDeviceInfo (priv->devices[i], CL_DEVICE_NAME, 0, NULL, &size));
+ name = g_malloc0 (size);
+
+ UFO_RESOURCES_CHECK_CLERR (clGetDeviceInfo (priv->devices[i], CL_DEVICE_NAME, size, name, NULL));
+
+ g_debug("NEW UfoGpuNode-%p [device=%s]", (gpointer) node, name);
+ priv->gpu_nodes = g_list_append (priv->gpu_nodes, node);
+ g_free (name);
}
return TRUE;
@@ -577,7 +586,7 @@ add_program_from_source (UfoResourcesPrivate *priv,
NULL, NULL);
g_timer_stop (timer);
- g_debug ("Built with `%s' in %3.5fs", build_options, g_timer_elapsed (timer, NULL));
+ g_debug ("INFO Built with `%s' in %3.5fs", build_options, g_timer_elapsed (timer, NULL));
g_timer_destroy (timer);
if (errcode != CL_SUCCESS) {
@@ -714,7 +723,7 @@ ufo_resources_get_kernel_with_opts (UfoResources *resources,
if (program == NULL)
goto exit;
- g_debug ("Compiled `%s' kernel from %s", kernel_name, path);
+ g_debug ("INFO Compiled `%s' kernel from %s", kernel_name, path);
kernel = create_kernel (priv, program, kernel_name, error);
exit:
@@ -827,7 +836,7 @@ ufo_resources_get_kernel_from_source (UfoResources *resources,
if (program == NULL)
return NULL;
- g_debug ("Added program %p from source", (gpointer) program);
+ g_debug ("INFO Added program %p from source", (gpointer) program);
return create_kernel (priv, program, kernel, error);
}
@@ -1042,7 +1051,7 @@ ufo_resources_finalize (GObject *object)
g_hash_table_destroy (priv->programs);
if (priv->context) {
- g_debug ("Release context=%p", (gpointer) priv->context);
+ g_debug ("FREE context=%p", (gpointer) priv->context);
UFO_RESOURCES_CHECK_CLERR (clReleaseContext (priv->context));
}
diff --git a/ufo/ufo-task-graph.c b/ufo/ufo-task-graph.c
index 179edd4..20e16eb 100755
--- a/ufo/ufo-task-graph.c
+++ b/ufo/ufo-task-graph.c
@@ -468,14 +468,14 @@ ufo_task_graph_expand (UfoTaskGraph *task_graph,
n_remotes = g_list_length (remotes);
if (n_remotes > 0) {
- g_debug ("Expand for %i remote nodes", n_remotes);
+ g_debug ("INFO Expand for %i remote nodes", n_remotes);
expand_remotes (task_graph, remotes, path);
}
g_list_free (remotes);
}
- g_debug ("Expand for %i GPU nodes", n_gpus);
+ g_debug ("INFO Expand for %i GPU nodes", n_gpus);
for (guint i = 1; i < n_gpus; i++)
ufo_graph_expand (UFO_GRAPH (task_graph), path);
@@ -513,9 +513,8 @@ map_proc_node (UfoGraph *graph,
if ((ufo_task_uses_gpu (UFO_TASK (node)) || UFO_IS_INPUT_TASK (node)) &&
(!ufo_task_node_get_proc_node (UFO_TASK_NODE (node)))) {
- g_debug ("Mapping UfoGpuNode-%p to %s-%p",
- (gpointer) proc_node,
- G_OBJECT_TYPE_NAME (node), (gpointer) node);
+ g_debug ("MAP UfoGpuNode-%p -> %s",
+ (gpointer) proc_node, ufo_task_node_get_identifier (UFO_TASK_NODE (node)));
ufo_task_node_set_proc_node (UFO_TASK_NODE (node), proc_node);
}
@@ -658,6 +657,7 @@ ufo_task_graph_connect_nodes_full (UfoTaskGraph *graph,
UfoTaskNode *n2,
guint input)
{
+ g_debug ("CONN %s -> %s [input=%i]", ufo_task_node_get_identifier (n1), ufo_task_node_get_identifier (n2), input);
ufo_graph_connect_nodes (UFO_GRAPH (graph), UFO_NODE (n1), UFO_NODE (n2), GINT_TO_POINTER (input));
}