# GcdrJava **Repository Path**: wuyuan/gcdr-java ## Basic Information - **Project Name**: GcdrJava - **Description**: https://github.com/sdcb/Sdcb.GcdrNet java版重写 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-10-11 - **Last Updated**: 2026-10-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # GCDR Java A Java implementation of a GPU-accelerated image enhancement runtime, supporting both CPU (via Java Vector API) and Vulkan GPU backends. The project compiles ONNX models to an optimized internal execution plan and executes them efficiently. ## Features - **Dual Backend Support**: Run inference on CPU (SIMD vectorized) or Vulkan GPU - **ONNX Model Support**: Load and execute standard ONNX models - **Optimized Kernels**: Highly optimized convolution, pooling, layer normalization, and element-wise operations - **NHWC Layout**: Native support for NHWC (Non-Hierarchical Writable Cache) tensor layout for better performance - **Memory Pooling**: Efficient memory pooling to reduce allocation overhead - **Graph Compilation**: Advanced graph optimizations including operator fusion and layout planning ## Architecture The project is organized into several modules: - **gcdr-core**: Core API (`GcdrEnhancer`) for image enhancement - **gcdr-engine**: Graph compilation and execution engine - **gcdr-kernels**: Optimized math kernels using Java Vector API - **gcdr-onnx**: ONNX model parsing - **gcdr-vulkan**: Vulkan GPU backend implementation - **gcdr-bench**: Benchmarking and testing tools ## Requirements - Java 21+ (required for Vector API) - Maven 3.8+ - For GPU support: Vulkan-capable GPU and driver ## Build ```bash mvn clean install -DskipTests ``` ## Usage Example ```java // Load enhancement models (GCNet and DRNet) GcdrEnhancer enhancer = GcdrEnhancer.fromFiles( Path.of("gcdrnet_gcnet.onnx"), Path.of("gcdrnet_drnet.onnx") ); // Or specify backend explicitly // GcdrEnhancer enhancer = GcdrEnhancer.fromFiles( // Path.of("gcdrnet_gcnet.onnx"), // Path.of("gcdrnet_drnet.onnx"), // GcdrBackend.CPU // or GcdrBackend.VULKAN // ); // Enhance image byte[] inputBgr = ...; // BGR image data byte[] outputBgr = enhancer.enhance(inputBgr, width, height); enhancer.close(); ``` ## Benchmark Run benchmarks with: ```bash cd gcdr-bench mvn exec:java -Dexec.mainClass="sdcb.gcdr.bench.Main" ``` ## License See LICENSE file for details.