test runs but I do not check results yet.
Change-Id: I427581a301bb1a9710554187accad2d6f9d9b10c
diff --git a/tests/compute.cpp b/tests/compute.cpp
index 28b135f..42eaa52 100644
--- a/tests/compute.cpp
+++ b/tests/compute.cpp
@@ -4,6 +4,8 @@
#include "Type.h"
#include "Allocation.h"
+#include "ScriptC_mono.h"
+
int main(int argc, char** argv)
{
@@ -23,12 +25,31 @@
printf("Type %p\n", t);
- const Allocation *a1 = Allocation::createSized(rs, e, 1000);
+ Allocation *a1 = Allocation::createSized(rs, e, 1000);
printf("Allocation %p\n", a1);
+ Allocation *ain = Allocation::createTyped(rs, t);
+ Allocation *aout = Allocation::createTyped(rs, t);
+ printf("Allocation %p %p\n", ain, aout);
+
+ ScriptC_mono * sc = new ScriptC_mono(rs, NULL, 0);
+ printf("new script\n");
+
+ uint32_t *buf = new uint32_t[t->getCount()];
+ for (uint32_t ct=0; ct < t->getCount(); ct++) {
+ buf[ct] = ct | (ct << 16);
+ }
+ //ain->copy1DRangeFrom(0, 128*128, (int32_t *)buf, 128*128*4);
+ ain->copy1DRangeFromUnchecked(0, t->getCount(), buf, t->getCount()*4);
+
+
+
+ sc->forEach_root(ain, aout);
+ printf("for each done\n");
printf("Deleting stuff\n");
+ delete sc;
delete t;
delete a1;
delete e;