Skip to content
Snippets Groups Projects
Commit 178034a2 authored by Oren's avatar Oren
Browse files

unified use of get platform list

parent 8df1f7ee
No related branches found
No related tags found
No related merge requests found
......@@ -39,13 +39,13 @@ public abstract class Device{
public static Device getDevice(String platformName, String deviceTypeName, int deviceId)
{
List<OpenCLPlatform> platforms = (new OpenCLPlatform()).getOpenCLPlatforms();
List<OpenCLPlatform> platforms = (new OpenCLPlatform()).getOpenCLPlatformsFilteredBy(platformName); //getOpenCLPlatforms();
int platformc = 0;
for (OpenCLPlatform platform : platforms)
{
if(platform.getName().contains(platformName))
{
//if(platform.getName().contains(platformName))
//{
System.out.println("Platform " + platformc + "{");
......@@ -104,7 +104,7 @@ public abstract class Device{
}
}
//}
// return not found !!!
return null;
}
......
......@@ -81,13 +81,17 @@ public class OpenCLPlatform extends OpenCLJNI{
System.out.println("Filtering Platforms using: " + filter );
for (Iterator<OpenCLPlatform> iterator = platformList.iterator(); iterator.hasNext(); )
{
String platformIName = iterator.next().getName();
System.out.println("Checking Platform: " + platformIName );
if (!platformIName.contains(filter))
String platformName = iterator.next().getName();
if (filter.equals("*") || platformName.contains(filter))
{
System.out.println("Filtering Out Platform: " + platformIName);
System.out.println("Adding Platform: " + platformName );
}
else
{
System.out.println("Discarding Platform: " + platformName);
iterator.remove();
}
}
}
}
return (platformList);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment