From 391923a8f5a5fdb74f3c85f1ff7373b4f8d82b63 Mon Sep 17 00:00:00 2001 From: adash Date: Sun, 1 Feb 2009 04:43:01 +0000 Subject: [PATCH] Added new Java single file --- .../2DConv/javasingle/ConvolutionSizeB.java | 270 ++++++++++++++++++ .../Prefetch/2DConv/javasingle/makefile | 4 +- 2 files changed, 273 insertions(+), 1 deletion(-) create mode 100644 Robust/src/Benchmarks/Prefetch/2DConv/javasingle/ConvolutionSizeB.java diff --git a/Robust/src/Benchmarks/Prefetch/2DConv/javasingle/ConvolutionSizeB.java b/Robust/src/Benchmarks/Prefetch/2DConv/javasingle/ConvolutionSizeB.java new file mode 100644 index 00000000..e54093c6 --- /dev/null +++ b/Robust/src/Benchmarks/Prefetch/2DConv/javasingle/ConvolutionSizeB.java @@ -0,0 +1,270 @@ +public class Convolution extends Thread { + Image img; + int x0,x1,y0,y1; + + public Convolution(Image img, int x0, int x1, int y0, int y1) { + this.img = img; + this.x0 = x0; + this.x1 = x1; + this.y0 = y0; + this.y1 = y1; + } + + public void run() { + int kernelHeight=11; + int kernelWidth=11; + + double[][] kernel = new double[kernelHeight][kernelWidth]; + initKernel11(kernel); + + double tempinput[][] = img.inputImage; + double tempout[][] = img.outputImage; + + double tinput1[] = tempinput[x0]; + double tinput2[] = tempinput[x0+1]; + double tinput3[] = tempinput[x0+2]; + double tinput4[] = tempinput[x0+3]; + double tinput5[] = tempinput[x0+4]; + double tinput6[] = tempinput[x0+5]; + double tinput7[] = tempinput[x0+6]; + double tinput8[] = tempinput[x0+7]; + double tinput9[] = tempinput[x0+8]; + double tinput10[] = tempinput[x0+9]; + double tinput0[] = tinput1; + + int l=x0+10; + for(int i=x0;i0) { + NUM_THREADS = Integer.parseInt(args[0]); + if(args.length>1) { + SIZE = Integer.parseInt(args[1]); + } + } + + Image img; + Convolution[] conv; + Convolution tmp; + + img = new Image(SIZE,SIZE,kernelHeight,kernelWidth); + img.setValues(); + conv = new Convolution[NUM_THREADS]; + int increment=SIZE/NUM_THREADS; + int base = 0; + for(int i = 0; i