backend

package
v0.0.0-...-1dd1f65 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNil occurs when the backend we try to resolve is nil.
	ErrNil = errors.New("backend nil")
	// ErrUnknownStyle occurs when we ask the resolver for a backend style of which it isn't aware.
	ErrUnknownStyle = errors.New("unknown backend style")

	// Resolve is a pre-populated backend resolver.
	Resolve = Resolver{Backends: map[id.ID]backend2.Class{
		id.FromString("delitmus"): delitmus.Delitmus{},
		id.FromString("herdtools.herd"): herdstyle.Class{
			OptCapabilities: 0,
			Arches:          herdArches,
			Impl:            herd.Herd{},
			ExtClass: service.ExtClass{
				DefaultRunInfo: service.RunInfo{Cmd: "herd7"},
				AltCommands:    []string{"herd"},
			},
		},
		id.FromString("herdtools.litmus"): herdstyle.Class{
			OptCapabilities: backend2.CanProduceExe,
			Arches:          litmusArches,
			Impl:            litmus.Litmus{},
			ExtClass: service.ExtClass{
				DefaultRunInfo: service.RunInfo{Cmd: "litmus7"},
				AltCommands:    []string{"litmus"},
			},
		},
		id.FromString("rmem"): herdstyle.Class{
			OptCapabilities: backend2.CanLiftLitmus,
			Arches:          rmemArches,
			Impl:            rmem.Rmem{},
			ExtClass: service.ExtClass{
				DefaultRunInfo: service.RunInfo{Cmd: "rmem"},
			},
		},
	}}
)

Functions

This section is empty.

Types

type Resolver

type Resolver struct {
	// Backends is the raw map from style strings to backend constructors.
	Backends map[id.ID]backend2.Class
}

Resolver maps backend styles to classes, and implements a resolver accordingly.

func (*Resolver) Probe

func (r *Resolver) Probe(ctx context.Context, sr service.Runner) ([]backend2.NamedSpec, error)

Probe probes every class in this resolver, and aggregates the specifications.

func (*Resolver) Resolve

func (r *Resolver) Resolve(cid id.ID) (backend2.Class, error)

Resolve tries to look up the backend specified by b in this resolver.

Directories

Path Synopsis
Package delitmus lifts the c4f delitmusifier into a backend.
Package delitmus lifts the c4f delitmusifier into a backend.
Package herdstyle contains backends that c4f in a similar way to the Herd memory simulator.
Package herdstyle contains backends that c4f in a similar way to the Herd memory simulator.
herd
Package herd contains the parts of a Herdtools backend specific to herd7.
Package herd contains the parts of a Herdtools backend specific to herd7.
litmus
Package litmus contains the parts of a Herdtools backend specific to litmus7.
Package litmus contains the parts of a Herdtools backend specific to litmus7.
parser
Package parser contains logic for parsing Herd-style observations.
Package parser contains logic for parsing Herd-style observations.
rmem
Package rmem implements rudimentary backend support for RMEM.
Package rmem implements rudimentary backend support for RMEM.

Jump to

Keyboard shortcuts

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