-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed retrieving kernel object from launchers with implicit stream.
- Loading branch information
Showing
3 changed files
with
125 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
// --------------------------------------------------------------------------------------- | ||
// ILGPU | ||
// Copyright (c) 2022 ILGPU Project | ||
// www.ilgpu.net | ||
// | ||
// File: GetKernelTests.cs | ||
// | ||
// This file is part of ILGPU and is distributed under the University of Illinois Open | ||
// Source License. See LICENSE.txt for details. | ||
// --------------------------------------------------------------------------------------- | ||
|
||
using ILGPU.Runtime; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
namespace ILGPU.Tests | ||
{ | ||
public abstract class GetKernelTests : TestBase | ||
{ | ||
protected GetKernelTests(ITestOutputHelper output, TestContext testContext) | ||
: base(output, testContext) | ||
{ } | ||
|
||
[Fact] | ||
public void LoadAutoGroupedKernel() | ||
{ | ||
var launcher = | ||
Accelerator.LoadAutoGroupedKernel<Index1D, ArrayView<int>>( | ||
(index, view) => | ||
{ | ||
view[index] = index; | ||
}); | ||
|
||
var kernel = launcher.GetKernel(); | ||
Assert.NotNull(kernel); | ||
} | ||
|
||
[Fact] | ||
public void LoadAutoGroupedStreamKernel() | ||
{ | ||
var launcher = | ||
Accelerator.LoadAutoGroupedStreamKernel<Index1D, ArrayView<int>>( | ||
(index, view) => | ||
{ | ||
view[index] = index; | ||
}); | ||
|
||
var kernel = launcher.GetKernel(); | ||
Assert.NotNull(kernel); | ||
} | ||
|
||
[Fact] | ||
public void LoadKernel() | ||
{ | ||
var launcher = | ||
Accelerator.LoadKernel<Index1D, ArrayView<int>>( | ||
(index, view) => | ||
{ | ||
view[index] = index; | ||
}); | ||
|
||
var kernel = launcher.GetKernel(); | ||
Assert.NotNull(kernel); | ||
} | ||
|
||
[Fact] | ||
public void LoadStreamKernel() | ||
{ | ||
var launcher = | ||
Accelerator.LoadStreamKernel<Index1D, ArrayView<int>>( | ||
(index, view) => | ||
{ | ||
view[index] = index; | ||
}); | ||
|
||
var kernel = launcher.GetKernel(); | ||
Assert.NotNull(kernel); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters