| | |
| | | #include <string.h> |
| | | #include <time.h> |
| | | #include <unistd.h> |
| | | //#include <clBLAS.h> |
| | | |
| | | #ifdef CLBLAS |
| | | #include <clBLAS.h> |
| | | #endif |
| | | |
| | | #include "opencl.h" |
| | | #include "utils.h" |
| | |
| | | |
| | | } |
| | | int index = getpid()%num_devices; |
| | | index = 1; |
| | | index = 0; |
| | | printf("%d rand, %d devices, %d index\n", getpid(), num_devices, index); |
| | | info.device = devices[index]; |
| | | fprintf(stderr, "Found %d device(s)\n", num_devices); |
| | |
| | | check_error(info); |
| | | info.queue = clCreateCommandQueue(info.context, info.device, 0, &info.error); |
| | | check_error(info); |
| | | for(i = 0; i < NUM_QUEUES; ++i){ |
| | | info.queues[i] = clCreateCommandQueue(info.context, info.device, 0, &info.error); |
| | | check_error(info); |
| | | } |
| | | //info.error = clblasSetup(); |
| | | #ifdef CLBLAS |
| | | info.error = clblasSetup(); |
| | | #endif |
| | | check_error(info); |
| | | info.initialized = 1; |
| | | return info; |
| | | } |
| | | |
| | | void wait_for_queues() |
| | | { |
| | | int i; |
| | | for(i = 0; i < NUM_QUEUES; ++i){ |
| | | clFinish(cl.queues[i]); |
| | | } |
| | | } |
| | | |
| | | cl_program cl_fprog(char *filename, char *options, cl_info info) |
| | | { |
| | | size_t srcsize; |