Skip to content

Commit

Permalink
Switch to warning severity
Browse files Browse the repository at this point in the history
  • Loading branch information
Yey007 committed Mar 30, 2024
1 parent ed021bb commit 7eef5d5
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
Id: ILA004,
Title: Array of reference types in kernel,
Severity: Error,
Severity: Warning,
WarningLevel: 0,
Location: : (29,25)-(29,42),
MessageFormat: Type '{0}' is an array of type '{1}', which is a reference type. Arrays of reference types cannot be used in kernels.,
Expand All @@ -12,7 +12,7 @@
{
Id: ILA003,
Title: Reference type in kernel,
Severity: Error,
Severity: Warning,
WarningLevel: 0,
Location: : (29,27)-(29,40),
MessageFormat: Type '{0}' is a reference type. Reference types like classes cannot be used in kernels, except for arrays of value types.,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
Id: ILA003,
Title: Reference type in kernel,
Severity: Error,
Severity: Warning,
WarningLevel: 0,
Location: : (17,20)-(17,33),
MessageFormat: Type '{0}' is a reference type. Reference types like classes cannot be used in kernels, except for arrays of value types.,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
Id: ILA003,
Title: Reference type in kernel,
Severity: Error,
Severity: Warning,
WarningLevel: 0,
Location: : (20,27)-(20,40),
MessageFormat: Type '{0}' is a reference type. Reference types like classes cannot be used in kernels, except for arrays of value types.,
Expand All @@ -12,7 +12,7 @@
{
Id: ILA003,
Title: Reference type in kernel,
Severity: Error,
Severity: Warning,
WarningLevel: 0,
Location: : (14,27)-(14,40),
MessageFormat: Type '{0}' is a reference type. Reference types like classes cannot be used in kernels, except for arrays of value types.,
Expand All @@ -22,7 +22,7 @@
{
Id: ILA003,
Title: Reference type in kernel,
Severity: Error,
Severity: Warning,
WarningLevel: 0,
Location: : (32,15)-(32,28),
MessageFormat: Type '{0}' is a reference type. Reference types like classes cannot be used in kernels, except for arrays of value types.,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
Id: ILA003,
Title: Reference type in kernel,
Severity: Error,
Severity: Warning,
WarningLevel: 0,
Location: : (14,21)-(14,34),
MessageFormat: Type '{0}' is a reference type. Reference types like classes cannot be used in kernels, except for arrays of value types.,
Expand All @@ -12,7 +12,7 @@
{
Id: ILA003,
Title: Reference type in kernel,
Severity: Error,
Severity: Warning,
WarningLevel: 0,
Location: : (19,21)-(19,34),
MessageFormat: Type '{0}' is a reference type. Reference types like classes cannot be used in kernels, except for arrays of value types.,
Expand All @@ -22,7 +22,7 @@
{
Id: ILA003,
Title: Reference type in kernel,
Severity: Error,
Severity: Warning,
WarningLevel: 0,
Location: : (24,21)-(24,34),
MessageFormat: Type '{0}' is a reference type. Reference types like classes cannot be used in kernels, except for arrays of value types.,
Expand All @@ -32,7 +32,7 @@
{
Id: ILA003,
Title: Reference type in kernel,
Severity: Error,
Severity: Warning,
WarningLevel: 0,
Location: : (29,21)-(29,34),
MessageFormat: Type '{0}' is a reference type. Reference types like classes cannot be used in kernels, except for arrays of value types.,
Expand All @@ -42,7 +42,7 @@
{
Id: ILA003,
Title: Reference type in kernel,
Severity: Error,
Severity: Warning,
WarningLevel: 0,
Location: : (34,21)-(34,34),
MessageFormat: Type '{0}' is a reference type. Reference types like classes cannot be used in kernels, except for arrays of value types.,
Expand All @@ -52,7 +52,7 @@
{
Id: ILA003,
Title: Reference type in kernel,
Severity: Error,
Severity: Warning,
WarningLevel: 0,
Location: : (39,21)-(39,34),
MessageFormat: Type '{0}' is a reference type. Reference types like classes cannot be used in kernels, except for arrays of value types.,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
Id: ILA003,
Title: Reference type in kernel,
Severity: Error,
Severity: Warning,
WarningLevel: 0,
Location: : (40,22)-(40,35),
MessageFormat: Type '{0}' is a reference type. Reference types like classes cannot be used in kernels, except for arrays of value types.,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
Id: ILA003,
Title: Reference type in kernel,
Severity: Error,
Severity: Warning,
WarningLevel: 0,
Location: : (13,22)-(13,35),
MessageFormat: Type '{0}' is a reference type. Reference types like classes cannot be used in kernels, except for arrays of value types.,
Expand All @@ -12,7 +12,7 @@
{
Id: ILA003,
Title: Reference type in kernel,
Severity: Error,
Severity: Warning,
WarningLevel: 0,
Location: : (14,38)-(14,45),
MessageFormat: Type '{0}' is a reference type. Reference types like classes cannot be used in kernels, except for arrays of value types.,
Expand Down
12 changes: 6 additions & 6 deletions Src/ILGPU.Analyzers/AnalyzerReleases.Unshipped.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

### New Rules

Rule ID | Category | Severity | Notes
--------|----------|----------|-------
ILA001 | CodeGeneration | Error | SourceGenerator
ILA002 | CodeGeneration | Error | SourceGenerator
ILA003 | Usage | Error | Analyzer
ILA004 | Usage | Error | Analyzer
| Rule ID | Category | Severity | Notes |
|---------|----------------|----------|-----------------|
| ILA001 | CodeGeneration | Error | SourceGenerator |
| ILA002 | CodeGeneration | Error | SourceGenerator |
| ILA003 | Usage | Warning | Analyzer |
| ILA004 | Usage | Warning | Analyzer |
5 changes: 3 additions & 2 deletions Src/ILGPU.Analyzers/ReferenceTypeAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class ReferenceTypeAnalyzer : KernelAnalyzer
title: ErrorMessages.RefTypeInKernel_Title,
messageFormat: ErrorMessages.RefTypeInKernel_Message,
category: DiagnosticCategory.Usage,
defaultSeverity: DiagnosticSeverity.Error,
defaultSeverity: DiagnosticSeverity.Warning,
isEnabledByDefault: true
);

Expand All @@ -35,7 +35,7 @@ public class ReferenceTypeAnalyzer : KernelAnalyzer
title: ErrorMessages.RefTypeArrInKernel_Title,
messageFormat: ErrorMessages.RefTypeArrInKernel_Message,
category: DiagnosticCategory.Usage,
defaultSeverity: DiagnosticSeverity.Error,
defaultSeverity: DiagnosticSeverity.Warning,
isEnabledByDefault: true
);

Expand Down Expand Up @@ -129,6 +129,7 @@ private void AnalyzeKernelOperation(OperationAnalysisContext context,
return null;
}

// TODO: test that ILGPU symbols are skipped
private bool IsILGPUSymbol(ISymbol symbol)
{
return symbol.ContainingAssembly.Name == ILGPUAssemblyName;
Expand Down

0 comments on commit 7eef5d5

Please sign in to comment.