From 05b772104028857c0d2a324ee3ba3971a1bc4bc5 Mon Sep 17 00:00:00 2001 From: Steve G Date: Fri, 18 Nov 2016 15:04:34 -0700 Subject: [PATCH] Fixed casting issue Fixed line 148 on casting a calloc and removing an unused variable. --- Solutions/Exercise09/C/pi_ocl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Solutions/Exercise09/C/pi_ocl.c b/Solutions/Exercise09/C/pi_ocl.c index d6186ed..5240d9f 100644 --- a/Solutions/Exercise09/C/pi_ocl.c +++ b/Solutions/Exercise09/C/pi_ocl.c @@ -67,7 +67,7 @@ int main(int argc, char *argv[]) int nsteps; float step_size; size_t nwork_groups; - size_t max_size, work_group_size = 8; + size_t work_group_size = 8; float pi_res; cl_mem d_partial_sums; @@ -145,7 +145,7 @@ int main(int argc, char *argv[]) nsteps = work_group_size * niters * nwork_groups; step_size = 1.0f/(float)nsteps; - h_psum = calloc(sizeof(float), nwork_groups); + h_psum = (float*)calloc(sizeof(float), nwork_groups); if (!h_psum) { printf("Error: could not allocate host memory for h_psum\n");