#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <cf4ocl2.h>
#define ERROR_MSG_AND_EXIT(msg) \
do { fprintf(stderr, "\n%s\n", msg); exit(EXIT_FAILURE); } while(0)
#define HANDLE_ERROR(err) \
if (err != NULL) { ERROR_MSG_AND_EXIT(err->message); }
cl_uint num_platfs;
cl_uint num_devs;
char* info;
HANDLE_ERROR(err);
for (cl_uint i = 0; i < num_platfs; ++i) {
platf, CL_PLATFORM_NAME, &err);
HANDLE_ERROR(err);
printf("Platform #%d: %s\n", i, info);
HANDLE_ERROR(err);
for (cl_uint j = 0; j < num_devs; ++j) {
HANDLE_ERROR(err);
dev, CL_DEVICE_NAME, char*, &err);
HANDLE_ERROR(err);
printf("\tDevice #%d: %s\n", j, info);
}
}
return EXIT_SUCCESS;
}