[gegl] gegl: added command line options for OpenCL and file backend queue limit configuration settings
- From: Ville Sokk <villesokk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] gegl: added command line options for OpenCL and file backend queue limit configuration settings
- Date: Tue, 14 Aug 2012 09:57:31 +0000 (UTC)
commit a2304529ac7dc621d90bc61b8433c0ff800e14f7
Author: Ville Sokk <ville sokk gmail com>
Date: Tue Aug 14 12:56:01 2012 +0300
gegl: added command line options for OpenCL and file backend queue limit configuration settings
gegl/gegl-config.c | 2 +-
gegl/gegl-init.c | 31 ++++++++++++++++++++++++-------
2 files changed, 25 insertions(+), 8 deletions(-)
---
diff --git a/gegl/gegl-config.c b/gegl/gegl-config.c
index 92d4753..290d7f0 100644
--- a/gegl/gegl-config.c
+++ b/gegl/gegl-config.c
@@ -296,7 +296,7 @@ gegl_config_class_init (GeglConfigClass *klass)
g_param_spec_int ("queue-limit",
"Queue limit",
"Maximum number of entries in the file tile backend's writer queue",
- 1, G_MAXINT, 1000,
+ 2, G_MAXINT, 1000,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
}
diff --git a/gegl/gegl-init.c b/gegl/gegl-init.c
index 74dbe3d..f75bad8 100644
--- a/gegl/gegl-init.c
+++ b/gegl/gegl-init.c
@@ -187,13 +187,15 @@ gegl_init (gint *argc,
g_option_context_free (context);
}
-static gchar *cmd_gegl_swap = NULL;
-static gchar *cmd_gegl_cache_size = NULL;
-static gchar *cmd_gegl_chunk_size = NULL;
-static gchar *cmd_gegl_quality = NULL;
-static gchar *cmd_gegl_tile_size = NULL;
-static gchar *cmd_babl_tolerance = NULL;
-static gchar *cmd_gegl_threads = NULL;
+static gchar *cmd_gegl_swap = NULL;
+static gchar *cmd_gegl_cache_size = NULL;
+static gchar *cmd_gegl_chunk_size = NULL;
+static gchar *cmd_gegl_quality = NULL;
+static gchar *cmd_gegl_tile_size = NULL;
+static gchar *cmd_babl_tolerance = NULL;
+static gchar *cmd_gegl_threads = NULL;
+static gboolean *cmd_gegl_opencl = NULL;
+static gint *cmd_gegl_queue_limit = NULL;
static const GOptionEntry cmd_entries[]=
{
@@ -232,6 +234,16 @@ static const GOptionEntry cmd_entries[]=
G_OPTION_ARG_STRING, &cmd_gegl_threads,
N_("The number of concurrent processing threads to use"), "<threads>"
},
+ {
+ "gegl-use-opencl", 0, 0,
+ G_OPTION_ARG_NONE, &cmd_gegl_opencl,
+ N_("Use OpenCL"), NULL
+ },
+ {
+ "gegl-queue-limit", 0, 0,
+ G_OPTION_ARG_INT, &cmd_gegl_queue_limit,
+ N_("Maximum number of entries in the file tile backend's writer queue"), "<count>"
+ },
{ NULL }
};
@@ -481,6 +493,11 @@ gegl_post_parse_hook (GOptionContext *context,
config->threads = atoi (cmd_gegl_threads);
if (cmd_babl_tolerance)
g_object_set (config, "babl-tolerance", atof(cmd_babl_tolerance), NULL);
+ /* don't override the environment variable */
+ if (g_getenv ("GEGL_USE_OPENCL") == NULL && cmd_gegl_opencl)
+ g_object_set (config, "use-opencl", cmd_gegl_opencl, NULL);
+ if (cmd_gegl_queue_limit)
+ g_object_set (config, "queue-limit", cmd_gegl_queue_limit, NULL);
#ifdef GEGL_ENABLE_DEBUG
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]