diff --git a/MicroBenchmarks/harris/main.cpp b/MicroBenchmarks/harris/main.cpp --- a/MicroBenchmarks/harris/main.cpp +++ b/MicroBenchmarks/harris/main.cpp @@ -60,12 +60,12 @@ float(*image)[HEIGHT + 2][WIDTH + 2]; image = (float(*)[2 + HEIGHT][2 + WIDTH]) - malloc(sizeof(float) * (2 + HEIGHT) * (2 + WIDTH)); + malloc(sizeof(float*) * (2 + HEIGHT) * (2 + WIDTH)); initCheckboardImage((HEIGHT + 2), (WIDTH + 2), *image); float(*imageOutput)[2 + HEIGHT][2 + WIDTH]; imageOutput = (float(*)[2 + HEIGHT][2 + WIDTH]) - malloc(sizeof(float) * (2 + HEIGHT) * (2 + WIDTH)); + malloc(sizeof(float*) * (2 + HEIGHT) * (2 + WIDTH)); float(*Ix)[2 + HEIGHT][2 + WIDTH]; float(*Iy)[2 + HEIGHT][2 + WIDTH]; @@ -79,25 +79,25 @@ float(*trace)[2 + HEIGHT][2 + WIDTH]; Ix = (float(*)[2 + HEIGHT][2 + WIDTH]) - malloc(sizeof(float) * (2 + HEIGHT) * (2 + WIDTH)); + malloc(sizeof(float*) * (2 + HEIGHT) * (2 + WIDTH)); Iy = (float(*)[2 + HEIGHT][2 + WIDTH]) - malloc(sizeof(float) * (2 + HEIGHT) * (2 + WIDTH)); + malloc(sizeof(float*) * (2 + HEIGHT) * (2 + WIDTH)); Ixx = (float(*)[2 + HEIGHT][2 + WIDTH]) - malloc(sizeof(float) * (2 + HEIGHT) * (2 + WIDTH)); + malloc(sizeof(float*) * (2 + HEIGHT) * (2 + WIDTH)); Ixy = (float(*)[2 + HEIGHT][2 + WIDTH]) - malloc(sizeof(float) * (2 + HEIGHT) * (2 + WIDTH)); + malloc(sizeof(float*) * (2 + HEIGHT) * (2 + WIDTH)); Iyy = (float(*)[2 + HEIGHT][2 + WIDTH]) - malloc(sizeof(float) * (2 + HEIGHT) * (2 + WIDTH)); + malloc(sizeof(float*) * (2 + HEIGHT) * (2 + WIDTH)); Sxx = (float(*)[2 + HEIGHT][2 + WIDTH]) - malloc(sizeof(float) * (2 + HEIGHT) * (2 + WIDTH)); + malloc(sizeof(float*) * (2 + HEIGHT) * (2 + WIDTH)); Sxy = (float(*)[2 + HEIGHT][2 + WIDTH]) - malloc(sizeof(float) * (2 + HEIGHT) * (2 + WIDTH)); + malloc(sizeof(float*) * (2 + HEIGHT) * (2 + WIDTH)); Syy = (float(*)[2 + HEIGHT][2 + WIDTH]) - malloc(sizeof(float) * (2 + HEIGHT) * (2 + WIDTH)); + malloc(sizeof(float*) * (2 + HEIGHT) * (2 + WIDTH)); det = (float(*)[2 + HEIGHT][2 + WIDTH]) - malloc(sizeof(float) * (2 + HEIGHT) * (2 + WIDTH)); + malloc(sizeof(float*) * (2 + HEIGHT) * (2 + WIDTH)); trace = (float(*)[2 + HEIGHT][2 + WIDTH]) - malloc(sizeof(float) * (2 + HEIGHT) * (2 + WIDTH)); + malloc(sizeof(float*) * (2 + HEIGHT) * (2 + WIDTH)); harrisKernel(height, width, *image, *imageOutput, *Ix, *Iy, *Ixx, *Ixy, *Iyy, *Sxx, *Sxy, *Syy, *det, *trace); @@ -124,7 +124,7 @@ } } - state.SetBytesProcessed(sizeof(float) * (height + 2) * (width + 2) * + state.SetBytesProcessed(sizeof(float*) * (height + 2) * (width + 2) * state.iterations()); free((void *)imageOutput); @@ -151,12 +151,12 @@ // Extra Call to verify output of kernel float(*image)[HEIGHT + 2][WIDTH + 2]; image = (float(*)[2 + HEIGHT][2 + WIDTH]) - malloc(sizeof(float) * (2 + HEIGHT) * (2 + WIDTH)); + malloc(sizeof(float*) * (2 + HEIGHT) * (2 + WIDTH)); initCheckboardImage((HEIGHT + 2), (WIDTH + 2), *image); float(*imageOutput)[2 + HEIGHT][2 + WIDTH]; imageOutput = (float(*)[2 + HEIGHT][2 + WIDTH]) - malloc(sizeof(float) * (2 + HEIGHT) * (2 + WIDTH)); + malloc(sizeof(float*) * (2 + HEIGHT) * (2 + WIDTH)); float(*Ix)[2 + HEIGHT][2 + WIDTH]; float(*Iy)[2 + HEIGHT][2 + WIDTH]; @@ -170,25 +170,25 @@ float(*trace)[2 + HEIGHT][2 + WIDTH]; Ix = (float(*)[2 + HEIGHT][2 + WIDTH]) - malloc(sizeof(float) * (2 + HEIGHT) * (2 + WIDTH)); + malloc(sizeof(float*) * (2 + HEIGHT) * (2 + WIDTH)); Iy = (float(*)[2 + HEIGHT][2 + WIDTH]) - malloc(sizeof(float) * (2 + HEIGHT) * (2 + WIDTH)); + malloc(sizeof(float*) * (2 + HEIGHT) * (2 + WIDTH)); Ixx = (float(*)[2 + HEIGHT][2 + WIDTH]) - malloc(sizeof(float) * (2 + HEIGHT) * (2 + WIDTH)); + malloc(sizeof(float*) * (2 + HEIGHT) * (2 + WIDTH)); Ixy = (float(*)[2 + HEIGHT][2 + WIDTH]) - malloc(sizeof(float) * (2 + HEIGHT) * (2 + WIDTH)); + malloc(sizeof(float*) * (2 + HEIGHT) * (2 + WIDTH)); Iyy = (float(*)[2 + HEIGHT][2 + WIDTH]) - malloc(sizeof(float) * (2 + HEIGHT) * (2 + WIDTH)); + malloc(sizeof(float*) * (2 + HEIGHT) * (2 + WIDTH)); Sxx = (float(*)[2 + HEIGHT][2 + WIDTH]) - malloc(sizeof(float) * (2 + HEIGHT) * (2 + WIDTH)); + malloc(sizeof(float*) * (2 + HEIGHT) * (2 + WIDTH)); Sxy = (float(*)[2 + HEIGHT][2 + WIDTH]) - malloc(sizeof(float) * (2 + HEIGHT) * (2 + WIDTH)); + malloc(sizeof(float*) * (2 + HEIGHT) * (2 + WIDTH)); Syy = (float(*)[2 + HEIGHT][2 + WIDTH]) - malloc(sizeof(float) * (2 + HEIGHT) * (2 + WIDTH)); + malloc(sizeof(float*) * (2 + HEIGHT) * (2 + WIDTH)); det = (float(*)[2 + HEIGHT][2 + WIDTH]) - malloc(sizeof(float) * (2 + HEIGHT) * (2 + WIDTH)); + malloc(sizeof(float*) * (2 + HEIGHT) * (2 + WIDTH)); trace = (float(*)[2 + HEIGHT][2 + WIDTH]) - malloc(sizeof(float) * (2 + HEIGHT) * (2 + WIDTH)); + malloc(sizeof(float*) * (2 + HEIGHT) * (2 + WIDTH)); harrisKernel(HEIGHT, WIDTH, *image, *imageOutput, *Ix, *Iy, *Ixx, *Ixy, *Iyy, *Sxx, *Sxy, *Syy, *det, *trace);