 
 	HANDLE_ERROR(cudaMalloc((void**) &devCurrVal, allocPoints * sizeof(float)));
 	HANDLE_ERROR(cudaMalloc((void**) &devPrevVal, allocPoints * sizeof(float)));
-	HANDLE_ERROR(cudaMalloc((void**) &devNextVal, allocPoints * sizeof(float)));
 
 	dim3 threadsPerBlock(256);
 	dim3 numOfBlocks(allocPoints/256);


void checkParam();
__global__ void initLine(float*, float*, int);
__global__ void updateAll(float*, float*, float*, int, int);
void printResult();

int totalSteps, totalPoints, allocPoints;
float *currVal;
float *devCurrVal, *devPrevVal, *devNextVal;

int main(int argc, char *argv[]) {
	sscanf(argv[1], "%d", &totalPoints);

	}
}

__global__ void updateAll(float *__devPrevVal, float *__devCurrVal, int __totalPoints, int __totalSteps) {
	int i = blockIdx.x * blockDim.x + threadIdx.x;
	if (i < __totalPoints) {
		float locPrevVal = __devPrevVal[i], locCurrVal = __devCurrVal[i] , locNextVal;
		for (int j = 0; j < __totalSteps; j++) {
			if ((i == 0) || (i == __totalPoints - 1))
				locNextVal = 0.0;
			else
				locNextVal = 1.82 * locCurrVal - locPrevVal;
			locPrevVal = locCurrVal;
			locCurrVal = locNextVal;
		}
		__devCurrVal[i] = locCurrVal;
	}
}

