diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2017-08-28 15:00:22 +0200 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2017-08-28 15:16:46 +0200 |
commit | 3a320223826399699f27fabfb501b92bbda35f09 (patch) | |
tree | 93388f31d9c7ed495f5407134916fc374904758c /ufo/ufo-resources.c | |
parent | 4c39d85b5b42faa67b8abe6bfdb331147c4dec14 (diff) |
Fix #119: compile with device-specific flags
Diffstat (limited to 'ufo/ufo-resources.c')
-rw-r--r-- | ufo/ufo-resources.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/ufo/ufo-resources.c b/ufo/ufo-resources.c index a13e842..0db2ce4 100644 --- a/ufo/ufo-resources.c +++ b/ufo/ufo-resources.c @@ -599,26 +599,26 @@ add_program_from_source (UfoResourcesPrivate *priv, return NULL; } - build_options = get_device_build_options (priv, 0, options); timer = g_timer_new (); - errcode = clBuildProgram (program, - priv->n_devices, priv->devices, - build_options, - NULL, NULL); + for (guint i = 0; i < priv->n_devices; i++) { + build_options = get_device_build_options (priv, i, options); + errcode = clBuildProgram (program, 1, &priv->devices[i], build_options, NULL, NULL); - g_timer_stop (timer); - g_debug ("INFO Built with `%s' in %3.5fs", build_options, g_timer_elapsed (timer, NULL)); - g_timer_destroy (timer); + if (errcode != CL_SUCCESS) { + handle_build_error (program, priv->devices[0], errcode, error); + return NULL; + } - if (errcode != CL_SUCCESS) { - handle_build_error (program, priv->devices[0], errcode, error); - return NULL; + g_free (build_options); } + g_timer_stop (timer); + g_debug ("INFO Built with `%s%s' for %i devices in %3.5fs", priv->build_opts->str, options, priv->n_devices, g_timer_elapsed (timer, NULL)); + g_timer_destroy (timer); + g_hash_table_insert (priv->programs, g_strdup (source), program); - g_free (build_options); return program; } |