From f400f3e39dd97b230cbe9cfffe16976e1025764e Mon Sep 17 00:00:00 2001 From: Gary Frost <frost.gary@gmail.com> Date: Wed, 12 Sep 2012 15:34:59 +0000 Subject: [PATCH] --- .../com/amd/aparapi/test/runtime/Issue69.java | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 test/runtime/src/java/com/amd/aparapi/test/runtime/Issue69.java diff --git a/test/runtime/src/java/com/amd/aparapi/test/runtime/Issue69.java b/test/runtime/src/java/com/amd/aparapi/test/runtime/Issue69.java new file mode 100644 index 00000000..770359a1 --- /dev/null +++ b/test/runtime/src/java/com/amd/aparapi/test/runtime/Issue69.java @@ -0,0 +1,35 @@ +package com.amd.aparapi.test.runtime; + +import com.amd.aparapi.Kernel; +import com.amd.aparapi.Range; + +public class Issue69{ + + public static void main(String[] args) { + final int globalArray[] = new int[512]; + Kernel kernel = new Kernel(){ + @Override public void run() { + globalArray[getGlobalId()] = getGlobalId(); + } + }; + for (int loop = 0; loop < 100; loop++) { + + System.out.printf("%3d free = %10d\n", loop, Runtime.getRuntime().freeMemory()); + kernel.execute(Range.create(512, 64), 1); + for (int i = 0; i < globalArray.length; ++i) { + if (globalArray[i] != i) + System.err.println("Wrong!"); + } + } + for (int loop = 0; loop < 100; loop++) { + + System.out.printf("%3d free = %10d\n", loop, Runtime.getRuntime().freeMemory()); + kernel.execute(Range.create(512, 64), 2); + for (int i = 0; i < globalArray.length; ++i) { + if (globalArray[i] != i) + System.err.println("Wrong!"); + } + } + } + +} -- GitLab