2013-05-21 00:58:19 +00:00
|
|
|
// clewTest.cpp : Defines the entry point for the console application.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "clew.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
{
|
|
|
|
int result = -1;
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
const char* cl = "OpenCL.dll";
|
|
|
|
#elif defined __APPLE__
|
|
|
|
const char* cl = "/System/Library/Frameworks/OpenCL.framework/Versions/Current/OpenCL";
|
2018-09-23 21:17:31 +00:00
|
|
|
#else //presumable Linux?
|
2013-05-21 00:58:19 +00:00
|
|
|
//linux (tested on Ubuntu 12.10 with Catalyst 13.4 beta drivers, not that there is no symbolic link from libOpenCL.so
|
|
|
|
const char* cl = "libOpenCL.so.1";
|
|
|
|
result = clewInit(cl);
|
|
|
|
if (result != CLEW_SUCCESS)
|
|
|
|
{
|
|
|
|
cl = "libOpenCL.so";
|
2018-09-23 21:17:31 +00:00
|
|
|
}
|
|
|
|
else
|
2013-05-21 00:58:19 +00:00
|
|
|
{
|
|
|
|
clewExit();
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
result = clewInit(cl);
|
2018-09-23 21:17:31 +00:00
|
|
|
if (result != CLEW_SUCCESS)
|
|
|
|
printf("clewInit failed with error code %d\n", result);
|
2013-05-21 00:58:19 +00:00
|
|
|
else
|
|
|
|
{
|
2018-09-23 21:17:31 +00:00
|
|
|
printf("clewInit succesfull using %s\n", cl);
|
2013-05-21 00:58:19 +00:00
|
|
|
|
|
|
|
//some test and then
|
|
|
|
clewExit();
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|