 
 
 int main() {
-	initKNN();
-
+	// initKNN();
+	initPCAKNN();
 	readSingleCheck(preprocess("testCases/check2.ppm"));
-
-	freeKNN();
+	freePCAKNN();
+	// freeKNN();
 	return 0;
 }

	cudaMemcpy(distantPCAHost, distantPCAKernel, distantPCASize, cudaMemcpyDeviceToHost);
	cuCheck(__LINE__);
	for(int j=0; j<count; ++j) {
		float* curDistantHost=distantPCAKernel+j*TrainDataNum;
		mergeSortPCA(curDistantHost, TrainDataNum);
	}
}




//knn code below{{{{{{{{{{{{{{{{{{{{{{{{

float* trainDataHost=NULL;
float* trainDataKernel=NULL;
float* distantHost=NULL;
float* distantKernel=NULL;

int* digits=NULL;
int* digitsDevice=NULL;
float* EigenVectors;
float* trainDataPCAHost=NULL;
float* trainDataPCAKernel=NULL;
float* distantPCAHost=NULL;
float* distantPCAKernel=NULL;

void freePCAKNN() {
	free(digits);
	cudaFree(digitsDevice);
	cudaFree(EigenVectors);
	free(trainDataPCAHost);
	cudaFree(trainDataPCAKernel);
	free(distantPCAHost);
	cudaFree(distantPCAKernel);
}
//init the answer to the training data
//return by pointer
//this is because the training data only holds the data
