FLACCL: Display OpenCL driver version

This commit is contained in:
Grigory Chudov
2013-06-26 20:19:17 -04:00
parent 5c2ffab0f9
commit 3c227b8710
2 changed files with 13 additions and 2 deletions

View File

@@ -28,6 +28,7 @@ using System.Runtime.InteropServices;
using CUETools.Codecs; using CUETools.Codecs;
using CUETools.Codecs.FLAKE; using CUETools.Codecs.FLAKE;
using OpenCLNet; using OpenCLNet;
using System.Xml.Serialization;
namespace CUETools.Codecs.FLACCL namespace CUETools.Codecs.FLACCL
{ {
@@ -84,6 +85,7 @@ namespace CUETools.Codecs.FLACCL
string.Join(", ", (new List<Platform>(OpenCL.GetPlatforms())).ConvertAll(p => "\"" + p.Name + "\"").ToArray())); string.Join(", ", (new List<Platform>(OpenCL.GetPlatforms())).ConvertAll(p => "\"" + p.Name + "\"").ToArray()));
} }
Platform = OpenCL.GetPlatform(m_platform).Name; Platform = OpenCL.GetPlatform(m_platform).Name;
PlatformVersion = OpenCL.GetPlatform(m_platform).Version;
{ {
//var device = OpenCL.GetPlatform(m_platform).GetDevice(OpenCL.GetPlatform(m_platform).QueryDeviceIntPtr()[0]); //var device = OpenCL.GetPlatform(m_platform).GetDevice(OpenCL.GetPlatform(m_platform).QueryDeviceIntPtr()[0]);
var devices = new List<Device>(OpenCL.GetPlatform(m_platform).QueryDevices((DeviceType)DeviceType)); var devices = new List<Device>(OpenCL.GetPlatform(m_platform).QueryDevices((DeviceType)DeviceType));
@@ -94,6 +96,7 @@ namespace CUETools.Codecs.FLACCL
throw new Exception("no OpenCL devices found that matched filter criteria"); throw new Exception("no OpenCL devices found that matched filter criteria");
m_device = devices[0].DeviceID; m_device = devices[0].DeviceID;
Device = devices[0].Name; Device = devices[0].Name;
DriverVersion = devices[0].DriverVersion;
} }
SetDefaultValuesForMode(); SetDefaultValuesForMode();
if (Padding < 0) if (Padding < 0)
@@ -202,6 +205,7 @@ namespace CUETools.Codecs.FLACCL
//[TypeConverter(typeof(FLACCLWriterSettingsDeviceConverter))] //[TypeConverter(typeof(FLACCLWriterSettingsDeviceConverter))]
[SRDescription(typeof(Properties.Resources), "DescriptionDevice")] [SRDescription(typeof(Properties.Resources), "DescriptionDevice")]
[XmlIgnore]
[Browsable(false)] [Browsable(false)]
public string Device { get; set; } public string Device { get; set; }
@@ -213,6 +217,14 @@ namespace CUETools.Codecs.FLACCL
[DisplayName("Allow Non-subset")] [DisplayName("Allow Non-subset")]
[SRDescription(typeof(Properties.Resources), "AllowNonSubsetDescription")] [SRDescription(typeof(Properties.Resources), "AllowNonSubsetDescription")]
public bool AllowNonSubset { get; set; } public bool AllowNonSubset { get; set; }
[XmlIgnore]
[Browsable(false)]
public string PlatformVersion { get; set; }
[XmlIgnore]
[Browsable(false)]
public string DriverVersion { get; set; }
} }
public class FLACCLWriterSettingsPlatformConverter : TypeConverter public class FLACCLWriterSettingsPlatformConverter : TypeConverter

View File

@@ -311,8 +311,7 @@ namespace CUETools.FLACCL.cmd
{ {
Console.WriteLine("Filename : {0}", input_file); Console.WriteLine("Filename : {0}", input_file);
Console.WriteLine("File Info : {0}kHz; {1} channel; {2} bit; {3}", audioSource.PCM.SampleRate, audioSource.PCM.ChannelCount, audioSource.PCM.BitsPerSample, TimeSpan.FromSeconds(audioSource.Length * 1.0 / audioSource.PCM.SampleRate)); Console.WriteLine("File Info : {0}kHz; {1} channel; {2} bit; {3}", audioSource.PCM.SampleRate, audioSource.PCM.ChannelCount, audioSource.PCM.BitsPerSample, TimeSpan.FromSeconds(audioSource.Length * 1.0 / audioSource.PCM.SampleRate));
Console.WriteLine("Platform : {0}", settings.Platform); Console.WriteLine("Device : {0}, Platform: \"{1}\", Version: {2}, Driver: {3}", settings.Device.Trim(), settings.Platform, settings.PlatformVersion.Trim(), settings.DriverVersion.Trim());
Console.WriteLine("Device : {0}", settings.Device);
} }
bool keepRunning = true; bool keepRunning = true;