m4rs-mt / ILGPU

ILGPU JIT Compiler for high-performance .Net GPU programs
http://www.ilgpu.net
Other
1.38k stars 117 forks source link

Reworked builder.Debug semantics. #1103

Closed m4rs-mt closed 1 year ago

m4rs-mt commented 1 year ago

This PR reworks Debug functionality on context builders. Previously, calls to the Debug function would turn on O0 optimizations and some debugging features, leaving room for errors when building release configurations. However, with this new PR, everything changes as it provides a powerful new DebugConfig builder extension that offers fine grained control over debugging behavior. Note that DebugConfig settings are not affecting any release or O2 builds. This ensures maximum performance in release scenarios.

Old:

builder.Assertions().IOOperations()

Note that this setting would have affected Release and O2 builds automatically.

New:

builder.DebugConfiguration(enableAssertions: true, ioOperations: true)()

Note that this configuration will not affect Release and O2 builds by default.