|
@@ -2,25 +2,21 @@
|
|
|
#include "piv-nodes.h"
|
|
|
|
|
|
void
|
|
|
-piv_ufo_base_init(struct piv_ufo_base *piv_base)
|
|
|
+piv_ufo_base_init (struct piv_ufo_base *piv_base)
|
|
|
{
|
|
|
piv_base->error = NULL;
|
|
|
|
|
|
piv_base->graph = UFO_TASK_GRAPH (ufo_task_graph_new ());
|
|
|
piv_base->manager = ufo_plugin_manager_new ();
|
|
|
piv_base->resources = ufo_resources_new (&piv_base->error);
|
|
|
+
|
|
|
if (piv_base->error)
|
|
|
- g_print("Error %s\n", piv_base->error->message);
|
|
|
- ufo_resources_add_path (piv_base->resources, "src/kernel/denoise");
|
|
|
- ufo_resources_add_path (piv_base->resources, "src/kernel/ordfilt");
|
|
|
- ufo_resources_add_path (piv_base->resources, "src/kernel/fft");
|
|
|
+ g_print ("Error %s\n", piv_base->error->message);
|
|
|
|
|
|
piv_base->scheduler = ufo_fixed_scheduler_new ();
|
|
|
- piv_base->arch = UFO_ARCH_GRAPH(ufo_arch_graph_new(piv_base->resources,
|
|
|
- NULL));
|
|
|
- piv_base->gpu_nodes = ufo_arch_graph_get_gpu_nodes(piv_base->arch);
|
|
|
- ufo_base_scheduler_set_gpu_nodes(piv_base->scheduler, piv_base->arch,
|
|
|
- piv_base->gpu_nodes);
|
|
|
+ piv_base->arch = UFO_ARCH_GRAPH (ufo_arch_graph_new (piv_base->resources, NULL));
|
|
|
+ piv_base->gpu_nodes = ufo_arch_graph_get_gpu_nodes (piv_base->arch);
|
|
|
+ ufo_base_scheduler_set_gpu_nodes (piv_base->scheduler, piv_base->arch, piv_base->gpu_nodes);
|
|
|
}
|
|
|
|
|
|
void piv_ufo_base_unref(struct piv_ufo_base *piv_base)
|
|
@@ -39,12 +35,15 @@ void piv_ufo_base_connect(struct piv_ufo_base *piv_base, struct piv_nodes *piv,
|
|
|
|
|
|
UfoTaskGraph *graph = piv_base->graph;
|
|
|
ufo_task_graph_connect_nodes (graph, global_reader, piv->broadcast_reader);
|
|
|
+
|
|
|
if (scale > 1) {
|
|
|
ufo_task_graph_connect_nodes (graph, piv->broadcast_reader, piv->reduce);
|
|
|
ufo_task_graph_connect_nodes (graph, piv->reduce, piv->denoise);
|
|
|
}
|
|
|
- else
|
|
|
+ else {
|
|
|
ufo_task_graph_connect_nodes (graph, piv->broadcast_reader, piv->denoise);
|
|
|
+ }
|
|
|
+
|
|
|
ufo_task_graph_connect_nodes (graph, piv->denoise, piv->contrast);
|
|
|
ufo_task_graph_connect_nodes (graph, piv->contrast, piv->broadcast_contrast);
|
|
|
ufo_task_graph_connect_nodes (graph, piv->broadcast_contrast, piv->fft);
|
|
@@ -52,43 +51,34 @@ void piv_ufo_base_connect(struct piv_ufo_base *piv_base, struct piv_nodes *piv,
|
|
|
|
|
|
ufo_task_graph_connect_nodes (graph, piv->ring_pattern, piv->ringfft);
|
|
|
ufo_task_graph_connect_nodes (graph, piv->ringfft, piv->loop_ringfft);
|
|
|
- //expand_graph(manager, gpu_nodes, duplicater, loop_ringfft, ringifft,
|
|
|
- // ring_start, ring_end, ring_step, piv_base->error, graph);
|
|
|
ufo_task_graph_connect_nodes_full (graph, piv->duplicater, piv->fftmult, 0);
|
|
|
ufo_task_graph_connect_nodes_full (graph, piv->loop_ringfft, piv->fftmult, 1);
|
|
|
|
|
|
- //expand_graph2 (manager, gpu_nodes, piv->fftmult, piv->filter_particle, "ringifft",
|
|
|
- // &piv_base->error, graph);
|
|
|
ufo_task_graph_connect_nodes (graph, piv->fftmult, piv->ringifft);
|
|
|
ufo_task_graph_connect_nodes (graph, piv->ringifft, piv->filter_particle);
|
|
|
ufo_task_graph_connect_nodes (graph, piv->filter_particle, piv->concatenate_result);
|
|
|
|
|
|
ufo_task_graph_connect_nodes (graph, piv->broadcast_contrast, piv->replicater);
|
|
|
|
|
|
- ufo_task_graph_connect_nodes_full (graph, piv->replicater,
|
|
|
- piv->multi_search, 0);
|
|
|
- ufo_task_graph_connect_nodes_full (graph, piv->concatenate_result,
|
|
|
- piv->multi_search, 1);
|
|
|
-
|
|
|
+ ufo_task_graph_connect_nodes_full (graph, piv->replicater, piv->multi_search, 0);
|
|
|
+ ufo_task_graph_connect_nodes_full (graph, piv->concatenate_result, piv->multi_search, 1);
|
|
|
|
|
|
ufo_task_graph_connect_nodes (graph, piv->multi_search, piv->remove_circle);
|
|
|
ufo_task_graph_connect_nodes (graph, piv->remove_circle, piv->get_dup_circ);
|
|
|
|
|
|
if (dump_ring_to_image) {
|
|
|
- ufo_task_graph_connect_nodes (graph, piv->broadcast_reader,
|
|
|
- piv->replicate_reader);
|
|
|
+ ufo_task_graph_connect_nodes (graph, piv->broadcast_reader, piv->replicate_reader);
|
|
|
+
|
|
|
// Hack required to silence ERROR message for dead lock
|
|
|
- ufo_task_graph_connect_nodes (graph, piv->replicate_reader,
|
|
|
- piv->copy_replicater);
|
|
|
- ufo_task_graph_connect_nodes_full (graph, piv->copy_replicater,
|
|
|
- piv->dump_ring, 0);
|
|
|
- ufo_task_graph_connect_nodes_full (graph, piv->get_dup_circ,
|
|
|
- piv->dump_ring, 1);
|
|
|
+ ufo_task_graph_connect_nodes (graph, piv->replicate_reader, piv->copy_replicater);
|
|
|
+ ufo_task_graph_connect_nodes_full (graph, piv->copy_replicater, piv->dump_ring, 0);
|
|
|
+ ufo_task_graph_connect_nodes_full (graph, piv->get_dup_circ, piv->dump_ring, 1);
|
|
|
|
|
|
ufo_task_graph_connect_nodes (graph, piv->dump_ring, piv->writer);
|
|
|
}
|
|
|
- else
|
|
|
+ else {
|
|
|
ufo_task_graph_connect_nodes (graph, piv->get_dup_circ, piv->ringwriter);
|
|
|
+ }
|
|
|
|
|
|
if (piv_base->error)
|
|
|
g_print("Error %s\n", piv_base->error->message);
|