

Printf("Error: Failed to build program executable!\n") ĬlGetProgramBuildInfo(program, devices, CL_PROGRAM_BUILD_LOG, sizeof(buffer), buffer, &len) Program = clCreateProgramWithSource(context, 1, (const char **) & KernelSource, NULL, &err) ĬheckError(err, "Failed to create compute program!") Įrr = clBuildProgram(program, deviceCount, devices, NULL, NULL, NULL) Create the compute program from the source buffer String errMsg = "Was unable to successfully set up a command queue for device number " + to_string(i) Ĭhar *KernelSource = ReadFile("./Source/Sampling/Sampler.cl") *-For each device create a separate command queue-*/ĬommandQueues = new cl_command_queue ĬommandQueues = clCreateCommandQueue(context, devices, 0, &err) *-Create a single context for all devices-*/Ĭontext = clCreateContext(NULL, deviceCount, devices, NULL, NULL, &err) ĬheckError(err, "Could not create a context on this platform") Int currDevice = 0 //Use this to just access first available deviceĮrr = clGetPlatformIDs(1, &platform, NULL) ĬheckError(err, "A valid platform could not be found on this machine") Įrr = clGetDeviceIDs(platform, CL_DEVICE_TYPE_ALL, 0, NULL, &deviceCount) ĬheckError(err, "Could not determine the number of devices available on this platform") Įrr = clGetDeviceIDs(platform, CL_DEVICE_TYPE_ALL, deviceCount, devices, NULL) ĬheckError(err, "Could not access the devices")
#Generic pnp monitor on intel hd graphics code#
Is there something wrong with the graphics cards I have installed on my computer? Or is there something codewise I have to do that I'm not aware of? I just don't see how a device can be valid up until that one call and then suddenly not be valid.ĮDIT Here is my code (CheckError is just a function I made that prints out a custom error message if there is an error) cl_int err //Error catcherĬl_platform_id platform //Computer platformĬl_context context //Single context for whole platformĬl_uint deviceCount //Number of devices (CPU + GPU) available on machineĬl_device_id *devices //Array of pointers to devices Ĭl_command_queue *commandQueues //One command queue for each deviceĭouble results // results returned from device If instead I comment out that call to clGetKernelWorkGroupInfo and specify my own global/local work sizes I get an error when I try to call clEnqueueNDRangeKernel with a CL_INVALID_PROGRAM_EXECUTABLE error. But as soon as I get to that call it says my device is invalid. I can create a context that encompasses all 3 devices, create 3 separate command queues (one per device), and I can compile a program and create the kernel just fine. This is weird because all of my other calls up until that point work for all 3 devices. My issue is when I try to call clGetkernelWorkGroupInfo, it returns a CL_INVALID_DEVICE error if I pass in the deviceID of one of the two GPUs but works perfectly fine if I pass in the CPU id and will compute my kernel code without issue. So according to this, I should have 1 CPU and 2 GPUs available: a HD Graphics 4000 and a GeForce GT 650M.

#Generic pnp monitor on intel hd graphics pro#
I'm developing on a mid-2013 15" retina screen Macbook pro on OSX 10.9.5 (Mavericks) and using Xcode 6.0.1Īfter using clGetDeviceIDs to access all available devices and using clGetDeviceInfo to see the info for each device I get the following: Device: Intel(R) Core(TM) i7-3635QM CPU 2.40GHz So I'm having some issues getting my code to run on certain openCL devices.
