Skip to content

Commit

Permalink
Merge pull request #24 from cvjena/master
Browse files Browse the repository at this point in the history
Init: Several fixes
  • Loading branch information
Clemens-Alexander Brust committed Jun 23, 2015
2 parents 90873bc + d44fa8b commit 06206bf
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/util/Init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
*
* For licensing information, see the LICENSE file included with this project.
*/
#ifdef BUILD_OPENCL
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#endif

#include "Init.h"
#include "CLHelper.h"
Expand Down Expand Up @@ -215,8 +213,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 );
Expand All @@ -230,8 +228,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" );
Expand Down

0 comments on commit 06206bf

Please sign in to comment.