Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vulkan compute backend #22

Merged
merged 32 commits into from
Oct 10, 2024
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
281fa4b
improve clang-tidy setup
jo-m Dec 20, 2023
bfdaa51
test passes for vulkan implementation!
jo-m Dec 9, 2023
a05cfd9
generate in Makefile
jo-m Dec 9, 2023
e9109cb
add vulkan tooling to Dockerfile
jo-m Dec 10, 2023
912d694
support specialization constants and run time local size
jo-m Dec 10, 2023
d99c8a7
pass all dimensions as specialization constants
jo-m Dec 10, 2023
c5c8f08
cleanup
jo-m Dec 10, 2023
d49aff9
add "real" error handling
jo-m Dec 10, 2023
440ef83
increase CC warning flags and fix warnings
jo-m Dec 10, 2023
e3d3f95
create go wrapper
jo-m Dec 10, 2023
debb30d
use go wrapper for pmatch implementation
jo-m Dec 10, 2023
a5a4b0a
split into prepare and run
jo-m Dec 15, 2023
4f12b39
remove search buffer debugging aid
jo-m Dec 15, 2023
6f9bedb
implement push constant support
jo-m Dec 16, 2023
66d40aa
further improve error handling, get rid of almost all asserts
jo-m Dec 17, 2023
9225e2d
use push constants for image stride
jo-m Dec 17, 2023
e4eca03
remove unnecessary casts
jo-m Dec 17, 2023
344ed18
c flags
jo-m Dec 17, 2023
42e3017
pmatch binary now uses vk implementation
jo-m Dec 17, 2023
3b03a5b
remove debugging aids
jo-m Dec 20, 2023
e509dd7
require vulkan 1.2, downgrade back to bullseye
jo-m Dec 20, 2023
c93d1a2
remove old debugging aid
jo-m Dec 20, 2023
39a713d
fix linter errors
jo-m May 20, 2024
23a0990
add flake for vulkan dev (host)
jo-m Oct 10, 2024
12863cb
hide vulkan behind a build tag `vk`
jo-m Oct 10, 2024
be5de80
bring back strict compiler flags
jo-m Oct 10, 2024
9718378
hint on usage
jo-m Oct 10, 2024
1fc6617
pin all the tools
jo-m Oct 10, 2024
2973c37
use make variables for vk targets
jo-m Oct 10, 2024
98a4707
add todo to enable Vulkan in prod
jo-m Oct 10, 2024
4399daa
disable the go_test_more action for now... because it always fails
jo-m Oct 10, 2024
623d115
do Vulkan build in CI
jo-m Oct 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
pmatch binary now uses vk implementation
  • Loading branch information
jo-m committed Oct 10, 2024
commit 42e3017c5af0607b3afc2776e4939114f4d596b1
18 changes: 16 additions & 2 deletions examples/pmatch/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ const (
)

func bench(fn func(), count int) {
// Warmup.
for i := 0; i < 10; i++ {
fn()
}

t0 := time.Now()
for i := 0; i < count; i++ {
fn()
Expand All @@ -33,10 +38,19 @@ func main() {
panic(err)
}

fn := pmatch.SearchRGBA
inst, err := pmatch.NewSearchVk(img.Bounds(), pat.Bounds(), img.Stride, pat.(*image.RGBA).Stride)
if err != nil {
panic(err)
}
defer inst.Destroy()

fn := inst.Run

// Test.
x, y, cos := fn(img, pat.(*image.RGBA))
x, y, cos, err := fn(img, pat.(*image.RGBA))
if err != nil {
panic(err)
}
fmt.Printf("x=%d y=%d cos=%f\n", x, y, cos)
if x != px {
panic("x detected incorrectly")
Expand Down