 	// run the kernel
 	nearestNeighborGPUa<<< dimGrid,dimBlock,sharedMemSize >>>(klimit, dimensionality, d_charWeights, d_qWeights, d_scores);
 	cudaThreadSynchronize();
+	checkCUDAError("kernel");
 
 	// get the scores
 	CUDA_SAFE_CALL(cudaMemcpy(h_scores, d_scores, scoreMemSize, cudaMemcpyDeviceToHost));
+	checkCUDAError("memcpy");
 
 	char answer = '?';
 	int maxScore = -999;

		}
	}
	return answer;
}

static char nearestNeighbor(struct OCRkit *ocrKit, double *questionWeights)

		totalScore = numerator / (sqrt(denominatorA) * sqrt(denominatorB));
	}

	// save cosine similarity score
	g_scores[idx] = totalScore;
}
