diff --git a/examples/nbody/nbody.bat b/examples/nbody/nbody.bat index b698fba0aa3ffe500df5e8ce2a585ccd686e9393..967350bc2922a2a90d9dae8c3b5692b6ce1b5600 100644 --- a/examples/nbody/nbody.bat +++ b/examples/nbody/nbody.bat @@ -4,6 +4,7 @@ java ^ -Djava.library.path=..\..\com.amd.aparapi.jni\dist;jogamp ^ -Dcom.amd.aparapi.executionMode=%1 ^ -Dcom.amd.aparapi.enableProfiling=false ^ + -Dcom.amd.aparapi.enableShowGeneratedOpenCL=true ^ -Dbodies=%2 ^ -Dheight=600 ^ -Dwidth=600 ^ diff --git a/samples/convolution/conv.bat b/samples/convolution/conv.bat index 6c949bedf182121c9a929d063d24edfc6d2005ae..3d11f2deef08ea32cae3ef699e54a624a63f1a42 100644 --- a/samples/convolution/conv.bat +++ b/samples/convolution/conv.bat @@ -1,6 +1,7 @@ java ^ -Djava.library.path=../../com.amd.aparapi.jni/dist ^ -Dcom.amd.aparapi.executionMode=%1 ^ + -Dcom.amd.aparapi.enableShowGeneratedOpenCL=true ^ -classpath ../../com.amd.aparapi/dist/aparapi.jar;convolution.jar ^ com.amd.aparapi.sample.convolution.Convolution %2 diff --git a/samples/life/life.bat b/samples/life/life.bat index 61f894b3623406c5cc1cddb59ed62a96d098acb7..f5ae763fb172c8a7fcd341826d287f3d1373dbf4 100644 --- a/samples/life/life.bat +++ b/samples/life/life.bat @@ -4,6 +4,7 @@ java ^ -Dcom.amd.aparapi.executionMode=%1 ^ -Dcom.amd.aparapi.enableProfiling=false ^ -Dcom.amd.aparapi.enableVerboseJNI=false ^ + -Dcom.amd.aparapi.enableShowGeneratedOpenCL=true ^ -classpath ../../com.amd.aparapi/dist/aparapi.jar;life.jar ^ com.amd.aparapi.sample.life.Main diff --git a/samples/mandel/mandel.bat b/samples/mandel/mandel.bat index 42d0f383c58b1b3400076b4412cb20a87084363f..22609363f9f1ae09a41fc7ebe0779156f91ce985 100644 --- a/samples/mandel/mandel.bat +++ b/samples/mandel/mandel.bat @@ -1,10 +1,10 @@ java ^ -Djava.library.path=../../com.amd.aparapi.jni/dist ^ -Dcom.amd.aparapi.executionMode=%1 ^ - -Dcom.amd.aparapi.logLevel=SEVERE^ + -Dcom.amd.aparapi.logLevel=OFF^ -Dcom.amd.aparapi.enableVerboseJNI=false ^ -Dcom.amd.aparapi.enableProfiling=false ^ - -Dcom.amd.aparapi.enableShowGeneratedOpenCL=false ^ + -Dcom.amd.aparapi.enableShowGeneratedOpenCL=true ^ -Dcom.amd.aparapi.enableVerboseJNIOpenCLResourceTracking=false ^ -Dcom.amd.aparapi.dumpFlags=true ^ -Dcom.amd.aparapi.enableInstructionDecodeViewer=false ^ diff --git a/samples/mandel/src/com/amd/aparapi/sample/mandel/Main.java b/samples/mandel/src/com/amd/aparapi/sample/mandel/Main.java index 91665b000d0893461c3e33cff827aa78f43fea3c..a84cbce54bdf2756857fae478e075b2d8587a341 100644 --- a/samples/mandel/src/com/amd/aparapi/sample/mandel/Main.java +++ b/samples/mandel/src/com/amd/aparapi/sample/mandel/Main.java @@ -123,18 +123,9 @@ public class Main{ } - @Override public void run() { - - /** Determine which RGB value we are going to process (0..RGB.length). */ - int gid = getGlobalId(); - - /** Translate the gid into an x an y value. */ - float x = (((gid % width * scale) - ((scale / 2) * width)) / width) + offsetx; - - float y = (((gid / width * scale) - ((scale / 2) * height)) / height) + offsety; - - int count = 0; + public int getCount(float x, float y, int maxIterations){ + int count =0 ; float zx = x; float zy = y; float new_zx = 0f; @@ -146,6 +137,22 @@ public class Main{ zx = new_zx; count++; } + return(count); + } + + @Override public void run() { + + /** Determine which RGB value we are going to process (0..RGB.length). */ + int gid = getGlobalId(); + + /** Translate the gid into an x an y value. */ + float x = (((gid % width * scale) - ((scale / 2) * width)) / width) + offsetx; + + float y = (((gid / width * scale) - ((scale / 2) * height)) / height) + offsety; + + int count = getCount(x,y,maxIterations); + + // Pull the value out of the palette for this iteration count. rgb[gid] = pallette[count];