 
 double cudaEnergy(Grid *g)
 {
-    dim3 blocks, threads;
-    switch (g->dimension)
-    {
-        case DIM_1: blocks = blocks_1d; threads = threads_1d; break;
-        case DIM_2: blocks = blocks_2d; threads = threads_2d; break;
-        case DIM_3: blocks = blocks_3d; threads = threads_3d; break;
-    }
-
     kernelEnergy<<<blocks, threads>>>(g->deviceMatrix, tempMatrix);
-
     double sum = 0.0;
     uint dataSize = g->xSize * g->ySize * g->zSize;
     thrust::device_ptr<double> ptr(tempMatrix);

    cudaMemcpyToSymbol((const void *) &interactionRadius, &(g->interactionRadius), sizeof(int));
    cudaMemcpyToSymbol((const void *) &temperature,       &(g->temperature),       sizeof(double));

    dim3 blocks, threads;
    switch (g->dimension)
    {
        case DIM_1: blocks = blocks_1d; threads = threads_1d; break;


dim3 blocks_3d(4, 8, 8);
dim3 threads_3d(16, 8, 8);

dim3 blocks, threads;

__constant__ DimensionEnum dimension;
__constant__ uint xSize;
