Skip to content

Commit

Permalink
Fix macOS build
Browse files Browse the repository at this point in the history
  • Loading branch information
ihhub committed Mar 18, 2024
1 parent 6bc6088 commit 883cd69
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/opencl/image_buffer_opencl.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@

#pragma once

#define CL_TARGET_OPENCL_VERSION 210

#if defined( __APPLE__ ) || defined( __MACOSX )
#include <OpenCL/cl.h>
#else

#define CL_TARGET_OPENCL_VERSION 210

#include <CL/cl.h>
#endif

Expand Down
6 changes: 6 additions & 0 deletions src/opencl/opencl_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,13 @@ namespace multiCL
OpenCLQueue::OpenCLQueue( const OpenCLContext & context, cl_device_id deviceId )
{
cl_int error;

#if defined( __APPLE__ ) || defined( __MACOSX )
_commandQueue = clCreateCommandQueue( context(), deviceId, 0, &error );
#else
_commandQueue = clCreateCommandQueueWithProperties( context(), deviceId, 0, &error );
#endif

openCLCheck( error );
}

Expand Down
5 changes: 3 additions & 2 deletions src/opencl/opencl_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@

#pragma once

#define CL_TARGET_OPENCL_VERSION 210

#if defined( __APPLE__ ) || defined( __MACOSX )
#include <OpenCL/cl.h>
#else

#define CL_TARGET_OPENCL_VERSION 210

#include <CL/cl.h>
#endif

Expand Down
5 changes: 3 additions & 2 deletions src/opencl/opencl_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@

#pragma once

#define CL_TARGET_OPENCL_VERSION 210

#if defined( __APPLE__ ) || defined( __MACOSX )
#include <OpenCL/cl.h>
#else

#define CL_TARGET_OPENCL_VERSION 210

#include <CL/cl.h>
#endif

Expand Down
5 changes: 3 additions & 2 deletions src/opencl/opencl_memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@

#pragma once

#define CL_TARGET_OPENCL_VERSION 210

#if defined( __APPLE__ ) || defined( __MACOSX )
#include <OpenCL/cl.h>
#else

#define CL_TARGET_OPENCL_VERSION 210

#include <CL/cl.h>
#endif

Expand Down

0 comments on commit 883cd69

Please sign in to comment.