diff --git a/tests/ComputeSharp.Tests/ComputeContextTests.cs b/tests/ComputeSharp.Tests/ComputeContextTests.cs index a2e30dee..907818cc 100644 --- a/tests/ComputeSharp.Tests/ComputeContextTests.cs +++ b/tests/ComputeSharp.Tests/ComputeContextTests.cs @@ -446,6 +446,8 @@ public partial class ComputeContextTests } } + _ = device.Get(); + Parallel.For(0, 64, _ => Test(device)); } @@ -461,6 +463,8 @@ public partial class ComputeContextTests } } + _ = device.Get(); + await Task.Run(() => Test(device)); } @@ -519,6 +523,8 @@ public partial class ComputeContextTests [AllDevices] public async Task ForAndForEach_Async_Batched_WithTaskRun(Device device) { + _ = device.Get(); + await Task.Run(() => ForAndForEach_Async_Batched(device)); } @@ -534,6 +540,8 @@ public partial class ComputeContextTests } } + _ = device.Get(); + await Task.WhenAll(Enumerable.Range(0, 64).Select(_ => TestAsync(device))); } @@ -549,6 +557,8 @@ public partial class ComputeContextTests } } + _ = device.Get(); + await Task.WhenAll(Enumerable.Range(0, 64).Select(_ => TestAsync(device))); } @@ -564,6 +574,8 @@ public partial class ComputeContextTests } } + _ = device.Get(); + await Task.WhenAll(Enumerable.Range(0, 64).Select(_ => Task.Run(() => TestAsync(device)))); } @@ -579,6 +591,8 @@ public partial class ComputeContextTests } } + _ = device.Get(); + await Task.WhenAll(Enumerable.Range(0, 64).Select(_ => Task.Run(() => TestAsync(device)))); } @@ -598,6 +612,8 @@ public partial class ComputeContextTests } } + _ = device.Get(); + await Task.WhenAll(Enumerable.Range(0, 64).Select(_ => TestAsync(device))); } @@ -617,6 +633,8 @@ public partial class ComputeContextTests } } + _ = device.Get(); + await Task.WhenAll(Enumerable.Range(0, 64).Select(_ => TestAsync(device))); } @@ -636,6 +654,8 @@ public partial class ComputeContextTests } } + _ = device.Get(); + await Task.WhenAll(Enumerable.Range(0, 64).Select(_ => Task.Run(() => TestAsync(device)))); } @@ -655,6 +675,8 @@ public partial class ComputeContextTests } } + _ = device.Get(); + await Task.WhenAll(Enumerable.Range(0, 64).Select(_ => Task.Run(() => TestAsync(device)))); }