public static void main(String[] _args) {

		final int NUMELEMENTS = 40;
		float[] inArray = new float[NUMELEMENTS];
		float[] outArray = new float[NUMELEMENTS];

		// initialize inArray
		for (int i=0; i<NUMELEMENTS; i++) {
			inArray[i] = (float)i;
		}
	
		String sourceFileName = "Squares.hsail";
		String squaresSource = null;
		try {
			squaresSource = new String(Files.readAllBytes(FileSystems.getDefault().getPath( sourceFileName)));
		}
		catch(IOException e) {
			e.printStackTrace();
			System.exit(-1);
		}

		OkraContext context = new OkraContext();
		if (!context.isValid()) {System.out.println("...unable to create context"); System.exit(-1);}
		context.setVerbose(true);
		OkraKernel kernel = new OkraKernel(context, squaresSource, "&run");
		if (!kernel.isValid()) {System.out.println("...unable to create kernel"); System.exit(-1);}
		
		// there is currently only one list of arguments maintained at a time
		kernel.clearArgs();
		kernel.pushFloatArrayArg(outArray);
		kernel.pushFloatArrayArg(inArray);

		kernel.setLaunchAttributes(NUMELEMENTS); // 1 dimension

		kernel.dispatchKernelWaitComplete();

		boolean passed = true;
		for (int i=0; i<NUMELEMENTS; i++) {
			System.out.print(i + "->" +  outArray[i] + ",  ");
			if (outArray[i] != i*i) passed = false;
		}
		System.out.println((passed ? "\nPASSED": "\nFAILED") + "\n");
	}