A .NET library to run C# code in parallel on the GPU through DX12, D2D1, and dynamically generated HLSL compute and pixel shaders, with the goal of making GPU computing easy to use for all .NET developers! 🚀
When this library is used, it requires the referencing project to enable unsafe code, which is fine. However, it also forces anything that depends on that project to enable unsafe code.
Reproduction Steps
Create a C# library.
Reference ComputeSharp from the library.
Allow unsafe blocks in the library.
Create a C# console application.
Reference the library from the console application.
Notice that the console application fails to compile.
Expected Behavior
ComputeSharp should be more surgical about requesting to allow unsafe blocks. Ideally, it would only request in projects that require its source generation functionality.
Actual Behavior
It emits an error in any project that transiently references it if that project does not allow unsafe blocks.
System info
This section should contain useful info such as:
ComputeSharp NuGet version : 3.0.0
Operating system version : Windows 10
Visual Studio version, or .NET SDK/runtime version : .NET 8
Workaround
Affected users can apply <NoWarn>CMPS0052</NoWarn> in projects that don't use ComputeSharp directly.
Description
When this library is used, it requires the referencing project to enable unsafe code, which is fine. However, it also forces anything that depends on that project to enable unsafe code.
Reproduction Steps
Expected Behavior
ComputeSharp should be more surgical about requesting to allow unsafe blocks. Ideally, it would only request in projects that require its source generation functionality.
Actual Behavior
It emits an error in any project that transiently references it if that project does not allow unsafe blocks.
System info
This section should contain useful info such as:
Workaround
Affected users can apply
<NoWarn>CMPS0052</NoWarn>
in projects that don't use ComputeSharp directly.