1
0
mirror of https://github.com/fumiama/gozel.git synced 2026-06-05 08:20:24 +08:00
Files
gozel/ze/context.go
2026-03-25 00:25:24 +08:00

22 lines
639 B
Go

package ze
import "github.com/fumiama/gozel"
// ContextHandle is a handle to a Level Zero context.
type ContextHandle gozel.ZeContextHandle
// ContextCreate creates a new context for the driver.
func (h DriverHandle) ContextCreate() (ContextHandle, error) {
var ctx gozel.ZeContextHandle
_, err := gozel.ZeContextCreate(gozel.ZeDriverHandle(h), &gozel.ZeContextDesc{
Stype: gozel.ZE_STRUCTURE_TYPE_CONTEXT_DESC,
}, &ctx)
return ContextHandle(ctx), err
}
// Destroy destroys the context and releases its resources.
func (h ContextHandle) Destroy() error {
_, err := gozel.ZeContextDestroy(gozel.ZeContextHandle(h))
return err
}