File: clewTest.cpp

package info (click to toggle)
bullet 3.24%2Bdfsg-2.1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 15,168 kB
  • sloc: cpp: 246,331; lisp: 12,017; ansic: 11,175; python: 630; makefile: 136; sh: 75
file content (40 lines) | stat: -rw-r--r-- 846 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// 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";
#else  //presumable Linux?
	//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";
	}
	else
	{
		clewExit();
	}
#endif
	result = clewInit(cl);
	if (result != CLEW_SUCCESS)
		printf("clewInit failed with error code %d\n", result);
	else
	{
		printf("clewInit succesfull using %s\n", cl);

		//some test and then
		clewExit();
	}

	return 0;
}