 
 	cudaMemcpy(h_out, d_out, sizeof(double) * numCells, cudaMemcpyDeviceToHost);
 
+  cudaFree(d_right);
+  cudaFree(d_left);
+  cudaFree(d_out);
+
 }
 
 

	clock_gettime(CLOCK_MONOTONIC, &tic);

	//repeat the calculation 5 times so we can average out some randomness
	for(int i = 0; i < 5; ++i){
		contractDataDataScalarKokkos<Kokkos::OpenMP, omp_input_view_t,
			omp_output_view_t, omp_input_host_t, omp_output_host_t>
				(omp_hostOut, omp_hostLeft, omp_hostRight, omp_kokkosOut,

	}

	std::cout << "cuda col major speedup of " << elapsedTime_serial/elapsedTime_cuda << std::endl;
	
	std::cout << "trying cuda row major" << std::endl;
	//Now try the cuda version, start with warmup
	cudaDoContractDataDataScalar(cudaOut,cudaLeftRowMajor,cudaRightRowMajor, c, p, false);

	clock_gettime(CLOCK_MONOTONIC, &tic);
	for(int i = 0; i < numRepeats; ++i){
		cudaDoContractDataDataScalar(cudaOut,cudaLeftRowMajor,cudaRightRowMajor, c, p, false);
	}

	clock_gettime(CLOCK_MONOTONIC, &toc);
