feat(gpu): Level Zero accelerated blur kernel + root compat aliases - #11
Open
zzd1314 wants to merge 2 commits into
Open
feat(gpu): Level Zero accelerated blur kernel + root compat aliases#11zzd1314 wants to merge 2 commits into
zzd1314 wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two changes, both needed by downstream users of this library:
1. GPU gaussian blur kernel (2d/total)
Complete Level Zero implementation of the blur accelerator (the author mentioned partial support previously, this fills it in):
build/blur_ocl.cl: OpenCL C two-pass kernel (blurh/blurv), premultiplied RGBA8 input, clamped edges, normalized Gaussian weights (radius = ceil(3*sigma), capped at 64)blur_ocl.go: full Level Zero pipeline via gozel (module/context/command list, two kernel launches, event sync, USM shared buffers)blur.go:Blur()auto-uses the GPU when a Level Zero device is available and falls back to imaging.Blur on CPU for any error (no Level Zero / unsupported iGPU / runtime failure)effects.go: routeContext.Blurthrough the newtotal.Blur.cl+ compiled_.spvare committed (go:embedneeds the spv); the.spttext disassembly could not be regenerated on this machine (no llvm-spirv), reviewers can regenerate withgo generate+ llvm-spirvVerified: all existing tests pass; GPU/CPU blur consistency test passes on GPU-capable hardware (skipped gracefully when no Level Zero device, e.g. Haswell iGPU).
2. Root package compat aliases (compat.go)
The API restructure moved
Radians/ImageToNRGBA/TakeThemeColorsKMeansinto the2d/unitand2d/totalsubpackages, breaking downstream modules that still call the old root-package signatures (e.g. FloatTech/rendercard). This adds root-level aliases with the old signatures (no error return) so downstream code compiles unchanged.