From a5cd1a150be2dedbe069dd55533ba34e093f4dc1 Mon Sep 17 00:00:00 2001 From: Clemens-Alexander Brust Date: Tue, 16 Jun 2015 17:39:21 +0200 Subject: [PATCH 1/2] Init: Fixed wrong delete operator, restricted OpenCL context to device --- src/util/Init.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/util/Init.cpp b/src/util/Init.cpp index fc15fe7..323ec41 100644 --- a/src/util/Init.cpp +++ b/src/util/Init.cpp @@ -215,8 +215,8 @@ void CLHelper::Init(unsigned int platform_number, unsigned int device_number) { LOGINFO << "Creating OpenCL context..."; cl_int error = 0; - context = clCreateContext ( context_properties, device_count, - device_ids, 0, 0, &error ); + context = clCreateContext ( context_properties, 1, + &device_ids[device_number], 0, 0, &error ); if ( error != CL_SUCCESS ) { FATAL ( "Error creating OpenCL context: " << error ); @@ -230,8 +230,8 @@ void CLHelper::Init(unsigned int platform_number, unsigned int device_number) { FATAL ( "Error creating OpenCL command queue: " << error ); } - delete device_ids; - delete platform_ids; + delete[] device_ids; + delete[] platform_ids; // Compile kernels cl_program p_crossCorrelation = CreateProgram ( "kernels/crossCorrelation.cl" ); From d44fa8b1bdbbbc6c1c3984b27b4287ec909d27b5 Mon Sep 17 00:00:00 2001 From: Clemens-Alexander Brust Date: Tue, 23 Jun 2015 12:15:03 +0200 Subject: [PATCH 2/2] Init: Fixed conditional includes --- src/util/Init.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/util/Init.cpp b/src/util/Init.cpp index 323ec41..fcddb58 100644 --- a/src/util/Init.cpp +++ b/src/util/Init.cpp @@ -4,12 +4,10 @@ * * For licensing information, see the LICENSE file included with this project. */ -#ifdef BUILD_OPENCL #include #include #include #include -#endif #include "Init.h" #include "CLHelper.h"