mirror of
https://github.com/aaru-dps/AaruBenchmark.git
synced 2025-12-16 19:24:36 +00:00
Add native nuget.
This commit is contained in:
@@ -61,6 +61,7 @@
|
||||
<Compile Include="CRC32\arm_simd.cs" />
|
||||
<Compile Include="CRC32\vmull.cs" />
|
||||
<Compile Include="CRC64\clmul.cs" />
|
||||
<Compile Include="Native.cs" />
|
||||
<Compile Include="SpamSumContext.cs" />
|
||||
<Compile Include="Adler32Context.cs" />
|
||||
<Compile Include="CRC16Context.cs" />
|
||||
@@ -74,6 +75,7 @@
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Aaru.Checksums.Native" Version="6.0.0-alpha6" />
|
||||
<PackageReference Include="Aaru.CommonTypes" Version="5.3.0" />
|
||||
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.4.1" PrivateAssets="all" />
|
||||
</ItemGroup>
|
||||
|
||||
41
Aaru6.Checksums/Native.cs
Normal file
41
Aaru6.Checksums/Native.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Aaru6.Checksums
|
||||
{
|
||||
public static class Native
|
||||
{
|
||||
static bool _checked;
|
||||
static bool _supported;
|
||||
|
||||
public static bool IsSupported
|
||||
{
|
||||
get
|
||||
{
|
||||
if(_checked)
|
||||
return _supported;
|
||||
|
||||
ulong version;
|
||||
_checked = true;
|
||||
|
||||
try
|
||||
{
|
||||
version = get_acn_version();
|
||||
}
|
||||
catch
|
||||
{
|
||||
_supported = false;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: Check version compatibility
|
||||
_supported = version >= 0x06000000;
|
||||
|
||||
return _supported;
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport("libAaru.Checksums.Native", SetLastError = true)]
|
||||
static extern ulong get_acn_version();
|
||||
}
|
||||
}
|
||||
@@ -13,21 +13,21 @@ namespace AaruBenchmark
|
||||
{
|
||||
var config = ManualConfig.Create(DefaultConfig.Instance);
|
||||
|
||||
/* BenchmarkRunner.Run<GzipBenchs>(config);
|
||||
BenchmarkRunner.Run<GzipBenchs>(config);
|
||||
BenchmarkRunner.Run<Bzip2Benchs>(config);
|
||||
BenchmarkRunner.Run<Adler32Benchs>(config);
|
||||
BenchmarkRunner.Run<Crc16CcittBenchs>(config);
|
||||
BenchmarkRunner.Run<Crc16Benchs>(config);
|
||||
BenchmarkRunner.Run<Crc32Benchs>(config);
|
||||
BenchmarkRunner.Run<Crc64Benchs>(config);
|
||||
BenchmarkRunner.Run<Fletcher16Benchs>(config);*/
|
||||
BenchmarkRunner.Run<Fletcher16Benchs>(config);
|
||||
BenchmarkRunner.Run<Fletcher32Benchs>(config);
|
||||
/* BenchmarkRunner.Run<Md5Benchs>(config);
|
||||
BenchmarkRunner.Run<Md5Benchs>(config);
|
||||
BenchmarkRunner.Run<Sha1Benchs>(config);
|
||||
BenchmarkRunner.Run<Sha256Benchs>(config);
|
||||
BenchmarkRunner.Run<Sha384Benchs>(config);
|
||||
BenchmarkRunner.Run<Sha512Benchs>(config);
|
||||
BenchmarkRunner.Run<SpamSumBenchs>(config);*/
|
||||
BenchmarkRunner.Run<SpamSumBenchs>(config);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user