kif/pyFAI — pull request #2 by dkarkoulis (2012-06-20 16:20:17+00:00)
Title: additions

Added functionality for ocl_tools and ocl_base to report information on current device and platform and also the (Platform.Device) pair
Small fixes in 1D kernel (SVN 260)

Some comments are still missing

Check the ocl_base.hpp for the new stuff.
Here is an example from C++:

test.print_active_platform_info();
test.print_active_device_info();

int a,b;
test.return_pair(a,b);
std::cout<< "Platform " << a << " Device " << b << std::endl;

The last should be exactly what you want. Returns the Platform.Device pair.
The first two print information. This info is also saved in these two structs defined by ocl_tools.h

ocl_plat_t platform_info;
ocl_dev_t device_info;

typedef struct
{
char *name;
char *vendor;
char *version;
char *extensions;
}ocl_plat_t;

typedef struct
{
char *name;
char type[4];
char *refcount;
char *version;
char *driver_version;
char *extensions;
unsigned long global_mem;
}ocl_dev_t;