Commit a07aace0 authored by peastman's avatar peastman
Browse files

Merge pull request #1354 from peastman/deviceindex

Fixed bug in selecting device index
parents ab6cabb4 35913c2a
...@@ -191,7 +191,7 @@ CudaPlatform::PlatformData::PlatformData(ContextImpl* context, const System& sys ...@@ -191,7 +191,7 @@ CudaPlatform::PlatformData::PlatformData(ContextImpl* context, const System& sys
try { try {
for (int i = 0; i < (int) devices.size(); i++) { for (int i = 0; i < (int) devices.size(); i++) {
if (devices[i].length() > 0) { if (devices[i].length() > 0) {
unsigned int deviceIndex; int deviceIndex;
stringstream(devices[i]) >> deviceIndex; stringstream(devices[i]) >> deviceIndex;
contexts.push_back(new CudaContext(system, deviceIndex, blocking, precisionProperty, compilerProperty, tempProperty, hostCompilerProperty, *this)); contexts.push_back(new CudaContext(system, deviceIndex, blocking, precisionProperty, compilerProperty, tempProperty, hostCompilerProperty, *this));
} }
......
...@@ -183,7 +183,7 @@ OpenCLPlatform::PlatformData::PlatformData(const System& system, const string& p ...@@ -183,7 +183,7 @@ OpenCLPlatform::PlatformData::PlatformData(const System& system, const string& p
try { try {
for (int i = 0; i < (int) devices.size(); i++) { for (int i = 0; i < (int) devices.size(); i++) {
if (devices[i].length() > 0) { if (devices[i].length() > 0) {
unsigned int deviceIndex; int deviceIndex;
stringstream(devices[i]) >> deviceIndex; stringstream(devices[i]) >> deviceIndex;
contexts.push_back(new OpenCLContext(system, platformIndex, deviceIndex, precisionProperty, *this)); contexts.push_back(new OpenCLContext(system, platformIndex, deviceIndex, precisionProperty, *this));
} }
......
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