Skip to content

Commit 5b7e23f

Browse files
authored
Added support for net70 SDK. (m4rs-mt#894)
1 parent 4e28899 commit 5b7e23f

25 files changed

+206
-70
lines changed

.github/workflows/ci.yml

+29-15
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,18 @@ jobs:
5959
with:
6060
fetch-depth: 0
6161

62+
- name: Setup the latest .NET 7 SDK
63+
uses: actions/[email protected]
64+
with:
65+
dotnet-version: 7.0.x
66+
6267
- name: Check Copyright Headers
6368
run: |
6469
dotnet run --configuration=Release -p:TreatWarningsAsErrors=true --project Tools/CopyrightUpdateTool
6570
if [[ -z "$(git status --porcelain)" ]]; then
6671
exit 0
6772
else
73+
git status --porcelain
6874
exit 1
6975
fi
7076
@@ -124,13 +130,13 @@ jobs:
124130
- name: Checkout
125131
uses: actions/checkout@v3
126132

127-
- name: Setup the latest .NET 6 SDK
133+
- name: Setup the latest .NET 7 SDK
128134
uses: actions/[email protected]
129135
with:
130-
dotnet-version: 6.0.x
136+
dotnet-version: 7.0.x
131137

132138
- name: Build
133-
run: dotnet build --configuration=Release -p:TreatWarningsAsErrors=true ${{ matrix.path }}
139+
run: dotnet build ${{ matrix.path }} --configuration=Release -p:TreatWarningsAsErrors=true
134140

135141
# Run tests for all supported combinations of OS/library/framework.
136142
test-library:
@@ -139,7 +145,7 @@ jobs:
139145
matrix:
140146
os: ${{ fromJson(needs.setup-os-matrix.outputs.os) }}
141147
library: [ILGPU, ILGPU.Algorithms]
142-
framework: [netcoreapp3.1, net5.0, net6.0]
148+
framework: [netcoreapp3.1, net5.0, net6.0, net7.0]
143149
include:
144150
- os: windows-latest
145151
library: ILGPU
@@ -153,6 +159,14 @@ jobs:
153159
- name: Checkout
154160
uses: actions/checkout@v3
155161

162+
- name: Setup the latest .NET Core 3.1 SDK
163+
if: matrix.framework == 'netcoreapp3.1'
164+
uses: actions/[email protected]
165+
env:
166+
DOTNET_INSTALL_DIR: ${{ matrix.framework == 'cuda' && '~/.' }}
167+
with:
168+
dotnet-version: 3.1.x
169+
156170
- name: Setup the latest .NET 5 SDK
157171
if: matrix.framework == 'net5.0'
158172
uses: actions/[email protected]
@@ -161,28 +175,28 @@ jobs:
161175
with:
162176
dotnet-version: 5.0.x
163177

164-
- name: Setup the latest .NET Core 3.1 SDK
165-
if: matrix.framework == 'netcoreapp3.1'
178+
- name: Setup the latest .NET 6 SDK
179+
if: matrix.framework == 'net6.0'
166180
uses: actions/[email protected]
167181
env:
168182
DOTNET_INSTALL_DIR: ${{ matrix.framework == 'cuda' && '~/.' }}
169183
with:
170-
dotnet-version: 3.1.x
184+
dotnet-version: 6.0.x
171185

172-
- name: Setup the latest .NET 6 SDK
186+
- name: Setup the latest .NET 7 SDK
173187
uses: actions/[email protected]
174188
env:
175189
DOTNET_INSTALL_DIR: ${{ matrix.framework == 'cuda' && '~/.' }}
176190
with:
177-
dotnet-version: 6.0.x
191+
dotnet-version: 7.0.x
178192

179193
- name: Set test flavor
180194
id: test-flavor
181195
shell: bash
182196
run: echo "flavor=$([[ "${{ matrix.os }}" == cuda-* ]] && echo "Cuda" || echo "CPU")" >> $GITHUB_OUTPUT
183197

184198
- name: Build and test
185-
run: dotnet test --configuration=Release --framework=${{ matrix.framework }} -p:TreatWarningsAsErrors=true --logger GitHubActions Src/${{ matrix.library }}.Tests.${{ steps.test-flavor.outputs.flavor }}
199+
run: dotnet test Src/${{ matrix.library }}.Tests.${{ steps.test-flavor.outputs.flavor }} --configuration=Release --framework=${{ matrix.framework }} -p:TreatWarningsAsErrors=true --logger GitHubActions
186200
env:
187201
ILGPU_CLEAN_TESTS: ${{ github.event_name == 'schedule' || (github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v'))) }}
188202

@@ -233,10 +247,10 @@ jobs:
233247
- name: Checkout
234248
uses: actions/checkout@v3
235249

236-
- name: Setup the latest .NET 6 SDK
250+
- name: Setup the latest .NET 7 SDK
237251
uses: actions/[email protected]
238252
with:
239-
dotnet-version: 6.0.x
253+
dotnet-version: 7.0.x
240254

241255
- name: Create NuGet packages
242256
run: |
@@ -246,7 +260,7 @@ jobs:
246260
$params = "--version-suffix", $suffix
247261
}
248262
249-
dotnet pack --configuration=Release @params Src
263+
dotnet pack Src --configuration=Release @params
250264
251265
- name: Fix NuGet Symbols Packages
252266
run: .github/workflows/Scripts/FixNugetSymbolPackages.ps1 -version "${{ needs.check-version.outputs.version }}"
@@ -267,10 +281,10 @@ jobs:
267281
- name: Checkout
268282
uses: actions/checkout@v3
269283

270-
- name: Setup the latest .NET 6 SDK
284+
- name: Setup the latest .NET 7 SDK
271285
uses: actions/[email protected]
272286
with:
273-
dotnet-version: 6.0.x
287+
dotnet-version: 7.0.x
274288

275289
# Change the ILGPU project references to NuGet package references
276290
- name: Update sample references

.github/workflows/codeql-analysis.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,23 @@ jobs:
1818
security-events: write
1919

2020
# GUI samples can only be built on Windows.
21-
# CodeQL does not yet support Windows Server 2022.
22-
# (see https://github.com/github/codeql-action/issues/850)
23-
runs-on: windows-2019
21+
runs-on: windows-latest
2422

2523
# Parallelize CodeQL building and analysis for performance reasons.
2624
strategy:
2725
fail-fast: false
2826
matrix:
2927
solution: [Src/ILGPU.sln, Samples/ILGPU.Samples.sln]
30-
framework: [net471, netcoreapp3.1, net5.0, net6.0]
28+
framework: [net471, netcoreapp3.1, net5.0, net6.0, net7.0]
3129

3230
steps:
3331
- name: Checkout repository
3432
uses: actions/checkout@v3
3533

36-
- name: Setup the latest .NET 6 SDK
37-
uses: actions/setup-dotnet@v2
34+
- name: Setup the latest .NET 7 SDK
35+
uses: actions/setup-dotnet@v3.0.3
3836
with:
39-
dotnet-version: '6.0.x'
37+
dotnet-version: 7.0.x
4038

4139
# Initializes the CodeQL tools for scanning.
4240
- name: Initialize CodeQL
@@ -60,6 +58,7 @@ jobs:
6058
"netcoreapp3.1" { $LibraryTargetFrameworks="netstandard2.1" }
6159
"net5.0" { $LibrarySamplesTargetFrameworksWindows="net5.0-windows" }
6260
"net6.0" { $LibrarySamplesTargetFrameworksWindows="net6.0-windows" }
61+
"net7.0" { $LibrarySamplesTargetFrameworksWindows="net7.0-windows" }
6362
}
6463
dotnet build -p:UseSharedCompilation=false `
6564
-p:LibraryTargetFrameworks=$LibraryTargetFrameworks `

Samples/BlazorSampleApp/BlazorSampleApp.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
</PropertyGroup>

Samples/Directory.Build.props

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<Project>
2-
<PropertyGroup Condition="'$(MSBuildVersion)' &gt;= '17.0'">
2+
<PropertyGroup Condition="'$(MSBuildVersion)' &gt;= '17.4'">
3+
<LibrarySamplesTargetFrameworks>net7.0</LibrarySamplesTargetFrameworks>
4+
<LibrarySamplesTargetFrameworksWindows>net7.0-windows</LibrarySamplesTargetFrameworksWindows>
5+
</PropertyGroup>
6+
<PropertyGroup Condition="'$(MSBuildVersion)' &gt;= '17.0' AND '$(MSBuildVersion)' &lt; '17.4'">
37
<LibrarySamplesTargetFrameworks>net6.0</LibrarySamplesTargetFrameworks>
48
<LibrarySamplesTargetFrameworksWindows>net6.0-windows</LibrarySamplesTargetFrameworksWindows>
59
</PropertyGroup>
@@ -16,8 +20,9 @@
1620
<LibrarySamplesTargetFrameworksWindows>net471</LibrarySamplesTargetFrameworksWindows>
1721
</PropertyGroup>
1822
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
19-
<LibrarySamplesTargetFrameworks>net471;netcoreapp3.1;net5.0;net6.0</LibrarySamplesTargetFrameworks>
20-
<LibrarySamplesTargetFrameworksWindows>net471;netcoreapp3.1;net5.0-windows;net6.0-windows</LibrarySamplesTargetFrameworksWindows>
23+
<LibrarySamplesTargetFrameworks>net471;netcoreapp3.1;net5.0;net6.0;net7.0</LibrarySamplesTargetFrameworks>
24+
<LibrarySamplesTargetFrameworksWindows>net471;netcoreapp3.1;net5.0-windows;net6.0-windows;net7.0-windows</LibrarySamplesTargetFrameworksWindows>
25+
<CheckEolTargetFramework>false</CheckEolTargetFramework>
2126
</PropertyGroup>
2227

2328
</Project>

Samples/MonitorProgress/CudaProgress.cs

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
using ILGPU.Runtime;
1414
using ILGPU.Runtime.Cuda;
1515
using System;
16+
using System.Diagnostics.CodeAnalysis;
1617

1718
#pragma warning disable CA2213
1819

@@ -83,6 +84,10 @@ protected override void MemSet(
8384
/// <summary>
8485
/// Holds the Cuda memory buffer that contains the progress value.
8586
/// </summary>
87+
[SuppressMessage(
88+
"Microsoft.Usage",
89+
"CA2213: Disposable fields should be disposed",
90+
Justification = "This is disposed in DisposeAcceleratorObject")]
8691
private readonly CudaProgressMemoryBuffer memoryBuffer;
8792

8893
/// <summary>

Src/Directory.Build.props

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<Project>
22
<!-- Library Project Configuration -->
33
<PropertyGroup>
4-
<LibraryTargetFrameworks>net6.0</LibraryTargetFrameworks>
4+
<LibraryTargetFrameworks>net7.0</LibraryTargetFrameworks>
55
</PropertyGroup>
66
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
7-
<LibraryTargetFrameworks>$(LibraryTargetFrameworks);net471;netstandard2.1;net5.0</LibraryTargetFrameworks>
7+
<LibraryTargetFrameworks>$(LibraryTargetFrameworks);net471;netstandard2.1;net5.0;net6.0</LibraryTargetFrameworks>
8+
<CheckEolTargetFramework>false</CheckEolTargetFramework>
89
</PropertyGroup>
910

1011
<PropertyGroup>
@@ -16,10 +17,11 @@
1617

1718
<!-- Unit Test Project Configuration -->
1819
<PropertyGroup>
19-
<LibraryUnitTestTargetFrameworks>net6.0</LibraryUnitTestTargetFrameworks>
20+
<LibraryUnitTestTargetFrameworks>net7.0</LibraryUnitTestTargetFrameworks>
2021
</PropertyGroup>
2122
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
22-
<LibraryUnitTestTargetFrameworks>$(LibraryUnitTestTargetFrameworks);net471;netcoreapp3.1;net5.0</LibraryUnitTestTargetFrameworks>
23+
<LibraryUnitTestTargetFrameworks>$(LibraryUnitTestTargetFrameworks);net471;netcoreapp3.1;net5.0;net6.0</LibraryUnitTestTargetFrameworks>
24+
<CheckEolTargetFramework>false</CheckEolTargetFramework>
2325
</PropertyGroup>
2426

2527
<Import Project="..\Tools\CheckStyles\ILGPU.CheckStyles.targets" />

Src/ILGPU.Algorithms/ILGPU.Algorithms.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1515
<NeutralLanguage>en-US</NeutralLanguage>
1616
<!-- CAUTION: ILGPU supports a limited subset only - due to the .Net 4.7 backwards compatibility -->
17-
<LangVersion>8.0</LangVersion>
17+
<LangVersion>9.0</LangVersion>
1818
</PropertyGroup>
1919

2020
<PropertyGroup>

Src/ILGPU.Algorithms/RadixSortExtensions.cs

+5
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
using ILGPU.Util;
1818
using System;
1919
using System.Diagnostics;
20+
using System.Diagnostics.CodeAnalysis;
2021
using System.Reflection;
2122
using System.Runtime.CompilerServices;
2223

@@ -168,6 +169,10 @@ public sealed class RadixSortProvider : AlgorithmObject
168169
{
169170
#region Instance
170171

172+
[SuppressMessage(
173+
"Microsoft.Usage",
174+
"CA2213: Disposable fields should be disposed",
175+
Justification = "This is disposed in DisposeAccelerator")]
171176
private readonly MemoryBuffer1D<int, Stride1D.Dense> tempBuffer;
172177

173178
internal RadixSortProvider(Accelerator accelerator, int tempSize)

Src/ILGPU.Algorithms/Random/RNG.cs

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
using ILGPU.Runtime;
1414
using System;
1515
using System.Diagnostics;
16+
using System.Diagnostics.CodeAnalysis;
1617
using System.Runtime.CompilerServices;
1718

1819
namespace ILGPU.Algorithms.Random
@@ -327,6 +328,10 @@ public readonly void Finish() { }
327328
/// <summary>
328329
/// Stores a single RNG instance per warp.
329330
/// </summary>
331+
[SuppressMessage(
332+
"Microsoft.Usage",
333+
"CA2213: Disposable fields should be disposed",
334+
Justification = "This is disposed in DisposeAccelerator")]
330335
private readonly MemoryBuffer1D<
331336
TRandomProvider,
332337
Stride1D.Dense> randomProvidersPerWarp;

Src/ILGPU.Algorithms/Runtime/Cuda/CuFFTWStructs.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ---------------------------------------------------------------------------------------
22
// ILGPU Algorithms
3-
// Copyright (c) 2021 ILGPU Project
3+
// Copyright (c) 2021-2022 ILGPU Project
44
// www.ilgpu.net
55
//
66
// File: CuFFTWStructs.cs
@@ -13,6 +13,7 @@
1313

1414
#pragma warning disable CA1051 // Do not declare visible instance fields
1515
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
16+
#pragma warning disable CS8981 // The type name only contains lower-cased ascii characters
1617
#pragma warning disable IDE1006 // Naming Styles
1718

1819
namespace ILGPU.Runtime.Cuda
@@ -34,4 +35,5 @@ public struct iodim64
3435

3536
#pragma warning restore CA1051 // Do not declare visible instance fields
3637
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
38+
#pragma warning restore CS8981 // The type name only contains lower-cased ascii characters
3739
#pragma warning restore IDE1006 // Naming Styles

Src/ILGPU.Algorithms/ScanExtensions.cs

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
using ILGPU.Algorithms.ScanReduceOperations;
1414
using ILGPU.Runtime;
1515
using System;
16+
using System.Diagnostics.CodeAnalysis;
1617
using System.Runtime.CompilerServices;
1718
using static ILGPU.Algorithms.GroupExtensions;
1819

@@ -84,6 +85,10 @@ public sealed class ScanProvider : AlgorithmObject
8485
{
8586
#region Instance
8687

88+
[SuppressMessage(
89+
"Microsoft.Usage",
90+
"CA2213: Disposable fields should be disposed",
91+
Justification = "This is disposed in DisposeAccelerator")]
8792
private readonly MemoryBuffer1D<int, Stride1D.Dense> tempBuffer;
8893

8994
internal ScanProvider(Accelerator accelerator, LongIndex1D dataLength)

0 commit comments

Comments
 (0)