Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions openclfunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ bool checkOpenCLAvailability(QString& error)
else {
error = "Could not find a OpenCL library";
}
#elif defined(__linux__)
#elif defined(__linux__) || defined(__APPLE__)
// Try to find the OepenCL library on one of the following paths
static const char* libraryPaths[] = {
"libOpenCL.so",
Expand All @@ -113,7 +113,9 @@ bool checkOpenCLAvailability(QString& error)
"/usr/local/lib/libOpenCL.so.1",
"/usr/local/lib/libpocl.so.1",
"/usr/lib64/libOpenCL.so.1",
"/usr/lib32/libOpenCL.so.1"
"/usr/lib32/libOpenCL.so.1",
"/System/Library/Frameworks/OpenCL.framework",
"/System/Library/Frameworks/OpenCL.framework/Versions/A/OpenCL"
};
void* libOpenCL = nullptr;
for (auto libraryPath : libraryPaths) {
Expand Down
2 changes: 1 addition & 1 deletion openclfunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#include <CL/cl.h>
#include <QDebug>
#if defined(__linux__)
#if defined(__linux__) || defined(__APPLE__)
#include <dlfcn.h>
#elif defined(_WIN32)
#include "windows.h"
Expand Down
14 changes: 11 additions & 3 deletions operatingsystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

#include "operatingsystem.h"

#if defined(__APPLE__)
#include "TargetConditionals.h"
#endif

OperatingSystem operatingSystem{};

void getOperatingSystem()
Expand Down Expand Up @@ -51,7 +55,11 @@ void getOperatingSystem()
operatingSystem.type = 2;
#elif defined(__linux__)
operatingSystem.type = 1;
#elif __APPLE__
// @todo: dinstinguish between macos and ios
#elif defined(__APPLE__)
#if TARGET_OS_OSX
operatingSystem.type = 3;
#else
operatingSystem.type = 4;
#endif
}
#endif
}