diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5b59aa8..4909bbe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -132,6 +132,15 @@ jobs: ls -hl /tmp/sycl_linux echo "/tmp/sycl_linux/bin" >> $GITHUB_PATH + - name: Install ocloc + run: | + wget -qO- https://repositories.intel.com/gpu/intel-graphics.key \ + | sudo gpg --dearmor --output /usr/share/keyrings/intel-graphics.gpg + echo "deb [arch=amd64 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu $(. /etc/os-release && echo $VERSION_CODENAME) unified" \ + | sudo tee /etc/apt/sources.list.d/intel-gpu.list + sudo apt-get update -q + sudo apt-get install -y intel-ocloc libigdfcl2 libigc2 + - name: Run go generate run: | go generate ./... diff --git a/README.md b/README.md index cc08563..001880e 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,10 @@ Built on [purego](https://github.com/ebitengine/purego) and Windows syscall, gozel loads `ze_loader` at runtime via FFI, avoiding all C compiler dependencies. The entire API surface is auto-generated from the official Level Zero SDK headers, keeping bindings always in sync with upstream. +| Before Scaling (1272 x 855) | After Scaling (512 x 344) | +|:--:|:--:| +|![暖笺贺春.webp](examples/image_scale/暖笺贺春.webp)|![small.png](examples/image_scale/small.png)| + --- ## Table of Contents @@ -127,8 +131,9 @@ Test Passed!!! | Example | Description | Source | |---|---|---| -| **vadd** | Vector addition — GPU kernel launch, memory copy, validation | [examples/vadd](examples/vadd/) | -| **vadd_event** | Vector addition with event — GPU kernel launch, memory copy, validation | [examples/vadd_event](examples/vadd_event/) | +| **vadd** | Vector addition | [examples/vadd](examples/vadd/) | +| **vadd_event** | Vector addition with event | [examples/vadd_event](examples/vadd_event/) | +| **image_scale** | Scale image using hardware sampler | [examples/image_scale](examples/image_scale/) | ## The `ze` Package — High-Level API diff --git a/cmd/gen/scan.go b/cmd/gen/scan.go index 4e5bac9..26deab5 100644 --- a/cmd/gen/scan.go +++ b/cmd/gen/scan.go @@ -629,7 +629,7 @@ func scanTypedef( if !redirect { f.WriteString("type ") f.WriteString(val) - f.WriteString(" uintptr\nconst (") + f.WriteString(" uint32\nconst (") replaces = " " + val + " =" } else { _, _ = f.Seek(-1, io.SeekCurrent) diff --git a/doc.go b/doc.go index 7ce25aa..7c0bcef 100644 --- a/doc.go +++ b/doc.go @@ -2,4 +2,4 @@ package gozel //go:generate go run ./cmd/gen -//go:generate gofmt -w . +//go:generate gofmt -w -s . diff --git a/examples/image_scale/README.md b/examples/image_scale/README.md new file mode 100644 index 0000000..0ae1ee7 --- /dev/null +++ b/examples/image_scale/README.md @@ -0,0 +1,60 @@ +# Image Scaling — GPU Bilinear Resize with Sampler + +Downscale an image on the GPU using Level Zero's native **image** and **sampler** objects. The sampler performs hardware-accelerated bilinear interpolation, producing a high-quality resized image in a single kernel dispatch. + +## What It Does + +1. Decodes an embedded WebP image (1272 × 855) and converts it to RGBA +2. Computes the target dimensions (capped at 512 px on the longest side) +3. Discovers a GPU device and prints its basic & compute properties +4. Creates a SPIR-V module from an OpenCL C kernel compiled offline +5. Uses `zeKernelSuggestGroupSize` to pick an optimal 2-D workgroup size +6. Allocates host/device memory and two Level Zero **image objects** (input & output) +7. Creates a **sampler** with clamp addressing and bilinear filtering +8. Executes three command lists via a command queue: + - **Pre**: copy host pixels → device buffer → input image + - **Compute**: launch the `scale` kernel + - **Post**: copy output image → device buffer → host memory +9. Writes the result to `small.png` + +## Run + +```bash +go run main.go +``` + +## Result + +| Before Scaling (1272 × 855) | After Scaling (512 × 344) | +|:----------------------------:|:-------------------------:| +| ![input](暖笺贺春.webp) | ![output](small.png) | + +### Console Output + +``` +=============== Image Information =============== +Image Format: webp +Image W/H ratio: 1.4877 +Image Size: 1272 x 855 +Scale to Image Size: 512 x 344 +Scale ratio: 0.4025 +Image Data Size: 144802 bytes +=============== Device Basic Properties =============== +Running on device: ID = 32103 , Name = Intel(R) Graphics @ 0.00 GHz. +=============== Device Compute Properties =============== +Max Group Size (X, Y, Z): (1024, 1024, 1024) +Max Group Count (X, Y, Z): (4294967295, 4294967295, 4294967295) +Max Total Group Size: 1024 +Max Shared Local Memory: 65536 +Subgroup Sizes: [8 16 32] +=============== Computation Configuration =============== +Group Size (X, Y, Z): (64, 4, 1) +Group Count (X, Y, Z): (8, 86, 1) +Total Elements (srcN, dstN): (4350240, 704512) +Source Buffer Size: 4248.28 KiB +Dest Buffer Size: 688.00 KiB +=============== Calculation Results =============== +GPU Execution Time: 1.579000 ms +GPU Throughput: 2.76 GiB/s +Test Passed!!! +``` diff --git a/examples/image_scale/main.cl b/examples/image_scale/main.cl new file mode 100644 index 0000000..656ef15 --- /dev/null +++ b/examples/image_scale/main.cl @@ -0,0 +1,19 @@ +kernel void scale( + read_only image2d_t inputImg, + sampler_t smp, + write_only image2d_t outputImg) +{ + uint x = get_global_id(0); + uint y = get_global_id(1); + uint outW = get_image_width(outputImg); + uint outH = get_image_height(outputImg); + + float2 normCoord = (float2)( + (float)x / (float)outW, + (float)y / (float)outH + ); + + float4 pixel = read_imagef(inputImg, smp, normCoord); + + write_imagef(outputImg, (int2)(x, y), pixel); +} diff --git a/examples/image_scale/main.go b/examples/image_scale/main.go new file mode 100644 index 0000000..ea2cf85 --- /dev/null +++ b/examples/image_scale/main.go @@ -0,0 +1,314 @@ +// Package main demonstrates vector addition using the gozel Level Zero bindings. +package main + +import ( + "bytes" + _ "embed" + "fmt" + "image" + "image/draw" + "image/png" + "math" + "os" + "strconv" + "strings" + "time" + "unsafe" + + _ "golang.org/x/image/webp" + + "github.com/fumiama/gozel/gozel" + "github.com/fumiama/gozel/ze" +) + +//go:generate ocloc compile -file main.cl -spv_only -options "-cl-mad-enable -cl-fast-relaxed-math -cl-finite-math-only -cl-single-precision-constant" -internal_options "-O3" -output main +//go:generate llvm-spirv -to-text main_.spv -o main.spt + +//go:embed main_.spv +var kernelspv []byte + +//go:embed 暖笺贺春.webp +var imagebytes []byte + +func main() { + img, format, err := image.Decode(bytes.NewReader(imagebytes)) + if err != nil { + panic(err) + } + bounds := img.Bounds() + width := bounds.Dx() + height := bounds.Dy() + ratio := float64(width) / float64(height) + imgrgba := image.NewRGBA(bounds) + draw.Draw(imgrgba, bounds, img, bounds.Min, draw.Src) + dstw, dsth := width, height + if dstw > 512 { + dstw = 512 + dsth = int(float64(dstw) / ratio) + } + if dsth > 512 { + dsth = 512 + dstw = int(float64(dsth) * ratio) + } + scaleRatio := float32(float64(dstw) / float64(width)) + + fmt.Println("=============== Image Information ===============") + fmt.Printf("%-28s %s\n", "Image Format:", format) + fmt.Printf("%-28s %.04f\n", "Image W/H ratio:", ratio) + fmt.Printf("%-28s %d x %d\n", "Image Size:", width, height) + fmt.Printf("%-28s %d x %d\n", "Scale to Image Size:", dstw, dsth) + fmt.Printf("%-28s %.04f\n", "Scale ratio:", scaleRatio) + fmt.Printf("%-28s %d bytes\n", "Image Data Size:", len(imagebytes)) + + gpus, err := ze.InitGPUDrivers() + if err != nil { + panic(err) + } + if len(gpus) == 0 { + panic("no gpu available") + } + gpu := gpus[0] + + ctx, err := gpu.ContextCreate() + if err != nil { + panic(err) + } + + devs, err := gpu.DeviceGet() + if err != nil { + panic(err) + } + if len(devs) == 0 { + panic("no device available") + } + dev := devs[0] + + prop, err := dev.DeviceGetProperties() + if err != nil { + panic(err) + } + + fmt.Println("=============== Device Basic Properties ===============") + name, _, _ := strings.Cut(string(prop.Name[:]), "\x00") + fmt.Println( + "Running on device: ID =", prop.Deviceid, ", Name =", name, + "@", strconv.FormatFloat(float64(prop.Coreclockrate)/1024/1024/1024, 'f', 2, 64), "GHz.", + ) + + cprop, err := dev.DeviceGetComputeProperties() + if err != nil { + panic(err) + } + fmt.Println("=============== Device Compute Properties ===============") + fmt.Printf("%-28s (%d, %d, %d)\n", "Max Group Size (X, Y, Z):", cprop.Maxgroupsizex, cprop.Maxgroupsizey, cprop.Maxgroupsizez) + fmt.Printf("%-28s (%d, %d, %d)\n", "Max Group Count (X, Y, Z):", cprop.Maxgroupcountx, cprop.Maxgroupcounty, cprop.Maxgroupcountz) + fmt.Printf("%-28s %d\n", "Max Total Group Size:", cprop.Maxtotalgroupsize) + fmt.Printf("%-28s %d\n", "Max Shared Local Memory:", cprop.Maxsharedlocalmemory) + fmt.Printf("%-28s %v\n", "Subgroup Sizes:", cprop.Subgroupsizes[:cprop.Numsubgroupsizes]) + + mod, err := ctx.ModuleCreate(dev, kernelspv) + if err != nil { + panic(err) + } + defer mod.Destroy() + + krn, err := mod.KernelCreate("scale") + if err != nil { + panic(err) + } + defer krn.Destroy() + + gX, gY, _, err := krn.SuggestGroupSize(uint32(dstw), uint32(dsth), 1) + if err != nil { + panic(err) + } + + var ( + X = uintptr(gX) + Y = uintptr(gY) + groupCountX = uint32(math.Ceil(float64(dstw) / float64(X))) + groupCountY = uint32(math.Ceil(float64(dsth) / float64(Y))) + srcN = uintptr(width * height * 4) // 4 for RGBA + dstN = X * uintptr(groupCountX) * Y * uintptr(groupCountY) * 4 // 4 for RGBA + srcbufsz = srcN * unsafe.Sizeof(uint8(0)) + dstbufsz = dstN * unsafe.Sizeof(uint8(0)) + ) + fmt.Println("=============== Computation Configuration ===============") + fmt.Printf("%-28s (%d, %d, %d)\n", "Group Size (X, Y, Z):", X, Y, 1) + fmt.Printf("%-28s (%d, %d, %d)\n", "Group Count (X, Y, Z):", groupCountX, groupCountY, 1) + fmt.Printf("%-28s (%d, %d)\n", "Total Elements (srcN, dstN):", srcN, dstN) + fmt.Printf("%-28s %.02f KiB\n", "Source Buffer Size:", float64(srcbufsz)/1024) + fmt.Printf("%-28s %.02f KiB\n", "Dest Buffer Size:", float64(dstbufsz)/1024) + + q, err := ctx.CommandQueueCreate(dev, gozel.ZE_COMMAND_QUEUE_MODE_DEFAULT) + if err != nil { + panic(err) + } + defer q.Destroy() + + hbuf, err := ctx.MemAllocHost(srcbufsz, 1) + if err != nil { + panic(err) + } + defer ctx.MemFree(hbuf) + + dbuf, err := ctx.MemAllocDevice(dev, srcbufsz, 1) + if err != nil { + panic(err) + } + defer ctx.MemFree(dbuf) + + himg := unsafe.Slice((*uint8)(hbuf), srcN) + copy(himg, imgrgba.Pix) + + rgbaFmt := gozel.ZeImageFormat{ + Layout: gozel.ZE_IMAGE_FORMAT_LAYOUT_8_8_8_8, + Type: gozel.ZE_IMAGE_FORMAT_TYPE_UNORM, // UNORM: bilinear sampling returns float [0,1] + X: gozel.ZE_IMAGE_FORMAT_SWIZZLE_R, + Y: gozel.ZE_IMAGE_FORMAT_SWIZZLE_G, + Z: gozel.ZE_IMAGE_FORMAT_SWIZZLE_B, + W: gozel.ZE_IMAGE_FORMAT_SWIZZLE_A, + } + input, err := ctx.ImageCreate(dev, 0, rgbaFmt, uint64(width), uint32(height)) + if err != nil { + panic(err) + } + defer input.Destroy() + + smp, err := ctx.SamplerCreate( + dev, gozel.ZE_SAMPLER_ADDRESS_MODE_CLAMP, + gozel.ZE_SAMPLER_FILTER_MODE_LINEAR, 1, + ) + if err != nil { + panic(err) + } + defer smp.Destroy() + + output, err := ctx.ImageCreate( + dev, gozel.ZE_IMAGE_FLAG_KERNEL_WRITE, + rgbaFmt, uint64(dstw), uint32(dsth), + ) + if err != nil { + panic(err) + } + defer output.Destroy() + + err = krn.SetArgumentValue(0, input) + if err != nil { + panic(err) + } + err = krn.SetArgumentValue(1, smp) + if err != nil { + panic(err) + } + err = krn.SetArgumentValue(2, output) + if err != nil { + panic(err) + } + err = krn.SetGroupSize(uint32(X), uint32(Y), 1) + if err != nil { + panic(err) + } + + lstpre, err := ctx.CommandListCreate(dev) + if err != nil { + panic(err) + } + defer lstpre.Destroy() + + err = lstpre.AppendMemoryCopy(dbuf, hbuf, srcbufsz, 0) + if err != nil { + panic(err) + } + err = lstpre.AppendBarrier(0) + if err != nil { + panic(err) + } + + err = lstpre.AppendImageCopyFromMemory(input, dbuf, nil, 0) + if err != nil { + panic(err) + } + err = lstpre.AppendBarrier(0) + if err != nil { + panic(err) + } + + err = lstpre.Close() + if err != nil { + panic(err) + } + + lstcalc, err := ctx.CommandListCreate(dev) + if err != nil { + panic(err) + } + defer lstcalc.Destroy() + + err = lstcalc.AppendLaunchKernel(krn, &gozel.ZeGroupCount{ + Groupcountx: groupCountX, Groupcounty: groupCountY, Groupcountz: 1, + }, 0) + if err != nil { + panic(err) + } + + err = lstcalc.AppendBarrier(0) + if err != nil { + panic(err) + } + + err = lstcalc.Close() + if err != nil { + panic(err) + } + + lstpost, err := ctx.CommandListCreate(dev) + if err != nil { + panic(err) + } + defer lstpost.Destroy() + + err = lstpost.AppendImageCopyToMemory(dbuf, output, nil, 0) + if err != nil { + panic(err) + } + + err = lstpost.AppendMemoryCopy(hbuf, dbuf, dstbufsz, 0) + if err != nil { + panic(err) + } + + err = lstpost.Close() + if err != nil { + panic(err) + } + + start := time.Now() + err = q.ExecuteCommandLists(lstpre, lstcalc, lstpost) + if err != nil { + panic(err) + } + err = q.Synchronize(math.MaxUint64) + if err != nil { + panic(err) + } + elapsed := time.Since(start) + + fmt.Println("=============== Calculation Results ===============") + fmt.Printf("%-28s %.6f ms\n", "GPU Execution Time:", elapsed.Seconds()*1000) + fmt.Printf("%-28s %.2f GiB/s\n", "GPU Throughput:", float64(srcbufsz)/elapsed.Seconds()/1e9) + + newimgrgba := image.NewRGBA(image.Rect(0, 0, dstw, dsth)) + copy(newimgrgba.Pix, himg) + file, err := os.Create("small.png") + if err != nil { + panic(err) + } + defer file.Close() + err = png.Encode(file, newimgrgba) + if err != nil { + panic(err) + } + + fmt.Println("Test Passed!!!") +} diff --git a/examples/image_scale/main.spt b/examples/image_scale/main.spt new file mode 100644 index 0000000..8a42295 --- /dev/null +++ b/examples/image_scale/main.spt @@ -0,0 +1,119 @@ +119734787 65536 393230 61 0 +2 Capability Addresses +2 Capability Linkage +2 Capability Kernel +2 Capability Int64 +2 Capability ImageBasic +5 ExtInstImport 1 "OpenCL.std" +3 MemoryModel 2 2 +6 EntryPoint 6 53 "scale" 5 +16 String 59 "kernel_arg_type.scale.image2d_t,sampler_t,image2d_t," +10 String 60 "kernel_arg_type_qual.scale.,,," +3 Source 3 102000 +11 Name 5 "__spirv_BuiltInGlobalInvocationId" +4 Name 11 "scale" +5 Name 12 "inputImg" +3 Name 13 "smp" +5 Name 14 "outputImg" +4 Name 15 "entry" +4 Name 21 "call" +4 Name 23 "conv" +4 Name 26 "call1" +4 Name 27 "conv2" +4 Name 30 "call31" +4 Name 31 "call3" +4 Name 32 "call42" +4 Name 33 "call4" +4 Name 35 "conv5" +4 Name 36 "conv6" +3 Name 37 "div" +4 Name 40 "vecinit" +4 Name 41 "conv7" +4 Name 42 "conv8" +4 Name 43 "div9" +5 Name 44 "vecinit10" +7 Name 46 "TempSampledImage" +4 Name 49 "call11" +5 Name 51 "vecinit13" +5 Name 52 "vecinit14" +5 Name 54 "inputImg" +3 Name 55 "smp" +5 Name 56 "outputImg" + +13 Decorate 5 LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import +3 Decorate 5 Constant +4 Decorate 5 BuiltIn 28 +6 Decorate 11 LinkageAttributes "scale" Export +4 Decorate 37 FPFastMathMode 16 +4 Decorate 43 FPFastMathMode 16 +4 TypeInt 2 64 0 +4 TypeInt 22 32 0 +5 Constant 2 18 0 0 +4 Constant 22 29 0 +4 TypeVector 3 2 3 +4 TypePointer 4 1 3 +2 TypeVoid 6 +10 TypeImage 7 6 1 0 0 0 0 0 0 +2 TypeSampler 8 +10 TypeImage 9 6 1 0 0 0 0 0 1 +6 TypeFunction 10 6 7 8 9 +2 TypeBool 19 +4 TypeVector 28 22 2 +3 TypeFloat 34 32 +4 TypeVector 38 34 2 +3 TypeSampledImage 45 7 +4 TypeVector 47 34 4 +4 Variable 4 5 1 +3 ConstantTrue 19 20 +3 Undef 38 39 +4 Constant 34 48 0 +3 Undef 28 50 + + + +5 Function 6 11 0 10 +3 FunctionParameter 7 12 +3 FunctionParameter 8 13 +3 FunctionParameter 9 14 + +2 Label 15 +6 Load 3 16 5 2 32 +5 CompositeExtract 2 17 16 0 +6 Select 2 21 20 17 18 +4 UConvert 22 23 21 +6 Load 3 24 5 2 32 +5 CompositeExtract 2 25 24 1 +6 Select 2 26 20 25 18 +4 UConvert 22 27 26 +5 ImageQuerySizeLod 28 30 14 29 +5 CompositeExtract 22 31 30 0 +5 ImageQuerySizeLod 28 32 14 29 +5 CompositeExtract 22 33 32 1 +4 ConvertUToF 34 35 23 +4 ConvertUToF 34 36 31 +5 FDiv 34 37 35 36 +6 CompositeInsert 38 40 37 39 0 +4 ConvertUToF 34 41 27 +4 ConvertUToF 34 42 33 +5 FDiv 34 43 41 42 +6 CompositeInsert 38 44 43 40 1 +5 SampledImage 45 46 12 13 +7 ImageSampleExplicitLod 47 49 46 44 2 48 +6 CompositeInsert 28 51 23 50 0 +6 CompositeInsert 28 52 27 51 1 +4 ImageWrite 14 52 49 +1 Return + +1 FunctionEnd + +5 Function 6 53 0 10 +3 FunctionParameter 7 54 +3 FunctionParameter 8 55 +3 FunctionParameter 9 56 + +2 Label 57 +7 FunctionCall 6 58 11 54 55 56 +1 Return + +1 FunctionEnd + diff --git a/examples/image_scale/main_.spv b/examples/image_scale/main_.spv new file mode 100644 index 0000000..33c9998 Binary files /dev/null and b/examples/image_scale/main_.spv differ diff --git a/examples/image_scale/small.png b/examples/image_scale/small.png new file mode 100644 index 0000000..845890a Binary files /dev/null and b/examples/image_scale/small.png differ diff --git a/examples/image_scale/暖笺贺春.webp b/examples/image_scale/暖笺贺春.webp new file mode 100644 index 0000000..60d23c9 Binary files /dev/null and b/examples/image_scale/暖笺贺春.webp differ diff --git a/examples/quick_start/README.md b/examples/quick_start/README.md new file mode 100644 index 0000000..3463b7f --- /dev/null +++ b/examples/quick_start/README.md @@ -0,0 +1,21 @@ +# Quick Start — Device Enumeration + +The simplest gozel example: initialize the Level Zero runtime, enumerate all available GPU drivers and their devices, and print device names. + +## What It Does + +- Initializes Level Zero and retrieves all GPU driver handles +- Iterates over devices under each driver, queries and prints device properties (name) + +## Run + +```bash +go run main.go +``` + +## Sample Output + +``` +Found 1 GPU driver(s) + Device: Intel(R) Graphics +``` diff --git a/examples/vadd/README.md b/examples/vadd/README.md new file mode 100644 index 0000000..ddb57bf --- /dev/null +++ b/examples/vadd/README.md @@ -0,0 +1,48 @@ +# Vector Addition — Command Queue + +> ![Tips] +> **SYCL** is used to write this kernel, which is not a common practice. +> Please also have a look at the **OpenCL** kernel examples like [image_scale](../image_scale/). + +A classic GPU compute example: perform element-wise addition of two large float32 vectors on the GPU, then validate the result against a CPU reference. + +## What It Does + +1. Discovers a GPU device and prints its basic & compute properties +2. Allocates host and device memory for two float32 vectors (256 MiB each) +3. Fills both vectors with random values and copies them to device memory +4. Loads a SPIR-V kernel (`vector_add`) that computes `a[i] += b[i]` in parallel +5. Launches the kernel via a **command queue** with explicit command lists (pre-copy → compute → post-copy) +6. Reads back the results and validates every element against the CPU reference +7. Reports GPU vs. CPU execution time and throughput + +## Run + +```bash +go run main.go +``` + +## Sample Output + +``` +=============== Device Basic Properties =============== +Running on device: ID = 32103 , Name = Intel(R) Graphics @ 0.00 GHz. +=============== Device Compute Properties =============== +Max Group Size (X, Y, Z): (1024, 1024, 1024) +Max Group Count (X, Y, Z): (4294967295, 4294967295, 4294967295) +Max Total Group Size: 1024 +Max Shared Local Memory: 65536 +Subgroup Sizes: [8 16 32] +=============== Computation Configuration =============== +Group Size (X, Y, Z): (1024, 1, 1) +Group Count: 65536 +Total Elements (N): 67108864 +Buffer Size: 256 MiB +=============== Calculation Results =============== +GPU Execution Time: 53.858600 ms +GPU Throughput: 4.98 GiB/s +=============== Validation Results =============== +CPU Execution Time: 65.882900 ms +CPU Throughput: 4.07 GiB/s +Test Passed!!! +``` diff --git a/examples/vadd/main.go b/examples/vadd/main.go index 2e732e5..f6bacb4 100644 --- a/examples/vadd/main.go +++ b/examples/vadd/main.go @@ -16,10 +16,11 @@ import ( "github.com/fumiama/gozel/ze" ) -//go:generate clang++ -fsycl -fsycl-device-only -fsycl-targets=spirv64 -Xclang -emit-llvm-bc main.cpp -o device_kern.bc -//go:generate sycl-post-link -symbols -split=auto -o device_kern.table device_kern.bc -//go:generate llvm-spirv -o main.spv device_kern_0.bc +//go:generate clang++ -fsycl -fsycl-device-only -fno-sycl-instrument-device-code -fsycl-targets=spirv64 -Xclang -emit-llvm-bc main.cpp -o device_kern.bc +//go:generate sycl-post-link -symbols -split=auto -emit-param-info -properties -o device_kern.table device_kern.bc +//go:generate llvm-spirv --sycl-opt -o main.spv device_kern_0.bc //go:generate clang++ -target spirv64-unknown-unknown -S -emit-llvm -x ir device_kern_0.bc -o main.ll +//go:generate llvm-spirv -to-text main.spv -o main.spt //go:embed main.spv var kernelspv []byte diff --git a/examples/vadd/main.spt b/examples/vadd/main.spt new file mode 100644 index 0000000..a1688d0 --- /dev/null +++ b/examples/vadd/main.spt @@ -0,0 +1,79 @@ +119734787 66560 393230 34 0 +2 Capability Addresses +2 Capability Linkage +2 Capability Kernel +2 Capability Int64 +5 ExtInstImport 1 "OpenCL.std" +3 MemoryModel 2 2 +12 EntryPoint 6 29 "__sycl_kernel_vector_add" 5 6 +3 ExecutionMode 29 31 +3 Source 4 100000 +11 Name 5 "__spirv_BuiltInGlobalInvocationId" +9 Name 6 "__spirv_BuiltInGlobalOffset" +9 Name 11 "__sycl_kernel_vector_add" + +13 Decorate 5 LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import +3 Decorate 5 Constant +4 Decorate 5 BuiltIn 28 +4 Decorate 5 Alignment 32 +11 Decorate 6 LinkageAttributes "__spirv_BuiltInGlobalOffset" Import +3 Decorate 6 Constant +4 Decorate 6 BuiltIn 33 +4 Decorate 6 Alignment 32 +11 Decorate 11 LinkageAttributes "__sycl_kernel_vector_add" Export +4 Decorate 12 FuncParamAttr 5 +4 Decorate 12 Alignment 4 +4 Decorate 13 FuncParamAttr 5 +4 Decorate 13 FuncParamAttr 6 +4 Decorate 13 Alignment 4 +4 Decorate 30 FuncParamAttr 5 +4 Decorate 30 Alignment 4 +4 Decorate 31 FuncParamAttr 5 +4 Decorate 31 FuncParamAttr 6 +4 Decorate 31 Alignment 4 +4 TypeInt 2 64 0 +5 Constant 2 21 2147483648 0 +4 TypeVector 3 2 3 +4 TypePointer 4 5 3 +2 TypeVoid 7 +3 TypeFloat 8 32 +4 TypePointer 9 5 8 +5 TypeFunction 10 7 9 9 +4 TypePointer 15 5 2 +2 TypeBool 22 +4 Variable 4 5 5 +4 Variable 4 6 5 + + + +5 Function 7 11 0 10 +3 FunctionParameter 9 12 +3 FunctionParameter 9 13 + +2 Label 14 +4 Bitcast 15 16 5 +6 Load 2 17 16 2 32 +4 Bitcast 15 18 6 +6 Load 2 19 18 2 32 +5 ISub 2 20 17 19 +5 ULessThan 22 23 20 21 +5 InBoundsPtrAccessChain 9 24 13 20 +6 Load 8 25 24 2 4 +5 InBoundsPtrAccessChain 9 26 12 20 +6 Load 8 27 26 2 4 +5 FAdd 8 28 27 25 +5 Store 26 28 2 4 +1 Return + +1 FunctionEnd + +5 Function 7 29 0 10 +3 FunctionParameter 9 30 +3 FunctionParameter 9 31 + +2 Label 32 +6 FunctionCall 7 33 11 30 31 +1 Return + +1 FunctionEnd + diff --git a/examples/vadd_event/README.md b/examples/vadd_event/README.md new file mode 100644 index 0000000..29504d7 --- /dev/null +++ b/examples/vadd_event/README.md @@ -0,0 +1,61 @@ +# Vector Addition — Immediate Command List with Events + +> ![Tips] +> **SYCL** is used to write this kernel, which is not a common practice. +> Please also have a look at the **OpenCL** kernel examples like [image_scale](../image_scale/). + +The same vector addition workload as the `vadd` example, but driven by an **immediate command list** and **events** instead of explicit command queues. This demonstrates fine-grained dependency tracking: memory copies signal events, and the kernel launch waits on those events before executing. + +## What It Does + +1. Discovers a GPU device and prints its basic & compute properties +2. Allocates host and device memory for two float32 vectors (256 MiB each) +3. Fills both vectors with random values +4. Loads a SPIR-V kernel (`vector_add`) that computes `a[i] += b[i]` in parallel +5. Creates an **event pool** with 3 events to express data-flow dependencies +6. Submits all work through a single **immediate command list**: + - Two H→D copies, each signaling its own event + - Kernel launch that **waits** on both copy events before executing + - D→H copy that waits on the kernel event +7. Synchronizes via `HostSynchronize` on the immediate command list +8. Validates every element against the CPU reference + +## Key Difference from `vadd` + +| Aspect | `vadd` | `vadd_event` | +|--------|--------|-------------| +| Submission | 3 separate command lists executed on a command queue | 1 immediate command list | +| Synchronization | `zeCommandQueueSynchronize` | `zeCommandListHostSynchronize` | +| Dependencies | Implicit via command list ordering + barriers | Explicit via events (wait lists) | + +## Run + +```bash +go run main.go +``` + +## Sample Output + +``` +=============== Device Basic Properties =============== +Running on device: ID = 32103 , Name = Intel(R) Graphics @ 0.00 GHz. +=============== Device Compute Properties =============== +Max Group Size (X, Y, Z): (1024, 1024, 1024) +Max Group Count (X, Y, Z): (4294967295, 4294967295, 4294967295) +Max Total Group Size: 1024 +Max Shared Local Memory: 65536 +Num Subgroup Sizes: 3 +Subgroup Sizes: [8 16 32 0 0 0 0 0] +=============== Computation Configuration =============== +Group Size (X, Y, Z): (1024, 1, 1) +Group Count: 65536 +Total Elements (N): 67108864 +Buffer Size: 256 MiB +=============== Calculation Results =============== +GPU Execution Time: 51.768500 ms +GPU Throughput: 5.19 GiB/s +=============== Validation Results =============== +CPU Execution Time: 38.237400 ms +CPU Throughput: 7.02 GiB/s +Test Passed!!! +``` diff --git a/examples/vadd_event/main.go b/examples/vadd_event/main.go index ce3ba3b..e7c937e 100644 --- a/examples/vadd_event/main.go +++ b/examples/vadd_event/main.go @@ -16,10 +16,11 @@ import ( "github.com/fumiama/gozel/ze" ) -//go:generate clang++ -fsycl -fsycl-device-only -fsycl-targets=spirv64 -Xclang -emit-llvm-bc main.cpp -o device_kern.bc -//go:generate sycl-post-link -symbols -split=auto -o device_kern.table device_kern.bc -//go:generate llvm-spirv -o main.spv device_kern_0.bc +//go:generate clang++ -fsycl -fsycl-device-only -fno-sycl-instrument-device-code -fsycl-targets=spirv64 -Xclang -emit-llvm-bc main.cpp -o device_kern.bc +//go:generate sycl-post-link -symbols -split=auto -emit-param-info -properties -o device_kern.table device_kern.bc +//go:generate llvm-spirv --sycl-opt -o main.spv device_kern_0.bc //go:generate clang++ -target spirv64-unknown-unknown -S -emit-llvm -x ir device_kern_0.bc -o main.ll +//go:generate llvm-spirv -to-text main.spv -o main.spt //go:embed main.spv var kernelspv []byte diff --git a/examples/vadd_event/main.spt b/examples/vadd_event/main.spt new file mode 100644 index 0000000..a1688d0 --- /dev/null +++ b/examples/vadd_event/main.spt @@ -0,0 +1,79 @@ +119734787 66560 393230 34 0 +2 Capability Addresses +2 Capability Linkage +2 Capability Kernel +2 Capability Int64 +5 ExtInstImport 1 "OpenCL.std" +3 MemoryModel 2 2 +12 EntryPoint 6 29 "__sycl_kernel_vector_add" 5 6 +3 ExecutionMode 29 31 +3 Source 4 100000 +11 Name 5 "__spirv_BuiltInGlobalInvocationId" +9 Name 6 "__spirv_BuiltInGlobalOffset" +9 Name 11 "__sycl_kernel_vector_add" + +13 Decorate 5 LinkageAttributes "__spirv_BuiltInGlobalInvocationId" Import +3 Decorate 5 Constant +4 Decorate 5 BuiltIn 28 +4 Decorate 5 Alignment 32 +11 Decorate 6 LinkageAttributes "__spirv_BuiltInGlobalOffset" Import +3 Decorate 6 Constant +4 Decorate 6 BuiltIn 33 +4 Decorate 6 Alignment 32 +11 Decorate 11 LinkageAttributes "__sycl_kernel_vector_add" Export +4 Decorate 12 FuncParamAttr 5 +4 Decorate 12 Alignment 4 +4 Decorate 13 FuncParamAttr 5 +4 Decorate 13 FuncParamAttr 6 +4 Decorate 13 Alignment 4 +4 Decorate 30 FuncParamAttr 5 +4 Decorate 30 Alignment 4 +4 Decorate 31 FuncParamAttr 5 +4 Decorate 31 FuncParamAttr 6 +4 Decorate 31 Alignment 4 +4 TypeInt 2 64 0 +5 Constant 2 21 2147483648 0 +4 TypeVector 3 2 3 +4 TypePointer 4 5 3 +2 TypeVoid 7 +3 TypeFloat 8 32 +4 TypePointer 9 5 8 +5 TypeFunction 10 7 9 9 +4 TypePointer 15 5 2 +2 TypeBool 22 +4 Variable 4 5 5 +4 Variable 4 6 5 + + + +5 Function 7 11 0 10 +3 FunctionParameter 9 12 +3 FunctionParameter 9 13 + +2 Label 14 +4 Bitcast 15 16 5 +6 Load 2 17 16 2 32 +4 Bitcast 15 18 6 +6 Load 2 19 18 2 32 +5 ISub 2 20 17 19 +5 ULessThan 22 23 20 21 +5 InBoundsPtrAccessChain 9 24 13 20 +6 Load 8 25 24 2 4 +5 InBoundsPtrAccessChain 9 26 12 20 +6 Load 8 27 26 2 4 +5 FAdd 8 28 27 25 +5 Store 26 28 2 4 +1 Return + +1 FunctionEnd + +5 Function 7 29 0 10 +3 FunctionParameter 9 30 +3 FunctionParameter 9 31 + +2 Label 32 +6 FunctionCall 7 33 11 30 31 +1 Return + +1 FunctionEnd + diff --git a/go.mod b/go.mod index 045a755..b955511 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,7 @@ module github.com/fumiama/gozel go 1.26.1 -require github.com/ebitengine/purego v0.10.0 +require ( + github.com/ebitengine/purego v0.10.0 + golang.org/x/image v0.38.0 +) diff --git a/go.sum b/go.sum index 118766f..987207c 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,4 @@ github.com/ebitengine/purego v0.10.0 h1:QIw4xfpWT6GWTzaW5XEKy3HXoqrJGx1ijYHzTF0/ISU= github.com/ebitengine/purego v0.10.0/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= +golang.org/x/image v0.38.0 h1:5l+q+Y9JDC7mBOMjo4/aPhMDcxEptsX+Tt3GgRQRPuE= +golang.org/x/image v0.38.0/go.mod h1:/3f6vaXC+6CEanU4KJxbcUZyEePbyKbaLoDOe4ehFYY= diff --git a/gozel/core_CacheLineSize.go b/gozel/core_CacheLineSize.go index 058df26..61c2363 100644 --- a/gozel/core_CacheLineSize.go +++ b/gozel/core_CacheLineSize.go @@ -21,7 +21,7 @@ import ( const ZE_CACHELINE_SIZE_EXT_NAME = "ZE_extension_device_cache_line_size" // ZeDeviceCacheLineSizeExtVersion (ze_device_cache_line_size_ext_version_t) CacheLine Size Extension Version(s) -type ZeDeviceCacheLineSizeExtVersion uintptr +type ZeDeviceCacheLineSizeExtVersion uint32 const ( ZE_DEVICE_CACHE_LINE_SIZE_EXT_VERSION_1_0 ZeDeviceCacheLineSizeExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_DEVICE_CACHE_LINE_SIZE_EXT_VERSION_1_0 version 1.0 diff --git a/gozel/core_EUCount.go b/gozel/core_EUCount.go index cae10f8..4cf0295 100644 --- a/gozel/core_EUCount.go +++ b/gozel/core_EUCount.go @@ -21,7 +21,7 @@ import ( const ZE_EU_COUNT_EXT_NAME = "ZE_extension_eu_count" // ZeEuCountExtVersion (ze_eu_count_ext_version_t) EU Count Extension Version(s) -type ZeEuCountExtVersion uintptr +type ZeEuCountExtVersion uint32 const ( ZE_EU_COUNT_EXT_VERSION_1_0 ZeEuCountExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_EU_COUNT_EXT_VERSION_1_0 version 1.0 diff --git a/gozel/core_PCIProperties.go b/gozel/core_PCIProperties.go index 5fa7095..2bc9d78 100644 --- a/gozel/core_PCIProperties.go +++ b/gozel/core_PCIProperties.go @@ -23,7 +23,7 @@ import ( const ZE_PCI_PROPERTIES_EXT_NAME = "ZE_extension_pci_properties" // ZePciPropertiesExtVersion (ze_pci_properties_ext_version_t) PCI Properties Extension Version(s) -type ZePciPropertiesExtVersion uintptr +type ZePciPropertiesExtVersion uint32 const ( ZE_PCI_PROPERTIES_EXT_VERSION_1_0 ZePciPropertiesExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_PCI_PROPERTIES_EXT_VERSION_1_0 version 1.0 diff --git a/gozel/core_RTAS.go b/gozel/core_RTAS.go index 61b77cf..4a3c051 100644 --- a/gozel/core_RTAS.go +++ b/gozel/core_RTAS.go @@ -23,7 +23,7 @@ import ( const ZE_RTAS_EXT_NAME = "ZE_extension_rtas" // ZeRtasBuilderExtVersion (ze_rtas_builder_ext_version_t) Ray Tracing Acceleration Structure Builder Extension Version(s) -type ZeRtasBuilderExtVersion uintptr +type ZeRtasBuilderExtVersion uint32 const ( ZE_RTAS_BUILDER_EXT_VERSION_1_0 ZeRtasBuilderExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_RTAS_BUILDER_EXT_VERSION_1_0 version 1.0 @@ -46,7 +46,7 @@ const ( // / @details // / - This is an opaque ray tracing acceleration structure format // / identifier. -type ZeRtasFormatExt uintptr +type ZeRtasFormatExt uint32 const ( ZE_RTAS_FORMAT_EXT_INVALID ZeRtasFormatExt = 0x0 // ZE_RTAS_FORMAT_EXT_INVALID Invalid acceleration structure format code @@ -141,7 +141,7 @@ const ( // / - Higher ray tracing performance can be achieved by using a high-quality // / build, but acceleration structure build performance might be // / significantly reduced. -type ZeRtasBuilderBuildQualityHintExt uintptr +type ZeRtasBuilderBuildQualityHintExt uint32 const ( ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_LOW ZeRtasBuilderBuildQualityHintExt = 0 // ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXT_LOW build low-quality acceleration structure (fast) @@ -152,7 +152,7 @@ const ( ) // ZeRtasBuilderGeometryTypeExt (ze_rtas_builder_geometry_type_ext_t) Ray tracing acceleration structure builder geometry type -type ZeRtasBuilderGeometryTypeExt uintptr +type ZeRtasBuilderGeometryTypeExt uint32 const ( ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_TRIANGLES ZeRtasBuilderGeometryTypeExt = 0 // ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXT_TRIANGLES triangle mesh geometry type @@ -173,7 +173,7 @@ type ZeRtasBuilderPackedGeometryTypeExt uint8 // / - Specifies the format of data buffer elements. // / - Data buffers may contain instancing transform matrices, triangle/quad // / vertex indices, etc... -type ZeRtasBuilderInputDataFormatExt uintptr +type ZeRtasBuilderInputDataFormatExt uint32 const ( ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3 ZeRtasBuilderInputDataFormatExt = 0 // ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXT_FLOAT3 3-component float vector (see ::ze_rtas_float3_ext_t) diff --git a/gozel/core_RTASBuilder.go b/gozel/core_RTASBuilder.go index 8ac110d..c7640c2 100644 --- a/gozel/core_RTASBuilder.go +++ b/gozel/core_RTASBuilder.go @@ -23,7 +23,7 @@ import ( const ZE_RTAS_BUILDER_EXP_NAME = "ZE_experimental_rtas_builder" // ZeRtasBuilderExpVersion (ze_rtas_builder_exp_version_t) Ray Tracing Acceleration Structure Builder Extension Version(s) -type ZeRtasBuilderExpVersion uintptr +type ZeRtasBuilderExpVersion uint32 const ( ZE_RTAS_BUILDER_EXP_VERSION_1_0 ZeRtasBuilderExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_RTAS_BUILDER_EXP_VERSION_1_0 version 1.0 @@ -46,7 +46,7 @@ const ( // / @details // / - This is an opaque ray tracing acceleration structure format // / identifier. -type ZeRtasFormatExp uintptr +type ZeRtasFormatExp uint32 const ( ZE_RTAS_FORMAT_EXP_INVALID ZeRtasFormatExp = 0 // ZE_RTAS_FORMAT_EXP_INVALID Invalid acceleration structure format @@ -141,7 +141,7 @@ const ( // / - Higher ray tracing performance can be achieved by using a high-quality // / build, but acceleration structure build performance might be // / significantly reduced. -type ZeRtasBuilderBuildQualityHintExp uintptr +type ZeRtasBuilderBuildQualityHintExp uint32 const ( ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_LOW ZeRtasBuilderBuildQualityHintExp = 0 // ZE_RTAS_BUILDER_BUILD_QUALITY_HINT_EXP_LOW build low-quality acceleration structure (fast) @@ -152,7 +152,7 @@ const ( ) // ZeRtasBuilderGeometryTypeExp (ze_rtas_builder_geometry_type_exp_t) Ray tracing acceleration structure builder geometry type -type ZeRtasBuilderGeometryTypeExp uintptr +type ZeRtasBuilderGeometryTypeExp uint32 const ( ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_TRIANGLES ZeRtasBuilderGeometryTypeExp = 0 // ZE_RTAS_BUILDER_GEOMETRY_TYPE_EXP_TRIANGLES triangle mesh geometry type @@ -173,7 +173,7 @@ type ZeRtasBuilderPackedGeometryTypeExp uint8 // / - Specifies the format of data buffer elements. // / - Data buffers may contain instancing transform matrices, triangle/quad // / vertex indices, etc... -type ZeRtasBuilderInputDataFormatExp uintptr +type ZeRtasBuilderInputDataFormatExp uint32 const ( ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3 ZeRtasBuilderInputDataFormatExp = 0 // ZE_RTAS_BUILDER_INPUT_DATA_FORMAT_EXP_FLOAT3 3-component float vector (see ::ze_rtas_float3_exp_t) diff --git a/gozel/core_SRGB.go b/gozel/core_SRGB.go index 162061d..9f01c20 100644 --- a/gozel/core_SRGB.go +++ b/gozel/core_SRGB.go @@ -21,7 +21,7 @@ import ( const ZE_SRGB_EXT_NAME = "ZE_extension_srgb" // ZeSrgbExtVersion (ze_srgb_ext_version_t) sRGB Extension Version(s) -type ZeSrgbExtVersion uintptr +type ZeSrgbExtVersion uint32 const ( ZE_SRGB_EXT_VERSION_1_0 ZeSrgbExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_SRGB_EXT_VERSION_1_0 version 1.0 diff --git a/gozel/core_bandwidth.go b/gozel/core_bandwidth.go index 6ac56ee..cf8f439 100644 --- a/gozel/core_bandwidth.go +++ b/gozel/core_bandwidth.go @@ -21,7 +21,7 @@ import ( const ZE_BANDWIDTH_PROPERTIES_EXP_NAME = "ZE_experimental_bandwidth_properties" // ZeBandwidthPropertiesExpVersion (ze_bandwidth_properties_exp_version_t) Bandwidth Extension Version(s) -type ZeBandwidthPropertiesExpVersion uintptr +type ZeBandwidthPropertiesExpVersion uint32 const ( ZE_BANDWIDTH_PROPERTIES_EXP_VERSION_1_0 ZeBandwidthPropertiesExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_BANDWIDTH_PROPERTIES_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/core_bfloat16conversions.go b/gozel/core_bfloat16conversions.go index 539a947..2b1adb8 100644 --- a/gozel/core_bfloat16conversions.go +++ b/gozel/core_bfloat16conversions.go @@ -17,7 +17,7 @@ package gozel const ZE_BFLOAT16_CONVERSIONS_EXT_NAME = "ZE_extension_bfloat16_conversions" // ZeBfloat16ConversionsExtVersion (ze_bfloat16_conversions_ext_version_t) Bfloat16 Conversions Extension Version(s) -type ZeBfloat16ConversionsExtVersion uintptr +type ZeBfloat16ConversionsExtVersion uint32 const ( ZE_BFLOAT16_CONVERSIONS_EXT_VERSION_1_0 ZeBfloat16ConversionsExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_BFLOAT16_CONVERSIONS_EXT_VERSION_1_0 version 1.0 diff --git a/gozel/core_bindlessimages.go b/gozel/core_bindlessimages.go index 28395b0..3fc73a0 100644 --- a/gozel/core_bindlessimages.go +++ b/gozel/core_bindlessimages.go @@ -23,7 +23,7 @@ import ( const ZE_BINDLESS_IMAGE_EXP_NAME = "ZE_experimental_bindless_image" // ZeBindlessImageExpVersion (ze_bindless_image_exp_version_t) Bindless Image Extension Version(s) -type ZeBindlessImageExpVersion uintptr +type ZeBindlessImageExpVersion uint32 const ( ZE_BINDLESS_IMAGE_EXP_VERSION_1_0 ZeBindlessImageExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_BINDLESS_IMAGE_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/core_cacheReservation.go b/gozel/core_cacheReservation.go index 0c9380a..6174163 100644 --- a/gozel/core_cacheReservation.go +++ b/gozel/core_cacheReservation.go @@ -23,7 +23,7 @@ import ( const ZE_CACHE_RESERVATION_EXT_NAME = "ZE_extension_cache_reservation" // ZeCacheReservationExtVersion (ze_cache_reservation_ext_version_t) Cache_Reservation Extension Version(s) -type ZeCacheReservationExtVersion uintptr +type ZeCacheReservationExtVersion uint32 const ( ZE_CACHE_RESERVATION_EXT_VERSION_1_0 ZeCacheReservationExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_CACHE_RESERVATION_EXT_VERSION_1_0 version 1.0 @@ -33,7 +33,7 @@ const ( ) // ZeCacheExtRegion (ze_cache_ext_region_t) Cache Reservation Region -type ZeCacheExtRegion uintptr +type ZeCacheExtRegion uint32 const ( ZE_CACHE_EXT_REGION_ZE_CACHE_REGION_DEFAULT ZeCacheExtRegion = 0 // ZE_CACHE_EXT_REGION_ZE_CACHE_REGION_DEFAULT [DEPRECATED] utilize driver default scheme. Use diff --git a/gozel/core_cmdqueue.go b/gozel/core_cmdqueue.go index 176b3eb..e7ca8f4 100644 --- a/gozel/core_cmdqueue.go +++ b/gozel/core_cmdqueue.go @@ -55,7 +55,7 @@ const ( ) // ZeCommandQueueMode (ze_command_queue_mode_t) Supported command queue modes -type ZeCommandQueueMode uintptr +type ZeCommandQueueMode uint32 const ( ZE_COMMAND_QUEUE_MODE_DEFAULT ZeCommandQueueMode = 0 // ZE_COMMAND_QUEUE_MODE_DEFAULT implicit default behavior; uses driver-based heuristics @@ -72,7 +72,7 @@ const ( ) // ZeCommandQueuePriority (ze_command_queue_priority_t) Supported command queue priorities -type ZeCommandQueuePriority uintptr +type ZeCommandQueuePriority uint32 const ( ZE_COMMAND_QUEUE_PRIORITY_NORMAL ZeCommandQueuePriority = 0 // ZE_COMMAND_QUEUE_PRIORITY_NORMAL [default] normal priority diff --git a/gozel/core_commandListClone.go b/gozel/core_commandListClone.go index ff50fc5..b23f8b0 100644 --- a/gozel/core_commandListClone.go +++ b/gozel/core_commandListClone.go @@ -23,7 +23,7 @@ import ( const ZE_COMMAND_LIST_CLONE_EXP_NAME = "ZE_experimental_command_list_clone" // ZeCommandListCloneExpVersion (ze_command_list_clone_exp_version_t) Command List Clone Extension Version(s) -type ZeCommandListCloneExpVersion uintptr +type ZeCommandListCloneExpVersion uint32 const ( ZE_COMMAND_LIST_CLONE_EXP_VERSION_1_0 ZeCommandListCloneExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_COMMAND_LIST_CLONE_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/core_common.go b/gozel/core_common.go index 264f284..8886b16 100644 --- a/gozel/core_common.go +++ b/gozel/core_common.go @@ -104,7 +104,7 @@ func ZE_BIT[T ~int | ~uint32 | ~uint64 | ~uintptr](_i T) T { } // ZeResult (ze_result_t) Defines Return/Error codes -type ZeResult uintptr +type ZeResult uint32 const ( ZE_RESULT_SUCCESS ZeResult = 0 // ZE_RESULT_SUCCESS [Core] success @@ -206,7 +206,7 @@ const ( ) // ZeStructureType (ze_structure_type_t) Defines structure types -type ZeStructureType uintptr +type ZeStructureType uint32 const ( ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES ZeStructureType = 0x1 // ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES ::ze_driver_properties_t @@ -348,7 +348,7 @@ const ( ) // ZeBandwidthUnit (ze_bandwidth_unit_t) Bandwidth unit -type ZeBandwidthUnit uintptr +type ZeBandwidthUnit uint32 const ( ZE_BANDWIDTH_UNIT_UNKNOWN ZeBandwidthUnit = 0 // ZE_BANDWIDTH_UNIT_UNKNOWN The unit used for bandwidth is unknown @@ -359,7 +359,7 @@ const ( ) // ZeLatencyUnit (ze_latency_unit_t) Latency unit -type ZeLatencyUnit uintptr +type ZeLatencyUnit uint32 const ( ZE_LATENCY_UNIT_UNKNOWN ZeLatencyUnit = 0 // ZE_LATENCY_UNIT_UNKNOWN The unit used for latency is unknown diff --git a/gozel/core_copy.go b/gozel/core_copy.go index dfc58ad..b22fcec 100644 --- a/gozel/core_copy.go +++ b/gozel/core_copy.go @@ -543,7 +543,7 @@ func ZeCommandListAppendMemoryPrefetch( } // ZeMemoryAdvice (ze_memory_advice_t) Supported memory advice hints -type ZeMemoryAdvice uintptr +type ZeMemoryAdvice uint32 const ( ZE_MEMORY_ADVICE_SET_READ_MOSTLY ZeMemoryAdvice = 0 // ZE_MEMORY_ADVICE_SET_READ_MOSTLY hint that memory will be read from frequently and written to rarely diff --git a/gozel/core_counterbasedeventpool.go b/gozel/core_counterbasedeventpool.go index a61e380..600d957 100644 --- a/gozel/core_counterbasedeventpool.go +++ b/gozel/core_counterbasedeventpool.go @@ -21,7 +21,7 @@ import ( const ZE_EVENT_POOL_COUNTER_BASED_EXP_NAME = "ZE_experimental_event_pool_counter_based" // ZeEventPoolCounterBasedExpVersion (ze_event_pool_counter_based_exp_version_t) Counter-based Event Pools Extension Version(s) -type ZeEventPoolCounterBasedExpVersion uintptr +type ZeEventPoolCounterBasedExpVersion uint32 const ( ZE_EVENT_POOL_COUNTER_BASED_EXP_VERSION_1_0 ZeEventPoolCounterBasedExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_EVENT_POOL_COUNTER_BASED_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/core_device.go b/gozel/core_device.go index 06374a0..2ec631a 100644 --- a/gozel/core_device.go +++ b/gozel/core_device.go @@ -138,7 +138,7 @@ func ZeDeviceGetSubDevices( } // ZeDeviceType (ze_device_type_t) Supported device types -type ZeDeviceType uintptr +type ZeDeviceType uint32 const ( ZE_DEVICE_TYPE_GPU ZeDeviceType = 1 // ZE_DEVICE_TYPE_GPU Graphics Processing Unit diff --git a/gozel/core_deviceLUID.go b/gozel/core_deviceLUID.go index 1f54a1f..4080a19 100644 --- a/gozel/core_deviceLUID.go +++ b/gozel/core_deviceLUID.go @@ -21,7 +21,7 @@ import ( const ZE_DEVICE_LUID_EXT_NAME = "ZE_extension_device_luid" // ZeDeviceLuidExtVersion (ze_device_luid_ext_version_t) Device Local Identifier (LUID) Extension Version(s) -type ZeDeviceLuidExtVersion uintptr +type ZeDeviceLuidExtVersion uint32 const ( ZE_DEVICE_LUID_EXT_VERSION_1_0 ZeDeviceLuidExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_DEVICE_LUID_EXT_VERSION_1_0 version 1.0 diff --git a/gozel/core_deviceVectorSizes.go b/gozel/core_deviceVectorSizes.go index 5900c9d..afedfe3 100644 --- a/gozel/core_deviceVectorSizes.go +++ b/gozel/core_deviceVectorSizes.go @@ -23,7 +23,7 @@ import ( const ZE_DEVICE_VECTOR_SIZES_EXT_NAME = "ZE_extension_device_vector_sizes" // ZeDeviceVectorSizesExtVersion (ze_device_vector_sizes_ext_version_t) Device Vector Sizes Query Extension Version(s) -type ZeDeviceVectorSizesExtVersion uintptr +type ZeDeviceVectorSizesExtVersion uint32 const ( ZE_DEVICE_VECTOR_SIZES_EXT_VERSION_1_0 ZeDeviceVectorSizesExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_DEVICE_VECTOR_SIZES_EXT_VERSION_1_0 version 1.0 diff --git a/gozel/core_deviceipversion.go b/gozel/core_deviceipversion.go index 6e9be3e..0c8f269 100644 --- a/gozel/core_deviceipversion.go +++ b/gozel/core_deviceipversion.go @@ -21,7 +21,7 @@ import ( const ZE_DEVICE_IP_VERSION_EXT_NAME = "ZE_extension_device_ip_version" // ZeDeviceIpVersionVersion (ze_device_ip_version_version_t) Device IP Version Extension Version(s) -type ZeDeviceIpVersionVersion uintptr +type ZeDeviceIpVersionVersion uint32 const ( ZE_DEVICE_IP_VERSION_VERSION_1_0 ZeDeviceIpVersionVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_DEVICE_IP_VERSION_VERSION_1_0 version 1.0 diff --git a/gozel/core_deviceusablememproperties.go b/gozel/core_deviceusablememproperties.go index 7016aa2..f987a87 100644 --- a/gozel/core_deviceusablememproperties.go +++ b/gozel/core_deviceusablememproperties.go @@ -21,7 +21,7 @@ import ( const ZE_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_NAME = "ZE_extension_device_usablemem_size_properties" // ZeDeviceUsablememSizePropertiesExtVersion (ze_device_usablemem_size_properties_ext_version_t) Device Usable Mem Size Extension Version(s) -type ZeDeviceUsablememSizePropertiesExtVersion uintptr +type ZeDeviceUsablememSizePropertiesExtVersion uint32 const ( ZE_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_VERSION_1_0 ZeDeviceUsablememSizePropertiesExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_VERSION_1_0 version 1.0 diff --git a/gozel/core_driver.go b/gozel/core_driver.go index ea635fc..26714dc 100644 --- a/gozel/core_driver.go +++ b/gozel/core_driver.go @@ -211,7 +211,7 @@ func ZeInitDrivers( // / @details // / - API versions contain major and minor attributes, use // / ::ZE_MAJOR_VERSION and ::ZE_MINOR_VERSION -type ZeApiVersion uintptr +type ZeApiVersion uint32 const ( ZE_API_VERSION_1_0 ZeApiVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_API_VERSION_1_0 version 1.0 diff --git a/gozel/core_driverDDIHandles.go b/gozel/core_driverDDIHandles.go index 58632b6..9359f82 100644 --- a/gozel/core_driverDDIHandles.go +++ b/gozel/core_driverDDIHandles.go @@ -21,7 +21,7 @@ import ( const ZE_DRIVER_DDI_HANDLES_EXT_NAME = "ZE_extension_driver_ddi_handles" // ZeDriverDdiHandlesExtVersion (ze_driver_ddi_handles_ext_version_t) Driver Direct Device Interface (DDI) Handles Extension Version(s) -type ZeDriverDdiHandlesExtVersion uintptr +type ZeDriverDdiHandlesExtVersion uint32 const ( ZE_DRIVER_DDI_HANDLES_EXT_VERSION_1_0 ZeDriverDdiHandlesExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_DRIVER_DDI_HANDLES_EXT_VERSION_1_0 version 1.0 diff --git a/gozel/core_eventQueryKernelTimestamps.go b/gozel/core_eventQueryKernelTimestamps.go index e9dcaa1..ab63d63 100644 --- a/gozel/core_eventQueryKernelTimestamps.go +++ b/gozel/core_eventQueryKernelTimestamps.go @@ -23,7 +23,7 @@ import ( const ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_NAME = "ZE_extension_event_query_kernel_timestamps" // ZeEventQueryKernelTimestampsExtVersion (ze_event_query_kernel_timestamps_ext_version_t) Event Query Kernel Timestamps Extension Version(s) -type ZeEventQueryKernelTimestampsExtVersion uintptr +type ZeEventQueryKernelTimestampsExtVersion uint32 const ( ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_VERSION_1_0 ZeEventQueryKernelTimestampsExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_EVENT_QUERY_KERNEL_TIMESTAMPS_EXT_VERSION_1_0 version 1.0 diff --git a/gozel/core_eventquerytimestamps.go b/gozel/core_eventquerytimestamps.go index 215335b..a7b683a 100644 --- a/gozel/core_eventquerytimestamps.go +++ b/gozel/core_eventquerytimestamps.go @@ -23,7 +23,7 @@ import ( const ZE_EVENT_QUERY_TIMESTAMPS_EXP_NAME = "ZE_experimental_event_query_timestamps" // ZeEventQueryTimestampsExpVersion (ze_event_query_timestamps_exp_version_t) Event Query Timestamps Extension Version(s) -type ZeEventQueryTimestampsExpVersion uintptr +type ZeEventQueryTimestampsExpVersion uint32 const ( ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_1_0 ZeEventQueryTimestampsExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_EVENT_QUERY_TIMESTAMPS_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/core_externalMemMap.go b/gozel/core_externalMemMap.go index 66ab7f5..6854eba 100644 --- a/gozel/core_externalMemMap.go +++ b/gozel/core_externalMemMap.go @@ -21,7 +21,7 @@ import ( const ZE_EXTERNAL_MEMORY_MAPPING_EXT_NAME = "ZE_extension_external_memmap_sysmem" // ZeExternalMemmapSysmemExtVersion (ze_external_memmap_sysmem_ext_version_t) External Memory Mapping Extension Version(s) -type ZeExternalMemmapSysmemExtVersion uintptr +type ZeExternalMemmapSysmemExtVersion uint32 const ( ZE_EXTERNAL_MEMMAP_SYSMEM_EXT_VERSION_1_0 ZeExternalMemmapSysmemExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_EXTERNAL_MEMMAP_SYSMEM_EXT_VERSION_1_0 version 1.0 diff --git a/gozel/core_externalSemaphores.go b/gozel/core_externalSemaphores.go index aedf652..3205f23 100644 --- a/gozel/core_externalSemaphores.go +++ b/gozel/core_externalSemaphores.go @@ -23,7 +23,7 @@ import ( const ZE_EXTERNAL_SEMAPHORES_EXTENSION_NAME = "ZE_extension_external_semaphores" // ZeExternalSemaphoreExtVersion (ze_external_semaphore_ext_version_t) External Semaphores Extension Version -type ZeExternalSemaphoreExtVersion uintptr +type ZeExternalSemaphoreExtVersion uint32 const ( ZE_EXTERNAL_SEMAPHORE_EXT_VERSION_1_0 ZeExternalSemaphoreExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_EXTERNAL_SEMAPHORE_EXT_VERSION_1_0 version 1.0 diff --git a/gozel/core_fabric.go b/gozel/core_fabric.go index ed1f3df..12fcf20 100644 --- a/gozel/core_fabric.go +++ b/gozel/core_fabric.go @@ -23,7 +23,7 @@ import ( const ZE_FABRIC_EXP_NAME = "ZE_experimental_fabric" // ZeFabricExpVersion (ze_fabric_exp_version_t) Fabric Topology Discovery Extension Version(s) -type ZeFabricExpVersion uintptr +type ZeFabricExpVersion uint32 const ( ZE_FABRIC_EXP_VERSION_1_0 ZeFabricExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_FABRIC_EXP_VERSION_1_0 version 1.0 @@ -36,7 +36,7 @@ const ( const ZE_MAX_FABRIC_EDGE_MODEL_EXP_SIZE = 256 // ZeFabricVertexExpType (ze_fabric_vertex_exp_type_t) Fabric Vertex types -type ZeFabricVertexExpType uintptr +type ZeFabricVertexExpType uint32 const ( ZE_FABRIC_VERTEX_EXP_TYPE_UNKNOWN ZeFabricVertexExpType = 0 // ZE_FABRIC_VERTEX_EXP_TYPE_UNKNOWN Fabric vertex type is unknown @@ -48,7 +48,7 @@ const ( ) // ZeFabricEdgeExpDuplexity (ze_fabric_edge_exp_duplexity_t) Fabric edge duplexity -type ZeFabricEdgeExpDuplexity uintptr +type ZeFabricEdgeExpDuplexity uint32 const ( ZE_FABRIC_EDGE_EXP_DUPLEXITY_UNKNOWN ZeFabricEdgeExpDuplexity = 0 // ZE_FABRIC_EDGE_EXP_DUPLEXITY_UNKNOWN Fabric edge duplexity is unknown diff --git a/gozel/core_floatAtomics.go b/gozel/core_floatAtomics.go index 2d8eb01..6a7bc5b 100644 --- a/gozel/core_floatAtomics.go +++ b/gozel/core_floatAtomics.go @@ -21,7 +21,7 @@ import ( const ZE_FLOAT_ATOMICS_EXT_NAME = "ZE_extension_float_atomics" // ZeFloatAtomicsExtVersion (ze_float_atomics_ext_version_t) Floating-Point Atomics Extension Version(s) -type ZeFloatAtomicsExtVersion uintptr +type ZeFloatAtomicsExtVersion uint32 const ( ZE_FLOAT_ATOMICS_EXT_VERSION_1_0 ZeFloatAtomicsExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_FLOAT_ATOMICS_EXT_VERSION_1_0 version 1.0 diff --git a/gozel/core_globaloffset.go b/gozel/core_globaloffset.go index a4fb230..9e1329d 100644 --- a/gozel/core_globaloffset.go +++ b/gozel/core_globaloffset.go @@ -21,7 +21,7 @@ import ( const ZE_GLOBAL_OFFSET_EXP_NAME = "ZE_experimental_global_offset" // ZeGlobalOffsetExpVersion (ze_global_offset_exp_version_t) Global Offset Extension Version(s) -type ZeGlobalOffsetExpVersion uintptr +type ZeGlobalOffsetExpVersion uint32 const ( ZE_GLOBAL_OFFSET_EXP_VERSION_1_0 ZeGlobalOffsetExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_GLOBAL_OFFSET_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/core_image.go b/gozel/core_image.go index ea91bc2..1db1fac 100644 --- a/gozel/core_image.go +++ b/gozel/core_image.go @@ -30,7 +30,7 @@ const ( ) // ZeImageType (ze_image_type_t) Supported image types -type ZeImageType uintptr +type ZeImageType uint32 const ( ZE_IMAGE_TYPE_1D ZeImageType = 0 // ZE_IMAGE_TYPE_1D 1D @@ -44,7 +44,7 @@ const ( ) // ZeImageFormatLayout (ze_image_format_layout_t) Supported image format layouts -type ZeImageFormatLayout uintptr +type ZeImageFormatLayout uint32 const ( ZE_IMAGE_FORMAT_LAYOUT_8 ZeImageFormatLayout = 0 // ZE_IMAGE_FORMAT_LAYOUT_8 8-bit single component layout @@ -98,7 +98,7 @@ const ( ) // ZeImageFormatType (ze_image_format_type_t) Supported image format types -type ZeImageFormatType uintptr +type ZeImageFormatType uint32 const ( ZE_IMAGE_FORMAT_TYPE_UINT ZeImageFormatType = 0 // ZE_IMAGE_FORMAT_TYPE_UINT Unsigned integer @@ -111,7 +111,7 @@ const ( ) // ZeImageFormatSwizzle (ze_image_format_swizzle_t) Supported image format component swizzle into channel -type ZeImageFormatSwizzle uintptr +type ZeImageFormatSwizzle uint32 const ( ZE_IMAGE_FORMAT_SWIZZLE_R ZeImageFormatSwizzle = 0 // ZE_IMAGE_FORMAT_SWIZZLE_R Red component diff --git a/gozel/core_imageCopy.go b/gozel/core_imageCopy.go index aa32a30..0f3f1ed 100644 --- a/gozel/core_imageCopy.go +++ b/gozel/core_imageCopy.go @@ -23,7 +23,7 @@ import ( const ZE_IMAGE_COPY_EXT_NAME = "ZE_extension_image_copy" // ZeImageCopyExtVersion (ze_image_copy_ext_version_t) Image Copy Extension Version(s) -type ZeImageCopyExtVersion uintptr +type ZeImageCopyExtVersion uint32 const ( ZE_IMAGE_COPY_EXT_VERSION_1_0 ZeImageCopyExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_IMAGE_COPY_EXT_VERSION_1_0 version 1.0 diff --git a/gozel/core_imageFormatSupport.go b/gozel/core_imageFormatSupport.go index e719ece..756f981 100644 --- a/gozel/core_imageFormatSupport.go +++ b/gozel/core_imageFormatSupport.go @@ -21,7 +21,7 @@ import ( const ZE_IMAGE_FORMAT_SUPPORT_EXT_NAME = "ZE_extension_image_format_support" // ZeImageFormatSupportExtVersion (ze_image_format_support_ext_version_t) Image Format Support Extension Version(s) -type ZeImageFormatSupportExtVersion uintptr +type ZeImageFormatSupportExtVersion uint32 const ( ZE_IMAGE_FORMAT_SUPPORT_EXT_VERSION_1_0 ZeImageFormatSupportExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_IMAGE_FORMAT_SUPPORT_EXT_VERSION_1_0 version 1.0 diff --git a/gozel/core_imageQueryAllocProperties.go b/gozel/core_imageQueryAllocProperties.go index f84b194..78dc9c7 100644 --- a/gozel/core_imageQueryAllocProperties.go +++ b/gozel/core_imageQueryAllocProperties.go @@ -23,7 +23,7 @@ import ( const ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_NAME = "ZE_extension_image_query_alloc_properties" // ZeImageQueryAllocPropertiesExtVersion (ze_image_query_alloc_properties_ext_version_t) Image Query Allocation Properties Extension Version(s) -type ZeImageQueryAllocPropertiesExtVersion uintptr +type ZeImageQueryAllocPropertiesExtVersion uint32 const ( ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_VERSION_1_0 ZeImageQueryAllocPropertiesExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_IMAGE_QUERY_ALLOC_PROPERTIES_EXT_VERSION_1_0 version 1.0 diff --git a/gozel/core_imagememoryproperties.go b/gozel/core_imagememoryproperties.go index b00c0c6..1d47492 100644 --- a/gozel/core_imagememoryproperties.go +++ b/gozel/core_imagememoryproperties.go @@ -23,7 +23,7 @@ import ( const ZE_IMAGE_MEMORY_PROPERTIES_EXP_NAME = "ZE_experimental_image_memory_properties" // ZeImageMemoryPropertiesExpVersion (ze_image_memory_properties_exp_version_t) Image Memory Properties Extension Version(s) -type ZeImageMemoryPropertiesExpVersion uintptr +type ZeImageMemoryPropertiesExpVersion uint32 const ( ZE_IMAGE_MEMORY_PROPERTIES_EXP_VERSION_1_0 ZeImageMemoryPropertiesExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_IMAGE_MEMORY_PROPERTIES_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/core_imageview.go b/gozel/core_imageview.go index 0f8882d..9bd01be 100644 --- a/gozel/core_imageview.go +++ b/gozel/core_imageview.go @@ -23,7 +23,7 @@ import ( const ZE_IMAGE_VIEW_EXT_NAME = "ZE_extension_image_view" // ZeImageViewExtVersion (ze_image_view_ext_version_t) Image View Extension Version(s) -type ZeImageViewExtVersion uintptr +type ZeImageViewExtVersion uint32 const ( ZE_IMAGE_VIEW_EXT_VERSION_1_0 ZeImageViewExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_IMAGE_VIEW_EXT_VERSION_1_0 version 1.0 @@ -91,7 +91,7 @@ func ZeImageViewCreateExt( const ZE_IMAGE_VIEW_EXP_NAME = "ZE_experimental_image_view" // ZeImageViewExpVersion (ze_image_view_exp_version_t) Image View Extension Version(s) -type ZeImageViewExpVersion uintptr +type ZeImageViewExpVersion uint32 const ( ZE_IMAGE_VIEW_EXP_VERSION_1_0 ZeImageViewExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_IMAGE_VIEW_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/core_imageviewplanar.go b/gozel/core_imageviewplanar.go index de8b9da..9a09770 100644 --- a/gozel/core_imageviewplanar.go +++ b/gozel/core_imageviewplanar.go @@ -21,7 +21,7 @@ import ( const ZE_IMAGE_VIEW_PLANAR_EXT_NAME = "ZE_extension_image_view_planar" // ZeImageViewPlanarExtVersion (ze_image_view_planar_ext_version_t) Image View Planar Extension Version(s) -type ZeImageViewPlanarExtVersion uintptr +type ZeImageViewPlanarExtVersion uint32 const ( ZE_IMAGE_VIEW_PLANAR_EXT_VERSION_1_0 ZeImageViewPlanarExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_IMAGE_VIEW_PLANAR_EXT_VERSION_1_0 version 1.0 @@ -42,7 +42,7 @@ type ZeImageViewPlanarExtDesc struct { const ZE_IMAGE_VIEW_PLANAR_EXP_NAME = "ZE_experimental_image_view_planar" // ZeImageViewPlanarExpVersion (ze_image_view_planar_exp_version_t) Image View Planar Extension Version(s) -type ZeImageViewPlanarExpVersion uintptr +type ZeImageViewPlanarExpVersion uint32 const ( ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_1_0 ZeImageViewPlanarExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_IMAGE_VIEW_PLANAR_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/core_immediateCommandListAppend.go b/gozel/core_immediateCommandListAppend.go index fdd7118..1b5c38a 100644 --- a/gozel/core_immediateCommandListAppend.go +++ b/gozel/core_immediateCommandListAppend.go @@ -23,7 +23,7 @@ import ( const ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_NAME = "ZE_experimental_immediate_command_list_append" // ZeImmediateCommandListAppendExpVersion (ze_immediate_command_list_append_exp_version_t) Immediate Command List Append Extension Version(s) -type ZeImmediateCommandListAppendExpVersion uintptr +type ZeImmediateCommandListAppendExpVersion uint32 const ( ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_VERSION_1_0 ZeImmediateCommandListAppendExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_IMMEDIATE_COMMAND_LIST_APPEND_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/core_ipcMemHandleType.go b/gozel/core_ipcMemHandleType.go index 01b2d53..120cfaf 100644 --- a/gozel/core_ipcMemHandleType.go +++ b/gozel/core_ipcMemHandleType.go @@ -23,7 +23,7 @@ import ( const ZE_IPC_MEM_HANDLE_TYPE_EXT_NAME = "ZE_extension_ipc_mem_handle_type" // ZeIpcMemHandleTypeExtVersion (ze_ipc_mem_handle_type_ext_version_t) IPC Memory Handle Type Extension Version(s) -type ZeIpcMemHandleTypeExtVersion uintptr +type ZeIpcMemHandleTypeExtVersion uint32 const ( ZE_IPC_MEM_HANDLE_TYPE_EXT_VERSION_1_0 ZeIpcMemHandleTypeExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_IPC_MEM_HANDLE_TYPE_EXT_VERSION_1_0 version 1.0 diff --git a/gozel/core_kernelAllocationProperties.go b/gozel/core_kernelAllocationProperties.go index dcb5005..436c142 100644 --- a/gozel/core_kernelAllocationProperties.go +++ b/gozel/core_kernelAllocationProperties.go @@ -23,7 +23,7 @@ import ( const ZE_GET_KERNEL_ALLOCATION_PROPERTIES_EXP_NAME = "ZE_experimental_kernel_allocation_properties" // ZeKernelGetAllocationPropertiesExpVersion (ze_kernel_get_allocation_properties_exp_version_t) Get Kernel Allocation Properties Extension Version(s) -type ZeKernelGetAllocationPropertiesExpVersion uintptr +type ZeKernelGetAllocationPropertiesExpVersion uint32 const ( ZE_KERNEL_GET_ALLOCATION_PROPERTIES_EXP_VERSION_1_0 ZeKernelGetAllocationPropertiesExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_KERNEL_GET_ALLOCATION_PROPERTIES_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/core_kernelBinary.go b/gozel/core_kernelBinary.go index 6732865..ca5232f 100644 --- a/gozel/core_kernelBinary.go +++ b/gozel/core_kernelBinary.go @@ -23,7 +23,7 @@ import ( const ZE_GET_KERNEL_BINARY_EXP_NAME = "ZE_extension_kernel_binary_exp" // ZeKernelGetBinaryExpVersion (ze_kernel_get_binary_exp_version_t) Get Kernel Binary Extension Version(s) -type ZeKernelGetBinaryExpVersion uintptr +type ZeKernelGetBinaryExpVersion uint32 const ( ZE_KERNEL_GET_BINARY_EXP_VERSION_1_0 ZeKernelGetBinaryExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_KERNEL_GET_BINARY_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/core_kernelMaxGroupSizeProperties.go b/gozel/core_kernelMaxGroupSizeProperties.go index c64bdfd..305e8a5 100644 --- a/gozel/core_kernelMaxGroupSizeProperties.go +++ b/gozel/core_kernelMaxGroupSizeProperties.go @@ -21,7 +21,7 @@ import ( const ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_NAME = "ZE_extension_kernel_max_group_size_properties" // ZeKernelMaxGroupSizePropertiesExtVersion (ze_kernel_max_group_size_properties_ext_version_t) Kernel Max Group Size Properties Extension Version(s) -type ZeKernelMaxGroupSizePropertiesExtVersion uintptr +type ZeKernelMaxGroupSizePropertiesExtVersion uint32 const ( ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_VERSION_1_0 ZeKernelMaxGroupSizePropertiesExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_VERSION_1_0 version 1.0 diff --git a/gozel/core_kernelSchedulingHints.go b/gozel/core_kernelSchedulingHints.go index 6ba3920..2d14298 100644 --- a/gozel/core_kernelSchedulingHints.go +++ b/gozel/core_kernelSchedulingHints.go @@ -23,7 +23,7 @@ import ( const ZE_KERNEL_SCHEDULING_HINTS_EXP_NAME = "ZE_experimental_scheduling_hints" // ZeSchedulingHintsExpVersion (ze_scheduling_hints_exp_version_t) Kernel Scheduling Hints Extension Version(s) -type ZeSchedulingHintsExpVersion uintptr +type ZeSchedulingHintsExpVersion uint32 const ( ZE_SCHEDULING_HINTS_EXP_VERSION_1_0 ZeSchedulingHintsExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_SCHEDULING_HINTS_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/core_linkageInspection.go b/gozel/core_linkageInspection.go index 88c07d4..74c8c51 100644 --- a/gozel/core_linkageInspection.go +++ b/gozel/core_linkageInspection.go @@ -23,7 +23,7 @@ import ( const ZE_LINKAGE_INSPECTION_EXT_NAME = "ZE_extension_linkage_inspection" // ZeLinkageInspectionExtVersion (ze_linkage_inspection_ext_version_t) Linkage Inspection Extension Version(s) -type ZeLinkageInspectionExtVersion uintptr +type ZeLinkageInspectionExtVersion uint32 const ( ZE_LINKAGE_INSPECTION_EXT_VERSION_1_0 ZeLinkageInspectionExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_LINKAGE_INSPECTION_EXT_VERSION_1_0 version 1.0 diff --git a/gozel/core_linkonceodr.go b/gozel/core_linkonceodr.go index b2d4e61..8c349ec 100644 --- a/gozel/core_linkonceodr.go +++ b/gozel/core_linkonceodr.go @@ -17,7 +17,7 @@ package gozel const ZE_LINKONCE_ODR_EXT_NAME = "ZE_extension_linkonce_odr" // ZeLinkonceOdrExtVersion (ze_linkonce_odr_ext_version_t) Linkonce ODR Extension Version(s) -type ZeLinkonceOdrExtVersion uintptr +type ZeLinkonceOdrExtVersion uint32 const ( ZE_LINKONCE_ODR_EXT_VERSION_1_0 ZeLinkonceOdrExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_LINKONCE_ODR_EXT_VERSION_1_0 version 1.0 diff --git a/gozel/core_memory.go b/gozel/core_memory.go index 5a2f6d9..24b7a0c 100644 --- a/gozel/core_memory.go +++ b/gozel/core_memory.go @@ -262,7 +262,7 @@ func ZeMemFree( } // ZeMemoryType (ze_memory_type_t) Memory allocation type -type ZeMemoryType uintptr +type ZeMemoryType uint32 const ( ZE_MEMORY_TYPE_UNKNOWN ZeMemoryType = 0 // ZE_MEMORY_TYPE_UNKNOWN the memory pointed to is of unknown type diff --git a/gozel/core_memoryCompressionHints.go b/gozel/core_memoryCompressionHints.go index 708e13b..eb62c6d 100644 --- a/gozel/core_memoryCompressionHints.go +++ b/gozel/core_memoryCompressionHints.go @@ -21,7 +21,7 @@ import ( const ZE_MEMORY_COMPRESSION_HINTS_EXT_NAME = "ZE_extension_memory_compression_hints" // ZeMemoryCompressionHintsExtVersion (ze_memory_compression_hints_ext_version_t) Memory Compression Hints Extension Version(s) -type ZeMemoryCompressionHintsExtVersion uintptr +type ZeMemoryCompressionHintsExtVersion uint32 const ( ZE_MEMORY_COMPRESSION_HINTS_EXT_VERSION_1_0 ZeMemoryCompressionHintsExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_MEMORY_COMPRESSION_HINTS_EXT_VERSION_1_0 version 1.0 diff --git a/gozel/core_memoryFreePolicies.go b/gozel/core_memoryFreePolicies.go index 9c39911..e98e402 100644 --- a/gozel/core_memoryFreePolicies.go +++ b/gozel/core_memoryFreePolicies.go @@ -23,7 +23,7 @@ import ( const ZE_MEMORY_FREE_POLICIES_EXT_NAME = "ZE_extension_memory_free_policies" // ZeMemoryFreePoliciesExtVersion (ze_memory_free_policies_ext_version_t) Memory Free Policies Extension Version(s) -type ZeMemoryFreePoliciesExtVersion uintptr +type ZeMemoryFreePoliciesExtVersion uint32 const ( ZE_MEMORY_FREE_POLICIES_EXT_VERSION_1_0 ZeMemoryFreePoliciesExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_MEMORY_FREE_POLICIES_EXT_VERSION_1_0 version 1.0 diff --git a/gozel/core_memoryProperties.go b/gozel/core_memoryProperties.go index d8d47af..149debe 100644 --- a/gozel/core_memoryProperties.go +++ b/gozel/core_memoryProperties.go @@ -21,7 +21,7 @@ import ( const ZE_DEVICE_MEMORY_PROPERTIES_EXT_NAME = "ZE_extension_device_memory_properties" // ZeDeviceMemoryPropertiesExtVersion (ze_device_memory_properties_ext_version_t) Device Memory Properties Extension Version(s) -type ZeDeviceMemoryPropertiesExtVersion uintptr +type ZeDeviceMemoryPropertiesExtVersion uint32 const ( ZE_DEVICE_MEMORY_PROPERTIES_EXT_VERSION_1_0 ZeDeviceMemoryPropertiesExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_DEVICE_MEMORY_PROPERTIES_EXT_VERSION_1_0 version 1.0 @@ -31,7 +31,7 @@ const ( ) // ZeDeviceMemoryExtType (ze_device_memory_ext_type_t) Memory module types -type ZeDeviceMemoryExtType uintptr +type ZeDeviceMemoryExtType uint32 const ( ZE_DEVICE_MEMORY_EXT_TYPE_HBM ZeDeviceMemoryExtType = 0 // ZE_DEVICE_MEMORY_EXT_TYPE_HBM HBM memory diff --git a/gozel/core_module.go b/gozel/core_module.go index cb5360b..70ed777 100644 --- a/gozel/core_module.go +++ b/gozel/core_module.go @@ -20,7 +20,7 @@ import ( ) // ZeModuleFormat (ze_module_format_t) Supported module creation input formats -type ZeModuleFormat uintptr +type ZeModuleFormat uint32 const ( ZE_MODULE_FORMAT_IL_SPIRV ZeModuleFormat = 0 // ZE_MODULE_FORMAT_IL_SPIRV Format is SPIRV IL format diff --git a/gozel/core_mutableCommandList.go b/gozel/core_mutableCommandList.go index 2811789..ce3b540 100644 --- a/gozel/core_mutableCommandList.go +++ b/gozel/core_mutableCommandList.go @@ -23,7 +23,7 @@ import ( const ZE_MUTABLE_COMMAND_LIST_EXP_NAME = "ZE_experimental_mutable_command_list" // ZeMutableCommandListExpVersion (ze_mutable_command_list_exp_version_t) Mutable Command List Extension Version(s) -type ZeMutableCommandListExpVersion uintptr +type ZeMutableCommandListExpVersion uint32 const ( ZE_MUTABLE_COMMAND_LIST_EXP_VERSION_1_0 ZeMutableCommandListExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_MUTABLE_COMMAND_LIST_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/core_powersavinghint.go b/gozel/core_powersavinghint.go index 3cb7cf7..98da297 100644 --- a/gozel/core_powersavinghint.go +++ b/gozel/core_powersavinghint.go @@ -21,7 +21,7 @@ import ( const ZE_CONTEXT_POWER_SAVING_HINT_EXP_NAME = "ZE_experimental_power_saving_hint" // ZePowerSavingHintExpVersion (ze_power_saving_hint_exp_version_t) Power Saving Hint Extension Version(s) -type ZePowerSavingHintExpVersion uintptr +type ZePowerSavingHintExpVersion uint32 const ( ZE_POWER_SAVING_HINT_EXP_VERSION_1_0 ZePowerSavingHintExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_POWER_SAVING_HINT_EXP_VERSION_1_0 version 1.0 @@ -31,7 +31,7 @@ const ( ) // ZePowerSavingHintType (ze_power_saving_hint_type_t) Supported device types -type ZePowerSavingHintType uintptr +type ZePowerSavingHintType uint32 const ( ZE_POWER_SAVING_HINT_TYPE_MIN ZePowerSavingHintType = 0 // ZE_POWER_SAVING_HINT_TYPE_MIN Minumum power savings. The device will make no attempt to save power diff --git a/gozel/core_program.go b/gozel/core_program.go index 19a48f7..72c0bfd 100644 --- a/gozel/core_program.go +++ b/gozel/core_program.go @@ -21,7 +21,7 @@ import ( const ZE_MODULE_PROGRAM_EXP_NAME = "ZE_experimental_module_program" // ZeModuleProgramExpVersion (ze_module_program_exp_version_t) Module Program Extension Version(s) -type ZeModuleProgramExpVersion uintptr +type ZeModuleProgramExpVersion uint32 const ( ZE_MODULE_PROGRAM_EXP_VERSION_1_0 ZeModuleProgramExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_MODULE_PROGRAM_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/core_raytracing.go b/gozel/core_raytracing.go index 088915d..be3dc19 100644 --- a/gozel/core_raytracing.go +++ b/gozel/core_raytracing.go @@ -21,7 +21,7 @@ import ( const ZE_RAYTRACING_EXT_NAME = "ZE_extension_raytracing" // ZeRaytracingExtVersion (ze_raytracing_ext_version_t) Raytracing Extension Version(s) -type ZeRaytracingExtVersion uintptr +type ZeRaytracingExtVersion uint32 const ( ZE_RAYTRACING_EXT_VERSION_1_0 ZeRaytracingExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_RAYTRACING_EXT_VERSION_1_0 version 1.0 diff --git a/gozel/core_relaxedAllocLimits.go b/gozel/core_relaxedAllocLimits.go index 9d82834..a24123a 100644 --- a/gozel/core_relaxedAllocLimits.go +++ b/gozel/core_relaxedAllocLimits.go @@ -21,7 +21,7 @@ import ( const ZE_RELAXED_ALLOCATION_LIMITS_EXP_NAME = "ZE_experimental_relaxed_allocation_limits" // ZeRelaxedAllocationLimitsExpVersion (ze_relaxed_allocation_limits_exp_version_t) Relaxed Allocation Limits Extension Version(s) -type ZeRelaxedAllocationLimitsExpVersion uintptr +type ZeRelaxedAllocationLimitsExpVersion uint32 const ( ZE_RELAXED_ALLOCATION_LIMITS_EXP_VERSION_1_0 ZeRelaxedAllocationLimitsExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_RELAXED_ALLOCATION_LIMITS_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/core_sampler.go b/gozel/core_sampler.go index 8332f4d..05f3d31 100644 --- a/gozel/core_sampler.go +++ b/gozel/core_sampler.go @@ -20,7 +20,7 @@ import ( ) // ZeSamplerAddressMode (ze_sampler_address_mode_t) Sampler addressing modes -type ZeSamplerAddressMode uintptr +type ZeSamplerAddressMode uint32 const ( ZE_SAMPLER_ADDRESS_MODE_NONE ZeSamplerAddressMode = 0 // ZE_SAMPLER_ADDRESS_MODE_NONE No coordinate modifications for out-of-bounds image access. @@ -37,7 +37,7 @@ const ( ) // ZeSamplerFilterMode (ze_sampler_filter_mode_t) Sampler filtering modes -type ZeSamplerFilterMode uintptr +type ZeSamplerFilterMode uint32 const ( ZE_SAMPLER_FILTER_MODE_NEAREST ZeSamplerFilterMode = 0 // ZE_SAMPLER_FILTER_MODE_NEAREST No coordinate modifications for out of bounds image access. diff --git a/gozel/core_subAllocationsProperties.go b/gozel/core_subAllocationsProperties.go index 7e626db..73fe8a0 100644 --- a/gozel/core_subAllocationsProperties.go +++ b/gozel/core_subAllocationsProperties.go @@ -21,7 +21,7 @@ import ( const ZE_SUB_ALLOCATIONS_EXP_NAME = "ZE_experimental_sub_allocations" // ZeSubAllocationsExpVersion (ze_sub_allocations_exp_version_t) Sub-Allocations Properties Extension Version(s) -type ZeSubAllocationsExpVersion uintptr +type ZeSubAllocationsExpVersion uint32 const ( ZE_SUB_ALLOCATIONS_EXP_VERSION_1_0 ZeSubAllocationsExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_SUB_ALLOCATIONS_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/core_subgroups.go b/gozel/core_subgroups.go index e59e533..72825c3 100644 --- a/gozel/core_subgroups.go +++ b/gozel/core_subgroups.go @@ -17,7 +17,7 @@ package gozel const ZE_SUBGROUPS_EXT_NAME = "ZE_extension_subgroups" // ZeSubgroupExtVersion (ze_subgroup_ext_version_t) Subgroups Extension Version(s) -type ZeSubgroupExtVersion uintptr +type ZeSubgroupExtVersion uint32 const ( ZE_SUBGROUP_EXT_VERSION_1_0 ZeSubgroupExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_SUBGROUP_EXT_VERSION_1_0 version 1.0 diff --git a/gozel/core_virtual.go b/gozel/core_virtual.go index aafbbe1..bb8068a 100644 --- a/gozel/core_virtual.go +++ b/gozel/core_virtual.go @@ -20,7 +20,7 @@ import ( ) // ZeMemoryAccessAttribute (ze_memory_access_attribute_t) Virtual memory page access attributes -type ZeMemoryAccessAttribute uintptr +type ZeMemoryAccessAttribute uint32 const ( ZE_MEMORY_ACCESS_ATTRIBUTE_NONE ZeMemoryAccessAttribute = 0 // ZE_MEMORY_ACCESS_ATTRIBUTE_NONE Indicates the memory page is inaccessible. diff --git a/gozel/sysm_Overclock.go b/gozel/sysm_Overclock.go index 944ef06..1b790e2 100644 --- a/gozel/sysm_Overclock.go +++ b/gozel/sysm_Overclock.go @@ -20,7 +20,7 @@ import ( ) // ZesOverclockDomain (zes_overclock_domain_t) Overclock domains. -type ZesOverclockDomain uintptr +type ZesOverclockDomain uint32 const ( ZES_OVERCLOCK_DOMAIN_CARD ZesOverclockDomain = 1 // ZES_OVERCLOCK_DOMAIN_CARD Overclocking card level properties such as temperature limits. @@ -37,7 +37,7 @@ const ( ) // ZesOverclockControl (zes_overclock_control_t) Overclock controls. -type ZesOverclockControl uintptr +type ZesOverclockControl uint32 const ( ZES_OVERCLOCK_CONTROL_VF ZesOverclockControl = 1 // ZES_OVERCLOCK_CONTROL_VF This control permits setting a custom V-F curve. @@ -66,7 +66,7 @@ const ( ) // ZesOverclockMode (zes_overclock_mode_t) Overclock modes. -type ZesOverclockMode uintptr +type ZesOverclockMode uint32 const ( ZES_OVERCLOCK_MODE_MODE_OFF ZesOverclockMode = 0 // ZES_OVERCLOCK_MODE_MODE_OFF Overclock mode is off @@ -82,7 +82,7 @@ const ( ) // ZesControlState (zes_control_state_t) Overclock control states. -type ZesControlState uintptr +type ZesControlState uint32 const ( ZES_CONTROL_STATE_STATE_UNSET ZesControlState = 0 // ZES_CONTROL_STATE_STATE_UNSET No overclock control has not been changed by the driver since the last @@ -99,7 +99,7 @@ const ( ) // ZesPendingAction (zes_pending_action_t) Overclock pending actions. -type ZesPendingAction uintptr +type ZesPendingAction uint32 const ( ZES_PENDING_ACTION_PENDING_NONE ZesPendingAction = 0 // ZES_PENDING_ACTION_PENDING_NONE There no pending actions. . @@ -114,7 +114,7 @@ const ( ) // ZesVfProgramType (zes_vf_program_type_t) Overclock V-F curve programing. -type ZesVfProgramType uintptr +type ZesVfProgramType uint32 const ( ZES_VF_PROGRAM_TYPE_VF_ARBITRARY ZesVfProgramType = 0 // ZES_VF_PROGRAM_TYPE_VF_ARBITRARY Can program an arbitrary number of V-F points up to the maximum number @@ -135,7 +135,7 @@ const ( ) // ZesVfType (zes_vf_type_t) VF type -type ZesVfType uintptr +type ZesVfType uint32 const ( ZES_VF_TYPE_VOLT ZesVfType = 0 // ZES_VF_TYPE_VOLT VF Voltage point @@ -145,7 +145,7 @@ const ( ) // ZesVfArrayType (zes_vf_array_type_t) VF type -type ZesVfArrayType uintptr +type ZesVfArrayType uint32 const ( ZES_VF_ARRAY_TYPE_USER_VF_ARRAY ZesVfArrayType = 0 // ZES_VF_ARRAY_TYPE_USER_VF_ARRAY User V-F array diff --git a/gozel/sysm_common.go b/gozel/sysm_common.go index fc36471..43f3885 100644 --- a/gozel/sysm_common.go +++ b/gozel/sysm_common.go @@ -75,7 +75,7 @@ type ZesOverclockHandle uintptr type ZesVfHandle uintptr // ZesStructureType (zes_structure_type_t) Defines structure types -type ZesStructureType uintptr +type ZesStructureType uint32 const ( ZES_STRUCTURE_TYPE_DEVICE_PROPERTIES ZesStructureType = 0x1 // ZES_STRUCTURE_TYPE_DEVICE_PROPERTIES ::zes_device_properties_t diff --git a/gozel/sysm_device.go b/gozel/sysm_device.go index d9b4077..7c98d1b 100644 --- a/gozel/sysm_device.go +++ b/gozel/sysm_device.go @@ -77,7 +77,7 @@ const ( ) // ZesRepairStatus (zes_repair_status_t) Device repair status -type ZesRepairStatus uintptr +type ZesRepairStatus uint32 const ( ZES_REPAIR_STATUS_UNSUPPORTED ZesRepairStatus = 0 // ZES_REPAIR_STATUS_UNSUPPORTED The device does not support in-field repairs. @@ -101,7 +101,7 @@ const ( ) // ZesResetType (zes_reset_type_t) Device reset type -type ZesResetType uintptr +type ZesResetType uint32 const ( ZES_RESET_TYPE_WARM ZesResetType = 0 // ZES_RESET_TYPE_WARM Apply warm reset @@ -136,7 +136,7 @@ type ZesUuid struct { } // ZesDeviceType (zes_device_type_t) Supported device types -type ZesDeviceType uintptr +type ZesDeviceType uint32 const ( ZES_DEVICE_TYPE_GPU ZesDeviceType = 1 // ZES_DEVICE_TYPE_GPU Graphics Processing Unit @@ -417,7 +417,7 @@ type ZesPciProperties struct { } // ZesPciLinkStatus (zes_pci_link_status_t) PCI link status -type ZesPciLinkStatus uintptr +type ZesPciLinkStatus uint32 const ( ZES_PCI_LINK_STATUS_UNKNOWN ZesPciLinkStatus = 0 // ZES_PCI_LINK_STATUS_UNKNOWN The link status could not be determined @@ -462,7 +462,7 @@ type ZesPciState struct { } // ZesPciBarType (zes_pci_bar_type_t) PCI bar types -type ZesPciBarType uintptr +type ZesPciBarType uint32 const ( ZES_PCI_BAR_TYPE_MMIO ZesPciBarType = 0 // ZES_PCI_BAR_TYPE_MMIO MMIO registers diff --git a/gozel/sysm_diagnostics.go b/gozel/sysm_diagnostics.go index a147ccc..2901ea3 100644 --- a/gozel/sysm_diagnostics.go +++ b/gozel/sysm_diagnostics.go @@ -20,7 +20,7 @@ import ( ) // ZesDiagResult (zes_diag_result_t) Diagnostic results -type ZesDiagResult uintptr +type ZesDiagResult uint32 const ( ZES_DIAG_RESULT_NO_ERRORS ZesDiagResult = 0 // ZES_DIAG_RESULT_NO_ERRORS Diagnostic completed without finding errors to repair diff --git a/gozel/sysm_ecc.go b/gozel/sysm_ecc.go index 0093240..192b63d 100644 --- a/gozel/sysm_ecc.go +++ b/gozel/sysm_ecc.go @@ -20,7 +20,7 @@ import ( ) // ZesDeviceEccState (zes_device_ecc_state_t) ECC State -type ZesDeviceEccState uintptr +type ZesDeviceEccState uint32 const ( ZES_DEVICE_ECC_STATE_UNAVAILABLE ZesDeviceEccState = 0 // ZES_DEVICE_ECC_STATE_UNAVAILABLE None @@ -31,7 +31,7 @@ const ( ) // ZesDeviceAction (zes_device_action_t) State Change Requirements -type ZesDeviceAction uintptr +type ZesDeviceAction uint32 const ( ZES_DEVICE_ACTION_NONE ZesDeviceAction = 0 // ZES_DEVICE_ACTION_NONE No action. diff --git a/gozel/sysm_eccState.go b/gozel/sysm_eccState.go index d6ed212..edc16c3 100644 --- a/gozel/sysm_eccState.go +++ b/gozel/sysm_eccState.go @@ -21,7 +21,7 @@ import ( const ZES_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_NAME = "ZES_extension_device_ecc_default_properties" // ZesDeviceEccDefaultPropertiesExtVersion (zes_device_ecc_default_properties_ext_version_t) Device ECC default properties Extension Version(s) -type ZesDeviceEccDefaultPropertiesExtVersion uintptr +type ZesDeviceEccDefaultPropertiesExtVersion uint32 const ( ZES_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_VERSION_1_0 ZesDeviceEccDefaultPropertiesExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZES_DEVICE_ECC_DEFAULT_PROPERTIES_EXT_VERSION_1_0 version 1.0 diff --git a/gozel/sysm_engine.go b/gozel/sysm_engine.go index 9640c45..a1775f1 100644 --- a/gozel/sysm_engine.go +++ b/gozel/sysm_engine.go @@ -20,7 +20,7 @@ import ( ) // ZesEngineGroup (zes_engine_group_t) Accelerator engine groups -type ZesEngineGroup uintptr +type ZesEngineGroup uint32 const ( ZES_ENGINE_GROUP_ALL ZesEngineGroup = 0 // ZES_ENGINE_GROUP_ALL Access information about all engines combined. diff --git a/gozel/sysm_engineActivity.go b/gozel/sysm_engineActivity.go index b48591a..1def3bb 100644 --- a/gozel/sysm_engineActivity.go +++ b/gozel/sysm_engineActivity.go @@ -23,7 +23,7 @@ import ( const ZES_ENGINE_ACTIVITY_EXT_NAME = "ZES_extension_engine_activity" // ZesEngineActivityExtVersion (zes_engine_activity_ext_version_t) Engine Activity Extension Version(s) -type ZesEngineActivityExtVersion uintptr +type ZesEngineActivityExtVersion uint32 const ( ZES_ENGINE_ACTIVITY_EXT_VERSION_1_0 ZesEngineActivityExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZES_ENGINE_ACTIVITY_EXT_VERSION_1_0 version 1.0 diff --git a/gozel/sysm_fabric.go b/gozel/sysm_fabric.go index 2a640f5..68ed274 100644 --- a/gozel/sysm_fabric.go +++ b/gozel/sysm_fabric.go @@ -27,7 +27,7 @@ const ZES_MAX_FABRIC_PORT_MODEL_SIZE = 256 const ZES_MAX_FABRIC_LINK_TYPE_SIZE = 256 // ZesFabricPortStatus (zes_fabric_port_status_t) Fabric port status -type ZesFabricPortStatus uintptr +type ZesFabricPortStatus uint32 const ( ZES_FABRIC_PORT_STATUS_UNKNOWN ZesFabricPortStatus = 0 // ZES_FABRIC_PORT_STATUS_UNKNOWN The port status cannot be determined diff --git a/gozel/sysm_fan.go b/gozel/sysm_fan.go index e760e13..9abaa44 100644 --- a/gozel/sysm_fan.go +++ b/gozel/sysm_fan.go @@ -20,7 +20,7 @@ import ( ) // ZesFanSpeedMode (zes_fan_speed_mode_t) Fan resource speed mode -type ZesFanSpeedMode uintptr +type ZesFanSpeedMode uint32 const ( ZES_FAN_SPEED_MODE_DEFAULT ZesFanSpeedMode = 0 // ZES_FAN_SPEED_MODE_DEFAULT The fan speed is operating using the hardware default settings @@ -34,7 +34,7 @@ const ( ) // ZesFanSpeedUnits (zes_fan_speed_units_t) Fan speed units -type ZesFanSpeedUnits uintptr +type ZesFanSpeedUnits uint32 const ( ZES_FAN_SPEED_UNITS_RPM ZesFanSpeedUnits = 0 // ZES_FAN_SPEED_UNITS_RPM The fan speed is in units of revolutions per minute (rpm) diff --git a/gozel/sysm_firmwareSecurityVersion.go b/gozel/sysm_firmwareSecurityVersion.go index 95a3486..470e034 100644 --- a/gozel/sysm_firmwareSecurityVersion.go +++ b/gozel/sysm_firmwareSecurityVersion.go @@ -23,7 +23,7 @@ import ( const ZES_FIRMWARE_SECURITY_VERSION_EXP_NAME = "ZES_experimental_firmware_security_version" // ZesFirmwareSecurityExpVersion (zes_firmware_security_exp_version_t) Firmware security version Extension Version(s) -type ZesFirmwareSecurityExpVersion uintptr +type ZesFirmwareSecurityExpVersion uint32 const ( ZES_FIRMWARE_SECURITY_EXP_VERSION_1_0 ZesFirmwareSecurityExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZES_FIRMWARE_SECURITY_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/sysm_frequency.go b/gozel/sysm_frequency.go index 7159390..116a973 100644 --- a/gozel/sysm_frequency.go +++ b/gozel/sysm_frequency.go @@ -20,7 +20,7 @@ import ( ) // ZesFreqDomain (zes_freq_domain_t) Frequency domains. -type ZesFreqDomain uintptr +type ZesFreqDomain uint32 const ( ZES_FREQ_DOMAIN_GPU ZesFreqDomain = 0 // ZES_FREQ_DOMAIN_GPU GPU Core Domain. @@ -116,7 +116,7 @@ type ZesFreqThrottleTime struct { // / // / @details // / - [DEPRECATED] No longer supported. -type ZesOcMode uintptr +type ZesOcMode uint32 const ( ZES_OC_MODE_OFF ZesOcMode = 0 // ZES_OC_MODE_OFF Overclocking if off - hardware is running using factory default diff --git a/gozel/sysm_memPageOfflineState.go b/gozel/sysm_memPageOfflineState.go index 85c76fa..c017c1b 100644 --- a/gozel/sysm_memPageOfflineState.go +++ b/gozel/sysm_memPageOfflineState.go @@ -21,7 +21,7 @@ import ( const ZES_MEM_PAGE_OFFLINE_STATE_EXP_NAME = "ZES_extension_mem_state" // ZesMemPageOfflineStateExpVersion (zes_mem_page_offline_state_exp_version_t) Memory State Extension Version(s) -type ZesMemPageOfflineStateExpVersion uintptr +type ZesMemPageOfflineStateExpVersion uint32 const ( ZES_MEM_PAGE_OFFLINE_STATE_EXP_VERSION_1_0 ZesMemPageOfflineStateExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZES_MEM_PAGE_OFFLINE_STATE_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/sysm_memory.go b/gozel/sysm_memory.go index bdb5586..2a47976 100644 --- a/gozel/sysm_memory.go +++ b/gozel/sysm_memory.go @@ -20,7 +20,7 @@ import ( ) // ZesMemType (zes_mem_type_t) Memory module types -type ZesMemType uintptr +type ZesMemType uint32 const ( ZES_MEM_TYPE_HBM ZesMemType = 0 // ZES_MEM_TYPE_HBM HBM memory @@ -48,7 +48,7 @@ const ( ) // ZesMemLoc (zes_mem_loc_t) Memory module location -type ZesMemLoc uintptr +type ZesMemLoc uint32 const ( ZES_MEM_LOC_SYSTEM ZesMemLoc = 0 // ZES_MEM_LOC_SYSTEM System memory @@ -58,7 +58,7 @@ const ( ) // ZesMemHealth (zes_mem_health_t) Memory health -type ZesMemHealth uintptr +type ZesMemHealth uint32 const ( ZES_MEM_HEALTH_UNKNOWN ZesMemHealth = 0 // ZES_MEM_HEALTH_UNKNOWN The memory health cannot be determined. diff --git a/gozel/sysm_memoryBwCounterValidBits.go b/gozel/sysm_memoryBwCounterValidBits.go index b806469..126aabe 100644 --- a/gozel/sysm_memoryBwCounterValidBits.go +++ b/gozel/sysm_memoryBwCounterValidBits.go @@ -21,7 +21,7 @@ import ( const ZES_MEMORY_BANDWIDTH_COUNTER_BITS_EXP_PROPERTIES_NAME = "ZES_extension_mem_bandwidth_counter_bits_properties" // ZesMemBandwidthCounterBitsExpVersion (zes_mem_bandwidth_counter_bits_exp_version_t) Memory Bandwidth Counter Valid Bits Extension Version(s) -type ZesMemBandwidthCounterBitsExpVersion uintptr +type ZesMemBandwidthCounterBitsExpVersion uint32 const ( ZES_MEM_BANDWIDTH_COUNTER_BITS_EXP_VERSION_1_0 ZesMemBandwidthCounterBitsExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZES_MEM_BANDWIDTH_COUNTER_BITS_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/sysm_pciLinkSpeedDowngrade.go b/gozel/sysm_pciLinkSpeedDowngrade.go index d1a525e..fc8ad63 100644 --- a/gozel/sysm_pciLinkSpeedDowngrade.go +++ b/gozel/sysm_pciLinkSpeedDowngrade.go @@ -23,7 +23,7 @@ import ( const ZES_PCI_LINK_SPEED_DOWNGRADE_EXT_NAME = "ZES_extension_pci_link_speed_downgrade" // ZesPciLinkSpeedDowngradeExtVersion (zes_pci_link_speed_downgrade_ext_version_t) PCI Link Speed Downgrade Extension Version(s) -type ZesPciLinkSpeedDowngradeExtVersion uintptr +type ZesPciLinkSpeedDowngradeExtVersion uint32 const ( ZES_PCI_LINK_SPEED_DOWNGRADE_EXT_VERSION_1_0 ZesPciLinkSpeedDowngradeExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZES_PCI_LINK_SPEED_DOWNGRADE_EXT_VERSION_1_0 version 1.0 diff --git a/gozel/sysm_power.go b/gozel/sysm_power.go index 6a25f5a..2b15164 100644 --- a/gozel/sysm_power.go +++ b/gozel/sysm_power.go @@ -20,7 +20,7 @@ import ( ) // ZesPowerDomain (zes_power_domain_t) Power Domain -type ZesPowerDomain uintptr +type ZesPowerDomain uint32 const ( ZES_POWER_DOMAIN_UNKNOWN ZesPowerDomain = 0 // ZES_POWER_DOMAIN_UNKNOWN The PUnit power domain level cannot be determined. @@ -34,7 +34,7 @@ const ( ) // ZesPowerLevel (zes_power_level_t) Power Level Type -type ZesPowerLevel uintptr +type ZesPowerLevel uint32 const ( ZES_POWER_LEVEL_UNKNOWN ZesPowerLevel = 0 // ZES_POWER_LEVEL_UNKNOWN The PUnit power monitoring duration cannot be determined. @@ -62,7 +62,7 @@ const ( ) // ZesPowerSource (zes_power_source_t) Power Source Type -type ZesPowerSource uintptr +type ZesPowerSource uint32 const ( ZES_POWER_SOURCE_ANY ZesPowerSource = 0 // ZES_POWER_SOURCE_ANY Limit active no matter whether the power source is mains powered or @@ -76,7 +76,7 @@ const ( ) // ZesLimitUnit (zes_limit_unit_t) Limit Unit -type ZesLimitUnit uintptr +type ZesLimitUnit uint32 const ( ZES_LIMIT_UNIT_UNKNOWN ZesLimitUnit = 0 // ZES_LIMIT_UNIT_UNKNOWN The PUnit power monitoring unit cannot be determined. diff --git a/gozel/sysm_powerDomainProperties.go b/gozel/sysm_powerDomainProperties.go index ca225a0..02f341f 100644 --- a/gozel/sysm_powerDomainProperties.go +++ b/gozel/sysm_powerDomainProperties.go @@ -21,7 +21,7 @@ import ( const ZES_POWER_DOMAIN_PROPERTIES_EXP_NAME = "ZES_extension_power_domain_properties" // ZesPowerDomainPropertiesExpVersion (zes_power_domain_properties_exp_version_t) Power Domain Properties Extension Version(s) -type ZesPowerDomainPropertiesExpVersion uintptr +type ZesPowerDomainPropertiesExpVersion uint32 const ( ZES_POWER_DOMAIN_PROPERTIES_EXP_VERSION_1_0 ZesPowerDomainPropertiesExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZES_POWER_DOMAIN_PROPERTIES_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/sysm_powerLimits.go b/gozel/sysm_powerLimits.go index 99349cb..f0deb12 100644 --- a/gozel/sysm_powerLimits.go +++ b/gozel/sysm_powerLimits.go @@ -23,7 +23,7 @@ import ( const ZES_POWER_LIMITS_EXT_NAME = "ZES_extension_power_limits" // ZesPowerLimitsExtVersion (zes_power_limits_ext_version_t) Power Limits Extension Version(s) -type ZesPowerLimitsExtVersion uintptr +type ZesPowerLimitsExtVersion uint32 const ( ZES_POWER_LIMITS_EXT_VERSION_1_0 ZesPowerLimitsExtVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZES_POWER_LIMITS_EXT_VERSION_1_0 version 1.0 diff --git a/gozel/sysm_psu.go b/gozel/sysm_psu.go index bd9bd1b..ec30cef 100644 --- a/gozel/sysm_psu.go +++ b/gozel/sysm_psu.go @@ -20,7 +20,7 @@ import ( ) // ZesPsuVoltageStatus (zes_psu_voltage_status_t) PSU voltage status -type ZesPsuVoltageStatus uintptr +type ZesPsuVoltageStatus uint32 const ( ZES_PSU_VOLTAGE_STATUS_UNKNOWN ZesPsuVoltageStatus = 0 // ZES_PSU_VOLTAGE_STATUS_UNKNOWN The status of the power supply voltage controllers cannot be diff --git a/gozel/sysm_ras.go b/gozel/sysm_ras.go index bf6b099..fd24c44 100644 --- a/gozel/sysm_ras.go +++ b/gozel/sysm_ras.go @@ -20,7 +20,7 @@ import ( ) // ZesRasErrorType (zes_ras_error_type_t) RAS error type -type ZesRasErrorType uintptr +type ZesRasErrorType uint32 const ( ZES_RAS_ERROR_TYPE_CORRECTABLE ZesRasErrorType = 0 // ZES_RAS_ERROR_TYPE_CORRECTABLE Errors were corrected by hardware @@ -30,7 +30,7 @@ const ( ) // ZesRasErrorCat (zes_ras_error_cat_t) RAS error categories -type ZesRasErrorCat uintptr +type ZesRasErrorCat uint32 const ( ZES_RAS_ERROR_CAT_RESET ZesRasErrorCat = 0 // ZES_RAS_ERROR_CAT_RESET The number of accelerator engine resets attempted by the driver diff --git a/gozel/sysm_rasState.go b/gozel/sysm_rasState.go index 2a7f0bf..299973b 100644 --- a/gozel/sysm_rasState.go +++ b/gozel/sysm_rasState.go @@ -23,7 +23,7 @@ import ( const ZES_RAS_GET_STATE_EXP_NAME = "ZES_extension_ras_state" // ZesRasStateExpVersion (zes_ras_state_exp_version_t) RAS Get State Extension Version(s) -type ZesRasStateExpVersion uintptr +type ZesRasStateExpVersion uint32 const ( ZES_RAS_STATE_EXP_VERSION_1_0 ZesRasStateExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZES_RAS_STATE_EXP_VERSION_1_0 version 1.0 @@ -33,7 +33,7 @@ const ( ) // ZesRasErrorCategoryExp (zes_ras_error_category_exp_t) RAS error categories -type ZesRasErrorCategoryExp uintptr +type ZesRasErrorCategoryExp uint32 const ( ZES_RAS_ERROR_CATEGORY_EXP_RESET ZesRasErrorCategoryExp = 0 // ZES_RAS_ERROR_CATEGORY_EXP_RESET The number of accelerator engine resets attempted by the driver diff --git a/gozel/sysm_scheduler.go b/gozel/sysm_scheduler.go index f7e728e..70c4805 100644 --- a/gozel/sysm_scheduler.go +++ b/gozel/sysm_scheduler.go @@ -20,7 +20,7 @@ import ( ) // ZesSchedMode (zes_sched_mode_t) Scheduler mode -type ZesSchedMode uintptr +type ZesSchedMode uint32 const ( ZES_SCHED_MODE_TIMEOUT ZesSchedMode = 0 // ZES_SCHED_MODE_TIMEOUT Multiple applications or contexts are submitting work to the hardware. diff --git a/gozel/sysm_standby.go b/gozel/sysm_standby.go index 48e6dc8..2962f70 100644 --- a/gozel/sysm_standby.go +++ b/gozel/sysm_standby.go @@ -20,7 +20,7 @@ import ( ) // ZesStandbyType (zes_standby_type_t) Standby hardware components -type ZesStandbyType uintptr +type ZesStandbyType uint32 const ( ZES_STANDBY_TYPE_GLOBAL ZesStandbyType = 0 // ZES_STANDBY_TYPE_GLOBAL Control the overall standby policy of the device/sub-device @@ -39,7 +39,7 @@ type ZesStandbyProperties struct { } // ZesStandbyPromoMode (zes_standby_promo_mode_t) Standby promotion modes -type ZesStandbyPromoMode uintptr +type ZesStandbyPromoMode uint32 const ( ZES_STANDBY_PROMO_MODE_DEFAULT ZesStandbyPromoMode = 0 // ZES_STANDBY_PROMO_MODE_DEFAULT Best compromise between performance and energy savings. diff --git a/gozel/sysm_sysmanDeviceMapping.go b/gozel/sysm_sysmanDeviceMapping.go index 550636c..3e24f60 100644 --- a/gozel/sysm_sysmanDeviceMapping.go +++ b/gozel/sysm_sysmanDeviceMapping.go @@ -23,7 +23,7 @@ import ( const ZES_SYSMAN_DEVICE_MAPPING_EXP_NAME = "ZES_experimental_sysman_device_mapping" // ZesSysmanDeviceMappingExpVersion (zes_sysman_device_mapping_exp_version_t) Sysman Device Mapping Extension Version(s) -type ZesSysmanDeviceMappingExpVersion uintptr +type ZesSysmanDeviceMappingExpVersion uint32 const ( ZES_SYSMAN_DEVICE_MAPPING_EXP_VERSION_1_0 ZesSysmanDeviceMappingExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZES_SYSMAN_DEVICE_MAPPING_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/sysm_temperature.go b/gozel/sysm_temperature.go index 2bb69fc..1663378 100644 --- a/gozel/sysm_temperature.go +++ b/gozel/sysm_temperature.go @@ -20,7 +20,7 @@ import ( ) // ZesTempSensors (zes_temp_sensors_t) Temperature sensors -type ZesTempSensors uintptr +type ZesTempSensors uint32 const ( ZES_TEMP_SENSORS_GLOBAL ZesTempSensors = 0 // ZES_TEMP_SENSORS_GLOBAL The maximum temperature across all device sensors diff --git a/gozel/sysm_virtualFunctionManagement.go b/gozel/sysm_virtualFunctionManagement.go index 12f2d6c..a44e920 100644 --- a/gozel/sysm_virtualFunctionManagement.go +++ b/gozel/sysm_virtualFunctionManagement.go @@ -23,7 +23,7 @@ import ( const ZES_VIRTUAL_FUNCTION_MANAGEMENT_EXP_NAME = "ZES_experimental_virtual_function_management" // ZesVfManagementExpVersion (zes_vf_management_exp_version_t) Virtual Function Management Extension Version(s) -type ZesVfManagementExpVersion uintptr +type ZesVfManagementExpVersion uint32 const ( ZES_VF_MANAGEMENT_EXP_VERSION_1_0 ZesVfManagementExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZES_VF_MANAGEMENT_EXP_VERSION_1_0 version 1.0 (deprecated) diff --git a/gozel/tols_GlobalTimestamps.go b/gozel/tols_GlobalTimestamps.go index fe4ad0a..24d391b 100644 --- a/gozel/tols_GlobalTimestamps.go +++ b/gozel/tols_GlobalTimestamps.go @@ -23,7 +23,7 @@ import ( const ZET_GLOBAL_METRICS_TIMESTAMPS_EXP_NAME = "ZET_experimental_global_metric_timestamps" // ZeMetricGlobalTimestampsExpVersion (ze_metric_global_timestamps_exp_version_t) Global Metric Timestamps Experimental Extension Version(s) -type ZeMetricGlobalTimestampsExpVersion uintptr +type ZeMetricGlobalTimestampsExpVersion uint32 const ( ZE_METRIC_GLOBAL_TIMESTAMPS_EXP_VERSION_1_0 ZeMetricGlobalTimestampsExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_METRIC_GLOBAL_TIMESTAMPS_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/tols_common.go b/gozel/tols_common.go index 09ccdde..870d95d 100644 --- a/gozel/tols_common.go +++ b/gozel/tols_common.go @@ -57,7 +57,7 @@ type ZetTracerExpHandle uintptr type ZetDebugSessionHandle uintptr // ZetStructureType (zet_structure_type_t) Defines structure types -type ZetStructureType uintptr +type ZetStructureType uint32 const ( ZET_STRUCTURE_TYPE_METRIC_GROUP_PROPERTIES ZetStructureType = 0x1 // ZET_STRUCTURE_TYPE_METRIC_GROUP_PROPERTIES ::zet_metric_group_properties_t @@ -105,7 +105,7 @@ type ZetBaseDesc struct { } // ZetValueType (zet_value_type_t) Supported value types -type ZetValueType uintptr +type ZetValueType uint32 const ( ZET_VALUE_TYPE_UINT32 ZetValueType = 0 // ZET_VALUE_TYPE_UINT32 32-bit unsigned-integer diff --git a/gozel/tols_concurrentMetricGroup.go b/gozel/tols_concurrentMetricGroup.go index 0e252fd..55e2c11 100644 --- a/gozel/tols_concurrentMetricGroup.go +++ b/gozel/tols_concurrentMetricGroup.go @@ -23,7 +23,7 @@ import ( const ZET_CONCURRENT_METRIC_GROUPS_EXP_NAME = "ZET_experimental_concurrent_metric_groups" // ZetConcurrentMetricGroupsExpVersion (zet_concurrent_metric_groups_exp_version_t) Concurrent Metric Groups Experimental Extension Version(s) -type ZetConcurrentMetricGroupsExpVersion uintptr +type ZetConcurrentMetricGroupsExpVersion uint32 const ( ZET_CONCURRENT_METRIC_GROUPS_EXP_VERSION_1_0 ZetConcurrentMetricGroupsExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZET_CONCURRENT_METRIC_GROUPS_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/tols_debug.go b/gozel/tols_debug.go index 5ac6ff6..738c918 100644 --- a/gozel/tols_debug.go +++ b/gozel/tols_debug.go @@ -142,7 +142,7 @@ const ( ) // ZetDebugEventType (zet_debug_event_type_t) Supported debug event types. -type ZetDebugEventType uintptr +type ZetDebugEventType uint32 const ( ZET_DEBUG_EVENT_TYPE_INVALID ZetDebugEventType = 0 // ZET_DEBUG_EVENT_TYPE_INVALID The event is invalid @@ -159,7 +159,7 @@ const ( ) // ZetDebugDetachReason (zet_debug_detach_reason_t) Supported debug detach reasons. -type ZetDebugDetachReason uintptr +type ZetDebugDetachReason uint32 const ( ZET_DEBUG_DETACH_REASON_INVALID ZetDebugDetachReason = 0 // ZET_DEBUG_DETACH_REASON_INVALID The detach reason is not valid @@ -192,7 +192,7 @@ type ZetDebugEventInfoThreadStopped struct { } // ZetDebugPageFaultReason (zet_debug_page_fault_reason_t) Page fault reasons. -type ZetDebugPageFaultReason uintptr +type ZetDebugPageFaultReason uint32 const ( ZET_DEBUG_PAGE_FAULT_REASON_INVALID ZetDebugPageFaultReason = 0 // ZET_DEBUG_PAGE_FAULT_REASON_INVALID The page fault reason is not valid @@ -331,7 +331,7 @@ func ZetDebugResume( } // ZetDebugMemorySpaceType (zet_debug_memory_space_type_t) Supported device memory space types. -type ZetDebugMemorySpaceType uintptr +type ZetDebugMemorySpaceType uint32 const ( ZET_DEBUG_MEMORY_SPACE_TYPE_DEFAULT ZetDebugMemorySpaceType = 0 // ZET_DEBUG_MEMORY_SPACE_TYPE_DEFAULT default memory space (attribute may be omitted) diff --git a/gozel/tols_metric.go b/gozel/tols_metric.go index fcb2064..4bf0aa6 100644 --- a/gozel/tols_metric.go +++ b/gozel/tols_metric.go @@ -110,7 +110,7 @@ func ZetMetricGroupGetProperties( } // ZetMetricType (zet_metric_type_t) Metric types -type ZetMetricType uintptr +type ZetMetricType uint32 const ( ZET_METRIC_TYPE_DURATION ZetMetricType = 0 // ZET_METRIC_TYPE_DURATION Metric type: duration @@ -142,7 +142,7 @@ const ( ) // ZetMetricGroupCalculationType (zet_metric_group_calculation_type_t) Metric group calculation type -type ZetMetricGroupCalculationType uintptr +type ZetMetricGroupCalculationType uint32 const ( ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES ZetMetricGroupCalculationType = 0 // ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES Calculated metric values from raw data. @@ -473,7 +473,7 @@ func ZetMetricStreamerReadData( } // ZetMetricQueryPoolType (zet_metric_query_pool_type_t) Metric query pool types -type ZetMetricQueryPoolType uintptr +type ZetMetricQueryPoolType uint32 const ( ZET_METRIC_QUERY_POOL_TYPE_PERFORMANCE ZetMetricQueryPoolType = 0 // ZET_METRIC_QUERY_POOL_TYPE_PERFORMANCE Performance metric query pool. diff --git a/gozel/tols_metricExportData.go b/gozel/tols_metricExportData.go index 35e583a..ce33ee9 100644 --- a/gozel/tols_metricExportData.go +++ b/gozel/tols_metricExportData.go @@ -23,7 +23,7 @@ import ( const ZET_EXPORT_METRICS_DATA_EXP_NAME = "ZET_experimental_metric_export_data" // ZetExportMetricDataExpVersion (zet_export_metric_data_exp_version_t) Exporting Metrics Data Experimental Extension Version(s) -type ZetExportMetricDataExpVersion uintptr +type ZetExportMetricDataExpVersion uint32 const ( ZET_EXPORT_METRIC_DATA_EXP_VERSION_1_0 ZetExportMetricDataExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZET_EXPORT_METRIC_DATA_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/tols_metricGroupMarker.go b/gozel/tols_metricGroupMarker.go index c658459..451c640 100644 --- a/gozel/tols_metricGroupMarker.go +++ b/gozel/tols_metricGroupMarker.go @@ -23,7 +23,7 @@ import ( const ZET_METRIC_GROUP_MARKER_EXP_NAME = "ZET_experimental_metric_group_marker" // ZetMetricGroupMarkerExpVersion (zet_metric_group_marker_exp_version_t) Marker Support Using MetricGroup Experimental Extension Version(s) -type ZetMetricGroupMarkerExpVersion uintptr +type ZetMetricGroupMarkerExpVersion uint32 const ( ZET_METRIC_GROUP_MARKER_EXP_VERSION_1_0 ZetMetricGroupMarkerExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZET_METRIC_GROUP_MARKER_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/tols_metricProgrammable.go b/gozel/tols_metricProgrammable.go index 2e7fd23..9a733b8 100644 --- a/gozel/tols_metricProgrammable.go +++ b/gozel/tols_metricProgrammable.go @@ -23,7 +23,7 @@ import ( const ZET_PROGRAMMABLE_METRICS_EXP_NAME = "ZET_experimental_programmable_metrics" // ZetMetricProgrammableExpVersion (zet_metric_programmable_exp_version_t) Programmable Metrics Experimental Extension Version(s) -type ZetMetricProgrammableExpVersion uintptr +type ZetMetricProgrammableExpVersion uint32 const ( ZET_METRIC_PROGRAMMABLE_EXP_VERSION_1_1 ZetMetricProgrammableExpVersion = /* ZE_MAKE_VERSION( 1, 1 ) */ ((1 << 16) | (1 & 0x0000ffff)) // ZET_METRIC_PROGRAMMABLE_EXP_VERSION_1_1 version 1.1 @@ -79,7 +79,7 @@ type ZetMetricProgrammableExpProperties struct { } // ZetMetricProgrammableParamTypeExp (zet_metric_programmable_param_type_exp_t) Metric Programmable Parameter types -type ZetMetricProgrammableParamTypeExp uintptr +type ZetMetricProgrammableParamTypeExp uint32 const ( ZET_METRIC_PROGRAMMABLE_PARAM_TYPE_EXP_DISAGGREGATION ZetMetricProgrammableParamTypeExp = 0 // ZET_METRIC_PROGRAMMABLE_PARAM_TYPE_EXP_DISAGGREGATION Metric is disaggregated. @@ -97,7 +97,7 @@ const ( ) // ZetValueInfoTypeExp (zet_value_info_type_exp_t) Supported value info types -type ZetValueInfoTypeExp uintptr +type ZetValueInfoTypeExp uint32 const ( ZET_VALUE_INFO_TYPE_EXP_UINT32 ZetValueInfoTypeExp = 0 // ZET_VALUE_INFO_TYPE_EXP_UINT32 32-bit unsigned-integer diff --git a/gozel/tols_metricRuntimeEnableDisable.go b/gozel/tols_metricRuntimeEnableDisable.go index c5f28de..e807100 100644 --- a/gozel/tols_metricRuntimeEnableDisable.go +++ b/gozel/tols_metricRuntimeEnableDisable.go @@ -21,7 +21,7 @@ import ( const ZET_METRICS_RUNTIME_ENABLE_DISABLE_EXP_NAME = "ZET_experimental_metrics_runtime_enable_disable" // ZetMetricsRuntimeEnableDisableExpVersion (zet_metrics_runtime_enable_disable_exp_version_t) Runtime Enabling and Disabling Metrics Extension Version(s) -type ZetMetricsRuntimeEnableDisableExpVersion uintptr +type ZetMetricsRuntimeEnableDisableExpVersion uint32 const ( ZET_METRICS_RUNTIME_ENABLE_DISABLE_EXP_VERSION_1_0 ZetMetricsRuntimeEnableDisableExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZET_METRICS_RUNTIME_ENABLE_DISABLE_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/tols_metricTracer.go b/gozel/tols_metricTracer.go index f9c2d1e..6ad8b4c 100644 --- a/gozel/tols_metricTracer.go +++ b/gozel/tols_metricTracer.go @@ -23,7 +23,7 @@ import ( const ZET_METRICS_TRACER_EXP_NAME = "ZET_experimental_metric_tracer" // ZetMetricTracerExpVersion (zet_metric_tracer_exp_version_t) Metric Tracer Experimental Extension Version(s) -type ZetMetricTracerExpVersion uintptr +type ZetMetricTracerExpVersion uint32 const ( ZET_METRIC_TRACER_EXP_VERSION_1_0 ZetMetricTracerExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZET_METRIC_TRACER_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/tols_module.go b/gozel/tols_module.go index a6c1747..fbe48c1 100644 --- a/gozel/tols_module.go +++ b/gozel/tols_module.go @@ -20,7 +20,7 @@ import ( ) // ZetModuleDebugInfoFormat (zet_module_debug_info_format_t) Supported module debug info formats. -type ZetModuleDebugInfoFormat uintptr +type ZetModuleDebugInfoFormat uint32 const ( ZET_MODULE_DEBUG_INFO_FORMAT_ELF_DWARF ZetModuleDebugInfoFormat = 0 // ZET_MODULE_DEBUG_INFO_FORMAT_ELF_DWARF Format is ELF/DWARF diff --git a/gozel/tols_multiMetricValues.go b/gozel/tols_multiMetricValues.go index 26e6c4d..752e653 100644 --- a/gozel/tols_multiMetricValues.go +++ b/gozel/tols_multiMetricValues.go @@ -23,7 +23,7 @@ import ( const ZET_MULTI_METRICS_EXP_NAME = "ZET_experimental_calculate_multiple_metrics" // ZeCalculateMultipleMetricsExpVersion (ze_calculate_multiple_metrics_exp_version_t) Calculating Multiple Metrics Experimental Extension Version(s) -type ZeCalculateMultipleMetricsExpVersion uintptr +type ZeCalculateMultipleMetricsExpVersion uint32 const ( ZE_CALCULATE_MULTIPLE_METRICS_EXP_VERSION_1_0 ZeCalculateMultipleMetricsExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZE_CALCULATE_MULTIPLE_METRICS_EXP_VERSION_1_0 version 1.0 diff --git a/gozel/tols_pin.go b/gozel/tols_pin.go index 585d480..1e36276 100644 --- a/gozel/tols_pin.go +++ b/gozel/tols_pin.go @@ -42,7 +42,7 @@ type ZetProfileProperties struct { } // ZetProfileTokenType (zet_profile_token_type_t) Supported profile token types -type ZetProfileTokenType uintptr +type ZetProfileTokenType uint32 const ( ZET_PROFILE_TOKEN_TYPE_FREE_REGISTER ZetProfileTokenType = 0 // ZET_PROFILE_TOKEN_TYPE_FREE_REGISTER GRF info diff --git a/gozel/tols_tracing.go b/gozel/tols_tracing.go index 2cd7b90..c355294 100644 --- a/gozel/tols_tracing.go +++ b/gozel/tols_tracing.go @@ -23,7 +23,7 @@ import ( const ZET_API_TRACING_EXP_NAME = "ZET_experimental_api_tracing" // ZetApiTracingExpVersion (zet_api_tracing_exp_version_t) API Tracing Experimental Extension Version(s) -type ZetApiTracingExpVersion uintptr +type ZetApiTracingExpVersion uint32 const ( ZET_API_TRACING_EXP_VERSION_1_0 ZetApiTracingExpVersion = /* ZE_MAKE_VERSION( 1, 0 ) */ ((1 << 16) | (0 & 0x0000ffff)) // ZET_API_TRACING_EXP_VERSION_1_0 version 1.0 diff --git a/ze/command.go b/ze/command.go index a916e29..b016dee 100644 --- a/ze/command.go +++ b/ze/command.go @@ -148,3 +148,31 @@ func (h CommandListHandle) HostSynchronize(timeout uint64) error { _, err := gozel.ZeCommandListHostSynchronize(gozel.ZeCommandListHandle(h), timeout) return err } + +// AppendImageCopyFromMemory Copies to an image from device or shared memory. +func (h CommandListHandle) AppendImageCopyFromMemory( + hDstImage ImageHandle, srcptr unsafe.Pointer, pDstRegion *gozel.ZeImageRegion, + hSignalEvent EventHandle, waitEvents ...EventHandle, +) error { + _, err := gozel.ZeCommandListAppendImageCopyFromMemory( + gozel.ZeCommandListHandle(h), gozel.ZeImageHandle(hDstImage), srcptr, pDstRegion, + gozel.ZeEventHandle(hSignalEvent), uint32(len(waitEvents)), + (*gozel.ZeEventHandle)(unsafe.SliceData(waitEvents)), + ) + runtime.KeepAlive(waitEvents) + return err +} + +// AppendImageCopyToMemory Copies from an image to device or shared memory. +func (h CommandListHandle) AppendImageCopyToMemory( + dstptr unsafe.Pointer, hSrcImage ImageHandle, pSrcRegion *gozel.ZeImageRegion, + hSignalEvent EventHandle, waitEvents ...EventHandle, +) error { + _, err := gozel.ZeCommandListAppendImageCopyToMemory( + gozel.ZeCommandListHandle(h), dstptr, gozel.ZeImageHandle(hSrcImage), pSrcRegion, + gozel.ZeEventHandle(hSignalEvent), uint32(len(waitEvents)), + (*gozel.ZeEventHandle)(unsafe.SliceData(waitEvents)), + ) + runtime.KeepAlive(waitEvents) + return err +} diff --git a/ze/image.go b/ze/image.go new file mode 100644 index 0000000..3b8a625 --- /dev/null +++ b/ze/image.go @@ -0,0 +1,30 @@ +package ze + +import "github.com/fumiama/gozel/gozel" + +// ImageHandle (ze_image_handle_t) Handle of driver's image object. +type ImageHandle gozel.ZeImageHandle + +// ImageCreate Creates a 2D image on the context. +// flags: 0 for read-only (kernel input), ZE_IMAGE_FLAG_KERNEL_WRITE for writable (kernel output). +func (h ContextHandle) ImageCreate( + hDevice DeviceHandle, flags gozel.ZeImageFlags, format gozel.ZeImageFormat, + width uint64, height uint32, +) (ih ImageHandle, err error) { + _, err = gozel.ZeImageCreate(gozel.ZeContextHandle(h), gozel.ZeDeviceHandle(hDevice), + &gozel.ZeImageDesc{ + Stype: gozel.ZE_STRUCTURE_TYPE_IMAGE_DESC, + Flags: flags, + Type: gozel.ZE_IMAGE_TYPE_2D, + Format: format, + Width: width, + Height: height, + }, (*gozel.ZeImageHandle)(&ih)) + return +} + +// Destroy Deletes an image object. +func (h ImageHandle) Destroy() error { + _, err := gozel.ZeImageDestroy(gozel.ZeImageHandle(h)) + return err +} diff --git a/ze/kernel.go b/ze/kernel.go index 331bb97..0fa1e41 100644 --- a/ze/kernel.go +++ b/ze/kernel.go @@ -36,6 +36,12 @@ func (h KernelHandle) SetArgumentValue(argIndex uint32, arg any) error { return err } +// SuggestGroupSize queries a suggested group size for the kernel given a global size for each dimension. +func (h KernelHandle) SuggestGroupSize(globalSizeX, globalSizeY, globalSizeZ uint32) (groupSizeX, groupSizeY, groupSizeZ uint32, err error) { + _, err = gozel.ZeKernelSuggestGroupSize(gozel.ZeKernelHandle(h), globalSizeX, globalSizeY, globalSizeZ, &groupSizeX, &groupSizeY, &groupSizeZ) + return +} + // SetGroupSize sets the thread group size for the kernel. func (h KernelHandle) SetGroupSize(groupSizeX uint32, groupSizeY uint32, groupSizeZ uint32) error { _, err := gozel.ZeKernelSetGroupSize(gozel.ZeKernelHandle(h), groupSizeX, groupSizeY, groupSizeZ) diff --git a/ze/sampler.go b/ze/sampler.go new file mode 100644 index 0000000..a228ad4 --- /dev/null +++ b/ze/sampler.go @@ -0,0 +1,26 @@ +package ze + +import "github.com/fumiama/gozel/gozel" + +// SamplerHandle (ze_sampler_handle_t) Handle of driver's sampler object +type SamplerHandle gozel.ZeSamplerHandle + +// SamplerCreate Creates sampler on the context. +func (h ContextHandle) SamplerCreate( + hDevice DeviceHandle, addressmode gozel.ZeSamplerAddressMode, + filtermode gozel.ZeSamplerFilterMode, isnormalized gozel.ZeBool, +) (sh SamplerHandle, err error) { + _, err = gozel.ZeSamplerCreate(gozel.ZeContextHandle(h), gozel.ZeDeviceHandle(hDevice), &gozel.ZeSamplerDesc{ + Stype: gozel.ZE_STRUCTURE_TYPE_SAMPLER_DESC, + Addressmode: addressmode, + Filtermode: filtermode, + Isnormalized: isnormalized, + }, (*gozel.ZeSamplerHandle)(&sh)) + return +} + +// Destroy Destroys sampler object. +func (h SamplerHandle) Destroy() error { + _, err := gozel.ZeSamplerDestroy(gozel.ZeSamplerHandle(h)) + return err +}