Skip to content

Commit eb59a70

Browse files
author
Jack Dermody
committed
buffers refactor
1 parent 50213f9 commit eb59a70

34 files changed

+551
-234
lines changed

BrightData.Cuda/BrightData.Cuda.csproj

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<Version>3.0.0-beta</Version>
6+
<Authors>Jack Dermody</Authors>
7+
<Company />
8+
<Product />
9+
<PackageLicenseFile>LICENSE</PackageLicenseFile>
10+
<RepositoryUrl>https://github.com/jdermody/brightwire</RepositoryUrl>
11+
<PackageProjectUrl>https://github.com/jdermody/brightwire</PackageProjectUrl>
12+
<Description>Cuda provider for Bright Data - allows GPU computation</Description>
13+
<Copyright>Copyright © Jack Dermody 2016-2021</Copyright>
14+
<PackageTags>cuda gpu</PackageTags>
15+
<PackageIcon>bw_favicon.png</PackageIcon>
16+
<PackageReleaseNotes>Beta release</PackageReleaseNotes>
517
</PropertyGroup>
618

719
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
@@ -12,6 +24,30 @@
1224
<Compile Remove="Properties\**" />
1325
<EmbeddedResource Remove="Properties\**" />
1426
<None Remove="Properties\**" />
27+
<None Remove="cuda\brightwire.ptx" />
28+
<Content Include="cuda\brightwire.ptx">
29+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
30+
</Content>
31+
<None Include="..\bw_favicon.png">
32+
<Pack>True</Pack>
33+
<PackagePath></PackagePath>
34+
</None>
35+
<None Include="..\LICENSE">
36+
<Pack>True</Pack>
37+
<PackagePath></PackagePath>
38+
</None>
39+
<None Include="managed-cuda\CudaBlas.netCore.dll">
40+
<Pack>True</Pack>
41+
<PackagePath>lib/netcoreapp3.1</PackagePath>
42+
</None>
43+
<None Include="managed-cuda\CudaSolve.netCore.dll">
44+
<Pack>True</Pack>
45+
<PackagePath>lib/netcoreapp3.1</PackagePath>
46+
</None>
47+
<None Include="managed-cuda\ManagedCuda.netCore.dll">
48+
<Pack>True</Pack>
49+
<PackagePath>lib/netcoreapp3.1</PackagePath>
50+
</None>
1551
</ItemGroup>
1652

1753
<ItemGroup>
@@ -34,10 +70,4 @@
3470
</Reference>
3571
</ItemGroup>
3672

37-
<ItemGroup>
38-
<None Update="cuda\brightwire.ptx">
39-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
40-
</None>
41-
</ItemGroup>
42-
4373
</Project>

BrightData.Numerics/BrightData.Numerics.csproj

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<Version>3.0.0-beta</Version>
6+
<Authors>Jack Dermody</Authors>
7+
<Product>Bright ML</Product>
8+
<Description>Numerics provider for Bright Data - allows CPU computation, including with MKL</Description>
9+
<Copyright>Copyright © Jack Dermody 2016-2021</Copyright>
10+
<PackageLicenseFile>LICENSE</PackageLicenseFile>
11+
<PackageProjectUrl>https://github.com/jdermody/brightwire</PackageProjectUrl>
12+
<RepositoryUrl>https://github.com/jdermody/brightwire</RepositoryUrl>
13+
<PackageTags>mkl</PackageTags>
14+
<PackageIcon>bw_favicon.png</PackageIcon>
15+
<PackageReleaseNotes>Beta release</PackageReleaseNotes>
516
</PropertyGroup>
617

718
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
@@ -16,4 +27,15 @@
1627
<ProjectReference Include="..\BrightData\BrightData.csproj" />
1728
</ItemGroup>
1829

30+
<ItemGroup>
31+
<None Include="..\bw_favicon.png">
32+
<Pack>True</Pack>
33+
<PackagePath></PackagePath>
34+
</None>
35+
<None Include="..\LICENSE">
36+
<Pack>True</Pack>
37+
<PackagePath></PackagePath>
38+
</None>
39+
</ItemGroup>
40+
1941
</Project>

