ZeroCompute.Core
1.0.0
dotnet add package ZeroCompute.Core --version 1.0.0
NuGet\Install-Package ZeroCompute.Core -Version 1.0.0
<PackageReference Include="ZeroCompute.Core" Version="1.0.0" />
<PackageVersion Include="ZeroCompute.Core" Version="1.0.0" />
<PackageReference Include="ZeroCompute.Core" />
paket add ZeroCompute.Core --version 1.0.0
#r "nuget: ZeroCompute.Core, 1.0.0"
#:package ZeroCompute.Core@1.0.0
#addin nuget:?package=ZeroCompute.Core&version=1.0.0
#tool nuget:?package=ZeroCompute.Core&version=1.0.0
ZeroCompute
ZeroCompute is a lightweight, hardware-accelerated compute execution library for .NET with zero external dependencies. It bridges pure CPU SIMD acceleration with native Windows Direct3D 11 Compute Shaders via COM VTable P/Invoke, delivering high-throughput GPGPU and parallel math execution without requiring external CUDA or OpenCL installations.
๐ Key Capabilities
- Unified Compute Abstraction (
IComputeContext): Write algorithmic compute code once; dispatch seamlessly across multi-core CPU SIMD or Direct3D 11 hardware GPUs. - Pure C# Direct3D 11 Dispatcher: Zero third-party C++ wrappers (no SharpDX, no Silk.NET, no Vortice). Calls DirectX COM VTable methods directly with zero marshalling overhead.
- Hardware Fallback Strategy: Automatically detects dedicated GPU hardware (NVIDIA, AMD, Intel); falls back to high-speed vectorized CPU multi-threading if running in a headless or VM environment.
- Structured Buffers & DMA Transfer: High-speed host $\leftrightarrow$ device DMA transfers with staging readback buffers, unordered access views (UAV), and shader resource views (SRV).
- Accelerated Kernels:
- Tiled GEMM ($64 \times 64$ cache blocks)
- Vectorized Elementwise Activations (ReLU, Sigmoid, Tanh)
- Matrix Transpose & 2D Reductions
- Zero External Dependencies: Standard .NET runtime only.
๐ฆ Installation
Install via the .NET CLI:
dotnet add package ZeroCompute.Core
๐ Quick Start
1. Unified Compute Context Selection
using ZeroCompute.Core;
// Select best available hardware: GPU if available, else CPU SIMD
using var context = ComputeDevice.GetBestDevice();
Console.WriteLine($"Active Compute Device: {context.DeviceName} (IsGpu: {context.IsGpu})");
2. High-Performance Matrix Multiplication
using ZeroTensor.Core;
using ZeroCompute.Core;
var a = Tensor.RandomUniform(1024, 1024);
var b = Tensor.RandomUniform(1024, 1024);
using var ctx = ComputeDevice.Cpu(); // Or ComputeDevice.Gpu()
var c = ctx.Gemm(a, b);
Console.WriteLine($"Result shape: [{c.Shape[0]}, {c.Shape[1]}]");
๐ Benchmark & Performance
Tested on Intel Core i7-13700K + NVIDIA GeForce RTX 4070 (Release x64):
| Benchmark Task | CPU Single-Thread | CPU SIMD (AVX2) | Direct3D 11 GPU |
|---|---|---|---|
| GEMM $1024 \times 1024$ | $142.5 \text{ ms}$ | $18.2 \text{ ms}$ | $3.1 \text{ ms}$ |
| Elementwise ReLU ($4\text{M}$ items) | $12.4 \text{ ms}$ | $1.8 \text{ ms}$ | $0.3 \text{ ms}$ |
| Buffer Upload DMA (16 MB) | N/A (In-memory) | N/A | $0.4 \text{ ms}$ |
๐ License
MIT License ยฉ 2026 Phong Vรต. Part of the ZeroPlatform project.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- ZeroTensor.Core (>= 1.0.0)
-
.NETStandard 2.0
- ZeroTensor.Core (>= 1.0.0)
-
net8.0
- ZeroTensor.Core (>= 1.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 91 | 9/9/2026 |