mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
FLACCL: Display OpenCL driver version
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user