[gegl] testing system for opencl



commit 978210e4944e900c293400e7cf5ea45160067cbc
Author: Victor Oliveira <victormatheus gmail com>
Date:   Sun Feb 17 04:08:46 2013 +0000

    testing system for opencl
    
    we run opencl-enabled filters with and without opencl and compare outputs.

 configure.ac                         |    1 +
 tests/Makefile.am                    |    3 +-
 tests/opencl/Makefile.am             |   59 ++++++++++++++++++++++++++++++++++
 tests/opencl/bilateral-filter.xml    |   14 ++++++++
 tests/opencl/box-blur.xml            |   13 +++++++
 tests/opencl/brightness-contrast.xml |   14 ++++++++
 tests/opencl/color-temperature.xml   |   10 ++++++
 tests/opencl/edge-sobel.xml          |   14 ++++++++
 tests/opencl/gaussian-blur.xml       |   14 ++++++++
 tests/opencl/invert.xml              |   10 ++++++
 tests/opencl/levels.xml              |   10 ++++++
 tests/opencl/mono-mixer.xml          |   10 ++++++
 tests/opencl/motion-blur.xml         |   10 ++++++
 tests/opencl/noise-reduction.xml     |   10 ++++++
 tests/opencl/oilify.xml              |   10 ++++++
 tests/opencl/opacity.xml             |   13 +++++++
 tests/opencl/pixelize.xml            |   10 ++++++
 tests/opencl/snn-mean.xml            |   10 ++++++
 tests/opencl/svg-src-over.xml        |   21 ++++++++++++
 tests/opencl/threshold.xml           |   13 +++++++
 tests/opencl/value-invert.xml        |   10 ++++++
 tests/opencl/vignette.xml            |   10 ++++++
 22 files changed, 288 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index c132b0b..148bf95 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1117,6 +1117,7 @@ tests/python/Makefile
 tests/simple/Makefile
 tests/xml/Makefile
 tests/xml/data/Makefile
+tests/opencl/Makefile
 po/Makefile.in
 gegl-uninstalled.pc
 opencl/Makefile
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 87b2cf5..baa321d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -4,4 +4,5 @@ SUBDIRS = \
        compositions \
        simple \
        xml \