BrightData.UnitTests/BufferTests.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.IO;
4+
using System.Text;
45
using Xunit;
56
using BrightData.Buffer;
67
using FluentAssertions;
@@ -99,10 +100,11 @@ void StringBufferReadWriteTest(IBrightDataContext context, uint numItems, uint b
99100
using var stream = new MemoryStream();
100101
buffer.CopyTo(stream);
101102
stream.Seek(0, SeekOrigin.Begin);
103+
using var reader = new BinaryReader(stream, Encoding.UTF8, true);
102104

103105
uint index = 0;
104-
var reader = context.GetReader<string>(stream, inMemoryReadSize);
105-
foreach (var item in reader.EnumerateTyped())
106+
var bufferReader = context.GetBufferReader<string>(reader, inMemoryReadSize);
107+
foreach (var item in bufferReader.EnumerateTyped())
106108
item.Should().Be(indexTranslator(index++));
107109
}
108110

@@ -115,10 +117,11 @@ void ObjectBufferReadWriteTest<T>(IBrightDataContext context, uint numItems, uin
115117
using var stream = new MemoryStream();
116118
buffer.CopyTo(stream);
117119
stream.Seek(0, SeekOrigin.Begin);
120+
using var reader = new BinaryReader(stream, Encoding.UTF8, true);
118121

119122
uint index = 0;
120-
var reader = context.GetReader<T>(stream, inMemoryReadSize);
121-
foreach (var item in reader.EnumerateTyped())
123+
var bufferReader = context.GetBufferReader<T>(reader, inMemoryReadSize);
124+
foreach (var item in bufferReader.EnumerateTyped())
122125
item.Should().Be(indexTranslator(index++));
123126
}
124127

@@ -131,10 +134,11 @@ void StructBufferReadWriteTest<T>(IBrightDataContext context, uint numItems, uin
131134
using var stream = new MemoryStream();
132135
buffer.CopyTo(stream);
133136
stream.Seek(0, SeekOrigin.Begin);
137+
using var reader = new BinaryReader(stream, Encoding.UTF8, true);
134138

135139
uint index = 0;
136-
var reader = context.GetReader<T>(stream, inMemoryReadSize);
137-
foreach (var item in reader.EnumerateTyped())
140+
var bufferReader = context.GetBufferReader<T>(reader, inMemoryReadSize);
141+
foreach (var item in bufferReader.EnumerateTyped())
138142
item.Should().Be(indexTranslator(index++));
139143
}
140144
}

BrightData/BrightData.csproj

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@
33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.1</TargetFramework>
55
<Nullable>enable</Nullable>
6+
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
7+
<Version>3.0.0-beta</Version>
8+
<PackageLicenseFile>LICENSE</PackageLicenseFile>
9+
<PackageProjectUrl>https://github.com/jdermody/brightwire</PackageProjectUrl>
10+
<RepositoryUrl>https://github.com/jdermody/brightwire</RepositoryUrl>
11+
<Authors>Jack Dermody</Authors>
12+
<Company />
13+
<Product>Bright ML</Product>
14+
<Description>Bright data is a performance oriented data table and linear algebra library that supports both CPU and GPU computation</Description>
15+
<Copyright>Copyright © Jack Dermody 2016-2021</Copyright>
16+
<PackageIcon>bw_favicon.png</PackageIcon>
17+
<PackageReleaseNotes>Beta release</PackageReleaseNotes>
618
</PropertyGroup>
719

820
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -20,4 +32,15 @@
2032
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="5.0.0" />
2133
</ItemGroup>
2234

35+
<ItemGroup>
36+
<None Include="..\bw_favicon.png">
37+
<Pack>True</Pack>
38+
<PackagePath></PackagePath>
39+
</None>
40+
<None Include="..\LICENSE">
41+
<Pack>True</Pack>
42+
<PackagePath></PackagePath>
43+
</None>
44+
</ItemGroup>
45+
2346
</Project>

0 commit comments

Comments
 (0)