mirror of
https://github.com/fumiama/gozel.git
synced 2026-06-06 08:50:24 +08:00
feat(example): impl. vadd
This commit is contained in:
28
cmd/func2kernel/main.go
Normal file
28
cmd/func2kernel/main.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func main() {
|
||||
f, err := os.Open(os.Args[1])
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer f.Close()
|
||||
fo, err := os.Create(os.Args[2])
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer fo.Close()
|
||||
scan := bufio.NewScanner(f)
|
||||
for scan.Scan() {
|
||||
t := scan.Text()
|
||||
t = strings.ReplaceAll(t, " spir_func ", " spir_kernel ")
|
||||
t = strings.ReplaceAll(t, "ptr addrspace(4)", "ptr addrspace(1)")
|
||||
fo.WriteString(t)
|
||||
fo.WriteString("\n")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user