public static function getDevices(Platform $platform = null, $type = Cl::DEVICE_TYPE_DEFAULT) { $platformId = $platform ? $platform->getId() : null; $devices = array(); foreach (cl_get_device_ids($platformId, $type) as $deviceId) { $devices[] = new Device($deviceId); } return $devices; }
public static function createSomeContext() { $platforms = Platform::getPlatforms(); foreach ($platforms as $platform) { $devices = $platform->getDevices(self::DEVICE_TYPE_ALL); foreach ($devices as $device) { return new Context($device); } } return null; }