Commit 211042a9 authored by Mike Houston's avatar Mike Houston
Browse files

Add updated platform support for the Khronos approved ICD model so AMD and...

Add updated platform support for the Khronos approved ICD model so AMD and newer Nvidia drivers on Windows/Linux will work.  Haven't tested Apple
parent 4a6d5537
......@@ -43,7 +43,11 @@ using namespace std;
OpenCLContext::OpenCLContext(int numParticles, int deviceIndex) : time(0.0), stepCount(0), computeForceCount(0) {
try {
context = cl::Context(CL_DEVICE_TYPE_ALL);
std::vector<cl::Platform> platforms;
cl::Platform::get(&platforms);
cl_context_properties cprops[] = {CL_CONTEXT_PLATFORM, (cl_context_properties)platforms[0](), 0 };
context = cl::Context(CL_DEVICE_TYPE_ALL, cprops);
vector<cl::Device> devices = context.getInfo<CL_CONTEXT_DEVICES>();
const int minThreadBlockSize = 32;
if (deviceIndex < 0 || deviceIndex >= (int) devices.size()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment