diff options
author | David Schleef <ds@schleef.org> | 2004-08-12 23:26:45 +0000 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2004-08-12 23:26:45 +0000 |
commit | 039681892fec66e8fc4a41c13a4ce52bff0ed6bf (patch) | |
tree | 0182bb5b0b73aafb07ff014f24a0983d03ba6240 /testsuite | |
parent | 1fd958fb9fddc414f8a6dc002b601c1245e51174 (diff) | |
download | liboil-039681892fec66e8fc4a41c13a4ce52bff0ed6bf.tar.gz |
* testsuite/abs.c: (test), (main): Add
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/abs.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/testsuite/abs.c b/testsuite/abs.c new file mode 100644 index 0000000..fee0789 --- /dev/null +++ b/testsuite/abs.c @@ -0,0 +1,56 @@ + +#include <liboil/liboil.h> +#include <liboil/liboilfuncs.h> +#include <glib.h> + +void test(void) +{ + int i; + float *src; + float *dest; + + src = g_malloc(100*sizeof(float)); + dest = g_malloc(100*sizeof(float)); + + for(i=0;i<100;i++){ + src[i] = (i-50)*100; + } + + abs_f32_f32 (dest, 2, src, 2, 100); + + for (i=0; i<100; i++) { + g_print("%d %g %g\n", i, src[i], dest[i]); + } +} + +int main (int argc, char *argv[]) +{ + OilFunctionClass *klass; + OilFunctionImpl *impl; + + _oil_debug_level = OIL_DEBUG_INFO; + oil_init (); + + //oil_optimize_all(); + + klass = oil_class_get ("abs_f32_f32"); + oil_class_optimize(klass); + + g_print("class=%s\n", klass->name); + for (impl = klass->first_impl; impl; impl=impl->next) { + g_print("impl=%p\n", impl); + g_print(" func=%p\n", impl->func); + g_print(" name=%s\n", impl->name); + g_print(" flags=%08x\n", impl->flags); + + } + impl = klass->chosen_impl; + g_print("chosen=%p\n", impl); + impl = klass->reference_impl; + g_print("ref=%p\n", impl); + + //test(); + + return 0; +} + |