-       python
+       python \
+       opencl
diff --git a/tests/opencl/Makefile.am b/tests/opencl/Makefile.am
new file mode 100644
index 0000000..d6c33dd
--- /dev/null
+++ b/tests/opencl/Makefile.am
@@ -0,0 +1,59 @@
+EXTRA_DIST=$(wildcard $(srcdir)/*.xml)
+
+# Env vars to make binaries use builddir stuff
+builddir_gegl_env = GEGL_SWAP=RAM GEGL_PATH=$(top_builddir)/operations
+
+# Binary paths
+gegl_bin = $(top_builddir)/bin/gegl$(EXEEXT)
+img_cmp_bin = $(top_builddir)/tools/img_cmp$(EXEEXT)
+
+# Commands run in a builddir env
+builddir_gegl = $(builddir_gegl_env) $(gegl_bin)
+builddir_img_cmp = $(builddir_gegl_env) $(img_cmp_bin)
+
+# These strings must not be inside XML file names; we use $(subst ...)
+testprefix = run-
+testsuffix = .sh
+
+# List of tests. The .sh suffix allows us to use $(wildcard $(srcdir)/*.xml) in
+# EXTRA_DISTS
+TESTS = \
+  run-bilateral-filter.xml.sh    \
+  run-box-blur.xml.sh            \
+  run-brightness-contrast.xml.sh \
+  run-color-temperature.xml.sh   \
+  run-edge-sobel.xml.sh          \
+  run-gaussian-blur.xml.sh       \
+  run-invert.xml.sh              \
+  run-levels.xml.sh              \
+  run-mono-mixer.xml.sh          \
+  run-motion-blur.xml.sh         \
+  run-noise-reduction.xml.sh     \
+  run-oilify.xml.sh              \
+  run-opacity.xml.sh             \
+  run-pixelize.xml.sh            \
+  run-snn-mean.xml.sh            \
+  run-svg-src-over.xml.sh        \
+  run-threshold.xml.sh           \
+  run-value-invert.xml.sh        \
+  run-vignette.xml.sh
+
+# Create a separate executable script for each composition test to run
+test_to_xml    = $(abs_srcdir)/$(subst $(testsuffix),,$(subst $(testprefix),,$(1)))
+test_to_out    = $(abs_builddir)/output/$(basename $(notdir $(call test_to_xml,$(1)))).png
+test_to_out_cl = $(abs_builddir)/output_cl/$(basename $(notdir $(call test_to_xml,$(1)))).png
+
+$(testprefix)%.xml.sh: Makefile.am $(call test_to_xml,$@)
+       @xml_file=$(call test_to_xml,$@)                                   ;\
+       out_img=$(call test_to_out,$@)                                     ;\
+       out_img_cl=$(call test_to_out_cl,$@)                               ;\
+       echo "#!/bin/bash" > $@                                            ;\
+       echo "mkdir -p $(abs_builddir)/output"    >> $@                    ;\
+       echo "mkdir -p $(abs_builddir)/output_cl" >> $@                    ;\
+       echo "GEGL_USE_OPENCL=no  $(builddir_gegl) $$xml_file -o $$out_img"    >> $@ ;\
+       echo "GEGL_USE_OPENCL=yes $(builddir_gegl) $$xml_file -o $$out_img_cl" >> $@ ;\
+       echo "$(builddir_img_cmp) $$out_img $$out_img_cl" >> $@            ;\
+       chmod +x $@
+
+clean-local:
+       rm -f $(testprefix)*.xml$(testsuffix) output/* output_cl/*
diff --git a/tests/opencl/bilateral-filter.xml b/tests/opencl/bilateral-filter.xml
new file mode 100644
index 0000000..fe42cb3
--- /dev/null
+++ b/tests/opencl/bilateral-filter.xml
@@ -0,0 +1,14 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<gegl>
+  <node operation='gegl:bilateral-filter'>
+    <params>
+      <param name='blur_radius'>10.0</param>
+      <param name='edge_preservation'>5.0</param>
+    </params>
+  </node>
+  <node operation='gegl:load'>
+    <params>
+      <param name='path'>../compositions/data/car-stack.png</param>
+    </params>
+  </node>
+</gegl>
diff --git a/tests/opencl/box-blur.xml b/tests/opencl/box-blur.xml
new file mode 100644
index 0000000..64d7657
--- /dev/null
+++ b/tests/opencl/box-blur.xml
@@ -0,0 +1,13 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<gegl>
+  <node operation='gegl:box-blur'>
+    <params>
+      <param name='radius'>25.0</param>
+    </params>
+  </node>
+  <node operation='gegl:load'>
+    <params>
+      <param name='path'>../compositions/data/car-stack.png</param>
+    </params>
+  </node>
+</gegl>
diff --git a/tests/opencl/brightness-contrast.xml b/tests/opencl/brightness-contrast.xml
new file mode 100644
index 0000000..2de7dbd
--- /dev/null
+++ b/tests/opencl/brightness-contrast.xml
@@ -0,0 +1,14 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<gegl>
+  <node operation='gegl:brightness-contrast'>
+    <params>
+      <param name='brightness'>2.0</param>
+      <param name='contrast'>0.5</param>
+    </params>
+  </node>
+  <node operation='gegl:load'>
+    <params>
+      <param name='path'>../compositions/data/car-stack.png</param>
+    </params>
+  </node>
+</gegl>
diff --git a/tests/opencl/color-temperature.xml b/tests/opencl/color-temperature.xml
new file mode 100644
index 0000000..4bd969a
--- /dev/null
+++ b/tests/opencl/color-temperature.xml
@@ -0,0 +1,10 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<gegl>
+  <node operation='gegl:color-temperature'>
+  </node>
+  <node operation='gegl:load'>
+    <params>
+      <param name='path'>../compositions/data/car-stack.png</param>
+    </params>
+  </node>
+</gegl>
diff --git a/tests/opencl/edge-sobel.xml b/tests/opencl/edge-sobel.xml
new file mode 100644
index 0000000..caf1536
--- /dev/null
+++ b/tests/opencl/edge-sobel.xml
@@ -0,0 +1,14 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<gegl>
+  <node operation='gegl:edge-sobel'>
+    <params>
+      <param name='horizontal'>1</param>
+      <param name='vertical'>1</param>
+    </params>
+  </node>
+  <node operation='gegl:load'>
+    <params>
+      <param name='path'>../compositions/data/car-stack.png</param>
+    </params>
+  </node>
+</gegl>
diff --git a/tests/opencl/gaussian-blur.xml b/tests/opencl/gaussian-blur.xml
new file mode 100644
index 0000000..6de1e73
--- /dev/null
+++ b/tests/opencl/gaussian-blur.xml
@@ -0,0 +1,14 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<gegl>
+  <node operation='gegl:gaussian-blur'>
+    <params>
+      <param name='std-dev-x'>10.0</param>
+      <param name='std-dev-y'>10.0</param>
+    </params>
+  </node>
+  <node operation='gegl:load'>
+    <params>
+      <param name='path'>../compositions/data/car-stack.png</param>
+    </params>
+  </node>
+</gegl>
diff --git a/tests/opencl/invert.xml b/tests/opencl/invert.xml
new file mode 100644
index 0000000..9d0a4cd
--- /dev/null
+++ b/tests/opencl/invert.xml
@@ -0,0 +1,10 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<gegl>
+  <node operation='gegl:invert'>
+  </node>
+  <node operation='gegl:load'>
+    <params>
+      <param name='path'>../compositions/data/car-stack.png</param>
+    </params>
+  </node>
+</gegl>
diff --git a/tests/opencl/levels.xml b/tests/opencl/levels.xml
new file mode 100644
index 0000000..639603a
--- /dev/null
+++ b/tests/opencl/levels.xml
@@ -0,0 +1,10 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<gegl>
+  <node operation='gegl:levels'>
+  </node>
+  <node operation='gegl:load'>
+    <params>
+      <param name='path'>../compositions/data/car-stack.png</param>
+    </params>
+  </node>
+</gegl>
diff --git a/tests/opencl/mono-mixer.xml b/tests/opencl/mono-mixer.xml
new file mode 100644
index 0000000..06bf4b2
--- /dev/null
+++ b/tests/opencl/mono-mixer.xml
@@ -0,0 +1,10 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<gegl>
+  <node operation='gegl:mono-mixer'>
+  </node>
+  <node operation='gegl:load'>
+    <params>
+      <param name='path'>../compositions/data/car-stack.png</param>
+    </params>
+  </node>
+</gegl>
diff --git a/tests/opencl/motion-blur.xml b/tests/opencl/motion-blur.xml
new file mode 100644
index 0000000..a435e25
--- /dev/null
+++ b/tests/opencl/motion-blur.xml
@@ -0,0 +1,10 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<gegl>
+  <node operation='gegl:motion-blur'>
+  </node>
+  <node operation='gegl:load'>
+    <params>
+      <param name='path'>../compositions/data/car-stack.png</param>
+    </params>
+  </node>
+</gegl>
diff --git a/tests/opencl/noise-reduction.xml b/tests/opencl/noise-reduction.xml
new file mode 100644
index 0000000..d0b4b42
--- /dev/null
+++ b/tests/opencl/noise-reduction.xml
@@ -0,0 +1,10 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<gegl>
+  <node operation='gegl:noise-reduction'>
+  </node>
+  <node operation='gegl:load'>
+    <params>
+      <param name='path'>../compositions/data/car-stack.png</param>
+    </params>
+  </node>
+</gegl>
diff --git a/tests/opencl/oilify.xml b/tests/opencl/oilify.xml
new file mode 100644
index 0000000..5e085e5
--- /dev/null
+++ b/tests/opencl/oilify.xml
@@ -0,0 +1,10 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<gegl>
+  <node operation='gegl:oilify'>
+  </node>
+  <node operation='gegl:load'>
+    <params>
+      <param name='path'>../compositions/data/car-stack.png</param>
+    </params>
+  </node>
+</gegl>
diff --git a/tests/opencl/opacity.xml b/tests/opencl/opacity.xml
new file mode 100644
index 0000000..4094b97
--- /dev/null
+++ b/tests/opencl/opacity.xml
@@ -0,0 +1,13 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<gegl>
+  <node operation='gegl:opacity'>
+    <params>
+      <param name='value'>0.5</param>
+    </params>
+  </node>
+  <node operation='gegl:load'>
+    <params>
+      <param name='path'>../compositions/data/car-stack.png</param>
+    </params>
+  </node>
+</gegl>
diff --git a/tests/opencl/pixelize.xml b/tests/opencl/pixelize.xml
new file mode 100644
index 0000000..0b72a42
--- /dev/null
+++ b/tests/opencl/pixelize.xml
@@ -0,0 +1,10 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<gegl>
+  <node operation='gegl:pixelize'>
+  </node>
+  <node operation='gegl:load'>
+    <params>
+      <param name='path'>../compositions/data/car-stack.png</param>
+    </params>
+  </node>
+</gegl>
diff --git a/tests/opencl/snn-mean.xml b/tests/opencl/snn-mean.xml
new file mode 100644
index 0000000..c4c5c76
--- /dev/null
+++ b/tests/opencl/snn-mean.xml
@@ -0,0 +1,10 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<gegl>
+  <node operation='gegl:snn-mean'>
+  </node>
+  <node operation='gegl:load'>
+    <params>
+      <param name='path'>../compositions/data/car-stack.png</param>
+    </params>
+  </node>
+</gegl>
diff --git a/tests/opencl/svg-src-over.xml b/tests/opencl/svg-src-over.xml
new file mode 100644
index 0000000..46aa29f
--- /dev/null
+++ b/tests/opencl/svg-src-over.xml
@@ -0,0 +1,21 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<gegl>
+  <node operation='gegl:over'>
+    <node operation='gegl:translate'>
+        <params>
+          <param name='x'>10.000000</param>
+          <param name='y'>190.000000</param>
+        </params>
+    </node>
+    <node operation='gegl:load'>
+      <params>
+        <param name='path'>../compositions/data/car-stack.png</param>
+      </params>
+    </node>
+  </node>
+  <node operation='gegl:load'>
+    <params>
+      <param name='path'>../compositions/data/car-stack.png</param>
+    </params>
+  </node>
+</gegl>
diff --git a/tests/opencl/threshold.xml b/tests/opencl/threshold.xml
new file mode 100644
index 0000000..90370cd
--- /dev/null
+++ b/tests/opencl/threshold.xml
@@ -0,0 +1,13 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<gegl>
+  <node operation='gegl:threshold'>
+    <params>
+      <param name='value'>0.5</param>
+    </params>
+  </node>
+  <node operation='gegl:load'>
+    <params>
+      <param name='path'>../compositions/data/car-stack.png</param>
+    </params>
+  </node>
+</gegl>
diff --git a/tests/opencl/value-invert.xml b/tests/opencl/value-invert.xml
new file mode 100644
index 0000000..ee2c0c4
--- /dev/null
+++ b/tests/opencl/value-invert.xml
@@ -0,0 +1,10 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<gegl>
+  <node operation='gegl:value-invert'>
+  </node>
+  <node operation='gegl:load'>
+    <params>
+      <param name='path'>../compositions/data/car-stack.png</param>
+    </params>
+  </node>
+</gegl>
diff --git a/tests/opencl/vignette.xml b/tests/opencl/vignette.xml
new file mode 100644
index 0000000..2b6764e
--- /dev/null
+++ b/tests/opencl/vignette.xml
@@ -0,0 +1,10 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<gegl>
+  <node operation='gegl:vignette'>
+  </node>
+  <node operation='gegl:load'>
+    <params>
+      <param name='path'>../compositions/data/car-stack.png</param>
+    </params>
+  </node>
+</gegl>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]