client

package
v0.0.0-...-ced3753 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PlatformServerAddressInfo is the PlatformInfoName that shall hold the server address of the simulator.
	// This is a forward from the grpc interface, so that the user of this package doesn't additionally have to
	// import the grpc package, just for this constant.
	PlatformServerAddressInfo = sim.PlatformServerAddressInfo
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents the simulator client, to be used in tests.

func NewClient

func NewClient(address string) (*Client, error)

NewClient attempts to connect to the given address. Retrieve the value of the address by querying the OpenCL platform for the PlatformServerAddressInfo string.

func (*Client) Devices

func (client *Client) Devices() *Devices

Devices is the accessor for device-specific interaction.

func (*Client) Disconnect

func (client *Client) Disconnect()

Disconnect shuts down the connection.

func (*Client) Platform

func (client *Client) Platform() *Platform

Platform is the accessor for platform-specific interaction.

type Devices

type Devices struct {
	// contains filtered or unexported fields
}

Devices represents interactions on the devices layer.

func (*Devices) Create

func (devices *Devices) Create(ctx context.Context) (uintptr, error)

Create requests to create a new device. The returned value is the ID value of the created device. Use this function for any new test that you intend to run in parallel to others.

func (*Devices) Delete

func (devices *Devices) Delete(ctx context.Context, id uintptr) error

Delete requests to remove a previously created device. Call this function at the end of the test, to ensure resources are removed.

type Platform

type Platform struct {
	// contains filtered or unexported fields
}

Platform represents interactions on the platform layer.

func (*Platform) PrepareExtensionFunction

func (platform *Platform) PrepareExtensionFunction(ctx context.Context) (string, uintptr, error)

PrepareExtensionFunction requests to prepare an extension function for testing. The returned value is the address value of the function pointer. Note that the simulator has a limited amount of functions to return.

func (*Platform) ReleaseExtensionFunction

func (platform *Platform) ReleaseExtensionFunction(ctx context.Context, name string) error

ReleaseExtensionFunction requests to release a previously prepared extension function. Call this function at the end of the test, to ensure resources are removed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL