#include #include #include #include #include #include "profiler.h" #pragma comment (lib, "opencl.lib") size_t var_size = 0x4000000; int mem_size = sizeof(float)*var_size; float *outH1 = new float[var_size]; float *outH2 = new float[var_size]; float *outH3 = new float[var_size]; cl_kernel kernel; cl_command_queue queue; cl_mem buf1; cl_mem buf2; cl_mem buf3; void openClFunc(); void cpuFunc(); int main(int argc, char *argv[]) { const int platforms = 0xff; cl_int error; cl_uint num_platforms; cl_platform_id platform[platforms]; error = clGetPlatformIDs(platforms, platform, &num_platforms); const int devices = 0xff; cl_uint num_devices; cl_device_id device[devices]; clGetDeviceIDs(platform[0], CL_DEVICE_TYPE_GPU, devices, device, &num_devices); cl_context_properties cprops[3] = {CL_CONTEXT_PLATFORM, (cl_context_properties)platform[0], 0}; cl_context context = clCreateContext(cprops, 1, &device[0], 0, 0, &error); for(int i=0; i