The petalisp Reference Manual

This is the petalisp Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon May 15 06:08:24 2023 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 petalisp

Elegant High Performance Computing

Author

Marco Heisig <>

License

AGPLv3

Dependencies
Source

petalisp.asd.


2.2 petalisp.api

A Convenient API for Petalisp.

Author

Marco Heisig <>

License

AGPLv3

Dependencies
Source

petalisp.api.asd.

Child Components

2.3 petalisp.utilities

Author

Marco Heisig <>

License

AGPLv3

Dependencies
  • alexandria (system).
  • atomics (system).
  • bordeaux-threads (system).
  • queues.priority-queue (system).
  • trivia (system).
  • trivial-garbage (system).
Source

petalisp.utilities.asd.

Child Components

2.4 petalisp.core

Author

Marco Heisig <>

License

AGPLv3

Dependencies
  • alexandria (system).
  • bordeaux-threads (system).
  • lparallel (system).
  • trivia (system).
  • petalisp.utilities (system).
  • typo (system).
Source

petalisp.core.asd.

Child Components

2.5 petalisp.xmas-backend

Author

Marco Heisig <>

License

AGPLv3

Dependencies
  • alexandria (system).
  • atomics (system).
  • bordeaux-threads (system).
  • lparallel (system).
  • trivia (system).
  • trivial-garbage (system).
  • petalisp.utilities (system).
  • petalisp.core (system).
  • petalisp.ir (system).
  • typo (system).
Source

petalisp.xmas-backend.asd.

Child Components

2.6 petalisp.ir

Author

Marco Heisig <>

License

AGPLv3

Dependencies
Source

petalisp.ir.asd.

Child Components

2.7 petalisp.test-suite

A comprehensive test suite for Petalisp.

Author

Marco Heisig <>

License

AGPLv3

Dependencies
  • asdf (system).
  • bordeaux-threads (system).
  • closer-mop (system).
  • petalisp.examples (system).
  • petalisp.xmas-backend (system).
Source

petalisp.test-suite.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 petalisp/petalisp.asd

Source

petalisp.asd.

Parent Component

petalisp (system).

ASDF Systems

petalisp.


3.1.2 petalisp.api/petalisp.api.asd

Source

petalisp.api.asd.

Parent Component

petalisp.api (system).

ASDF Systems

petalisp.api.


3.1.3 petalisp.utilities/petalisp.utilities.asd

Source

petalisp.utilities.asd.

Parent Component

petalisp.utilities (system).

ASDF Systems

petalisp.utilities.


3.1.4 petalisp.core/petalisp.core.asd

Source

petalisp.core.asd.

Parent Component

petalisp.core (system).

ASDF Systems

petalisp.core.


3.1.5 petalisp.xmas-backend/petalisp.xmas-backend.asd

Source

petalisp.xmas-backend.asd.

Parent Component

petalisp.xmas-backend (system).

ASDF Systems

petalisp.xmas-backend.


3.1.6 petalisp.ir/petalisp.ir.asd

Source

petalisp.ir.asd.

Parent Component

petalisp.ir (system).

ASDF Systems

petalisp.ir.


3.1.7 petalisp.test-suite/petalisp.test-suite.asd

Source

petalisp.test-suite.asd.

Parent Component

petalisp.test-suite (system).

ASDF Systems

petalisp.test-suite.


3.1.8 petalisp.api/differentiator.lisp

Dependencies
Source

petalisp.api.asd.

Parent Component

petalisp.api (system).

Public Interface
Internals

3.1.9 petalisp.api/lazy-allreduce.lisp

Dependency

lazy-reduce.lisp (file).

Source

petalisp.api.asd.

Parent Component

petalisp.api (system).

Public Interface

lazy-allreduce (function).


3.1.10 petalisp.api/lazy-array-indices.lisp

Dependency

lazy-shape-indices.lisp (file).

Source

petalisp.api.asd.

Parent Component

petalisp.api (system).

Public Interface

lazy-array-indices (function).


3.1.11 petalisp.api/lazy-array-interior.lisp

Dependency

shape-interior.lisp (file).

Source

petalisp.api.asd.

Parent Component

petalisp.api (system).

Public Interface

lazy-array-interior (function).


3.1.12 petalisp.api/lazy-broadcast.lisp

Dependency

lazy-reshape.lisp (file).

Source

petalisp.api.asd.

Parent Component

petalisp.api (system).

Public Interface
Internals

3.1.13 petalisp.api/lazy-drop-axes.lisp

Dependency

lazy-reshape.lisp (file).

Source

petalisp.api.asd.

Parent Component

petalisp.api (system).

Public Interface

lazy-drop-axes (function).


3.1.14 petalisp.api/lazy-flatten.lisp

Dependency

lazy-reshape.lisp (file).

Source

petalisp.api.asd.

Parent Component

petalisp.api (system).

Public Interface

lazy-flatten (function).


3.1.15 petalisp.api/lazy.lisp

Dependency

lazy-broadcast.lisp (file).

Source

petalisp.api.asd.

Parent Component

petalisp.api (system).

Public Interface

lazy (function).


3.1.16 petalisp.api/lazy-multiple-value.lisp

Dependency

lazy-broadcast.lisp (file).

Source

petalisp.api.asd.

Parent Component

petalisp.api (system).

Public Interface

lazy-multiple-value (function).


3.1.17 petalisp.api/lazy-overwrite.lisp

Dependency

packages.lisp (file).

Source

petalisp.api.asd.

Parent Component

petalisp.api (system).

Public Interface

lazy-overwrite (function).


3.1.18 petalisp.api/lazy-reduce.lisp

Dependencies
Source

petalisp.api.asd.

Parent Component

petalisp.api (system).

Public Interface

lazy-reduce (function).

Internals

lazy-reduce-aux (function).


3.1.19 petalisp.api/lazy-reshape.lisp

Dependency

shape-syntax.lisp (file).

Source

petalisp.api.asd.

Parent Component

petalisp.api (system).

Public Interface

lazy-reshape (function).

Internals

3.1.20 petalisp.api/lazy-shape-indices.lisp

Dependency

packages.lisp (file).

Source

petalisp.api.asd.

Parent Component

petalisp.api (system).

Public Interface

lazy-shape-indices (function).


3.1.21 petalisp.api/lazy-slice.lisp

Dependency

packages.lisp (file).

Source

petalisp.api.asd.

Parent Component

petalisp.api (system).

Public Interface

lazy-slice (function).


3.1.22 petalisp.api/lazy-slices.lisp

Dependency

packages.lisp (file).

Source

petalisp.api.asd.

Parent Component

petalisp.api (system).

Public Interface

lazy-slices (function).


3.1.23 petalisp.api/lazy-stack.lisp

Dependencies
Source

petalisp.api.asd.

Parent Component

petalisp.api (system).

Public Interface

lazy-stack (function).


3.1.24 petalisp.api/network.lisp

Dependencies
Source

petalisp.api.asd.

Parent Component

petalisp.api (system).

Public Interface
Internals

network-evaluator (reader method).


3.1.25 petalisp.api/packages.lisp

Source

petalisp.api.asd.

Parent Component

petalisp.api (system).

Packages
Public Interface

*backend* (special variable).


3.1.26 petalisp.api/shape-interior.lisp

Dependency

packages.lisp (file).

Source

petalisp.api.asd.

Parent Component

petalisp.api (system).

Public Interface

shape-interior (function).


3.1.27 petalisp.api/shape-syntax.lisp

Dependency

packages.lisp (file).

Source

petalisp.api.asd.

Parent Component

petalisp.api (system).

Public Interface
Internals

3.1.28 petalisp.api/transform.lisp

Dependency

packages.lisp (file).

Source

petalisp.api.asd.

Parent Component

petalisp.api (system).

Public Interface
Internals

3.1.29 petalisp.api/vectorize.lisp

Dependency

lazy-multiple-value.lisp (file).

Source

petalisp.api.asd.

Parent Component

petalisp.api (system).

Public Interface

vectorize (function).


3.1.31 petalisp.utilities/packages.lisp

Source

petalisp.utilities.asd.

Parent Component

petalisp.utilities (system).

Packages

petalisp.utilities.


3.1.32 petalisp.utilities/documentation.lisp

Dependency

packages.lisp (file).

Source

petalisp.utilities.asd.

Parent Component

petalisp.utilities (system).

Public Interface
Internals

3.1.33 petalisp.utilities/defalias.lisp

Dependency

documentation.lisp (file).

Source

petalisp.utilities.asd.

Parent Component

petalisp.utilities (system).

Public Interface

defalias (macro).

Internals

ensure-alias (function).


3.1.34 petalisp.utilities/queue.lisp

Dependency

defalias.lisp (file).

Source

petalisp.utilities.asd.

Parent Component

petalisp.utilities (system).

Public Interface
Internals

3.1.35 petalisp.utilities/circular-array.lisp

Dependency

queue.lisp (file).

Source

petalisp.utilities.asd.

Parent Component

petalisp.utilities (system).

Internals

3.1.36 petalisp.utilities/wsdeque.lisp

Dependency

circular-array.lisp (file).

Source

petalisp.utilities.asd.

Parent Component

petalisp.utilities (system).

Public Interface
Internals

3.1.37 petalisp.utilities/bitfield.lisp

Dependency

wsdeque.lisp (file).

Source

petalisp.utilities.asd.

Parent Component

petalisp.utilities (system).

Public Interface

define-bitfield (macro).

Internals

3.1.38 petalisp.utilities/identical.lisp

Dependency

bitfield.lisp (file).

Source

petalisp.utilities.asd.

Parent Component

petalisp.utilities (system).

Public Interface

identical (function).


3.1.39 petalisp.utilities/memoization.lisp

Dependency

identical.lisp (file).

Source

petalisp.utilities.asd.

Parent Component

petalisp.utilities (system).

Public Interface
Internals

+empty+ (constant).


3.1.40 petalisp.utilities/extended-euclid.lisp

Dependency

memoization.lisp (file).

Source

petalisp.utilities.asd.

Parent Component

petalisp.utilities (system).

Public Interface

extended-euclid (function).

Internals

3.1.41 petalisp.utilities/powers-of-two.lisp

Dependency

extended-euclid.lisp (file).

Source

petalisp.utilities.asd.

Parent Component

petalisp.utilities (system).

Internals

3.1.42 petalisp.utilities/prime-factors.lisp

Dependency

powers-of-two.lisp (file).

Source

petalisp.utilities.asd.

Parent Component

petalisp.utilities (system).

Public Interface
Internals

3.1.43 petalisp.utilities/weak-set.lisp

Dependency

prime-factors.lisp (file).

Source

petalisp.utilities.asd.

Parent Component

petalisp.utilities (system).

Public Interface
Internals

3.1.44 petalisp.utilities/with-collectors.lisp

Dependency

weak-set.lisp (file).

Source

petalisp.utilities.asd.

Parent Component

petalisp.utilities (system).

Public Interface

with-collectors (macro).

Internals

with-collector (macro).


3.1.45 petalisp.utilities/number-of-cpus.lisp

Dependency

with-collectors.lisp (file).

Source

petalisp.utilities.asd.

Parent Component

petalisp.utilities (system).

Public Interface

number-of-cpus (function).


3.1.46 petalisp.utilities/topological-sort.lisp

Dependency

number-of-cpus.lisp (file).

Source

petalisp.utilities.asd.

Parent Component

petalisp.utilities (system).

Public Interface

topological-sort (function).


3.1.47 petalisp.utilities/graph-coloring.lisp

Dependency

topological-sort.lisp (file).

Source

petalisp.utilities.asd.

Parent Component

petalisp.utilities (system).

Public Interface
Internals

3.1.48 petalisp.utilities/karmarkar-karp.lisp

Dependency

graph-coloring.lisp (file).

Source

petalisp.utilities.asd.

Parent Component

petalisp.utilities (system).

Packages

petalisp.karmarkar-karp.

Public Interface

karmarkar-karp (function).

Internals

3.1.49 petalisp.utilities/with-pinned-objects.lisp

Dependency

karmarkar-karp.lisp (file).

Source

petalisp.utilities.asd.

Parent Component

petalisp.utilities (system).

Public Interface

with-pinned-objects (macro).

Internals

touch (function).


3.1.50 petalisp.core/packages.lisp

Source

petalisp.core.asd.

Parent Component

petalisp.core (system).

Packages

petalisp.core.


3.1.51 petalisp.core/range.lisp

Dependency

packages.lisp (file).

Source

petalisp.core.asd.

Parent Component

petalisp.core (system).

Public Interface
Internals

3.1.52 petalisp.core/shape.lisp

Dependency

range.lisp (file).

Source

petalisp.core.asd.

Parent Component

petalisp.core (system).

Public Interface
Internals

3.1.53 petalisp.core/transformation.lisp

Dependency

shape.lisp (file).

Source

petalisp.core.asd.

Parent Component

petalisp.core (system).

Public Interface
Internals

3.1.54 petalisp.core/transformation-constructors.lisp

Dependency

transformation.lisp (file).

Source

petalisp.core.asd.

Parent Component

petalisp.core (system).

Public Interface
Internals

3.1.55 petalisp.core/lazy-array.lisp

Dependency

transformation-constructors.lisp (file).

Source

petalisp.core.asd.

Parent Component

petalisp.core (system).

Public Interface
Internals

3.1.56 petalisp.core/lazy-ref.lisp

Dependency

lazy-array.lisp (file).

Source

petalisp.core.asd.

Parent Component

petalisp.core (system).

Public Interface
Internals

add-transformation-constraints (function).


3.1.57 petalisp.core/lazy-fuse.lisp

Dependency

lazy-ref.lisp (file).

Source

petalisp.core.asd.

Parent Component

petalisp.core (system).

Public Interface

lazy-fuse (function).


3.1.58 petalisp.core/lazy-map.lisp

Dependency

lazy-fuse.lisp (file).

Source

petalisp.core.asd.

Parent Component

petalisp.core (system).

Public Interface

3.1.59 petalisp.core/substitute-lazy-arrays.lisp

Dependency

lazy-map.lisp (file).

Source

petalisp.core.asd.

Parent Component

petalisp.core (system).

Public Interface
Internals

*substitutions* (special variable).


3.1.60 petalisp.core/backend.lisp

Dependency

substitute-lazy-arrays.lisp (file).

Source

petalisp.core.asd.

Parent Component

petalisp.core (system).

Public Interface
Internals

3.1.61 petalisp.core/reference-backend.lisp

Dependency

backend.lisp (file).

Source

petalisp.core.asd.

Parent Component

petalisp.core (system).

Public Interface
Internals

3.1.62 petalisp.xmas-backend/packages.lisp

Source

petalisp.xmas-backend.asd.

Parent Component

petalisp.xmas-backend (system).

Packages

petalisp.xmas-backend.


3.1.63 petalisp.xmas-backend/memory-pool.lisp

Dependency

packages.lisp (file).

Source

petalisp.xmas-backend.asd.

Parent Component

petalisp.xmas-backend (system).

Internals

3.1.64 petalisp.xmas-backend/worker-pool.lisp

Dependency

memory-pool.lisp (file).

Source

petalisp.xmas-backend.asd.

Parent Component

petalisp.xmas-backend (system).

Internals

3.1.65 petalisp.xmas-backend/xmas-backend.lisp

Dependency

worker-pool.lisp (file).

Source

petalisp.xmas-backend.asd.

Parent Component

petalisp.xmas-backend (system).

Public Interface
Internals

3.1.66 petalisp.ir/packages.lisp

Source

petalisp.ir.asd.

Parent Component

petalisp.ir (system).

Packages

petalisp.ir.


3.1.67 petalisp.ir/device.lisp

Dependency

packages.lisp (file).

Source

petalisp.ir.asd.

Parent Component

petalisp.ir (system).

Public Interface
Internals

3.1.68 petalisp.ir/ir.lisp

Dependency

device.lisp (file).

Source

petalisp.ir.asd.

Parent Component

petalisp.ir (system).

Public Interface
Internals

3.1.69 petalisp.ir/ir-checker.lisp

Dependency

ir.lisp (file).

Source

petalisp.ir.asd.

Parent Component

petalisp.ir (system).

Public Interface

check-ir (function).

Internals

3.1.70 petalisp.ir/ir-conversion.lisp

Dependency

ir-checker.lisp (file).

Source

petalisp.ir.asd.

Parent Component

petalisp.ir (system).

Public Interface
Internals

3.1.71 petalisp.ir/blueprint.lisp

Dependency

ir-conversion.lisp (file).

Source

petalisp.ir.asd.

Parent Component

petalisp.ir (system).

Public Interface

kernel-blueprint (function).

Internals

3.1.72 petalisp.ir/kernel-interpreter.lisp

Dependency

blueprint.lisp (file).

Source

petalisp.ir.asd.

Parent Component

petalisp.ir (system).

Public Interface

interpret-kernel (function).


3.1.73 petalisp.ir/kernel-compiler.lisp

Dependency

kernel-interpreter.lisp (file).

Source

petalisp.ir.asd.

Parent Component

petalisp.ir (system).

Public Interface

translate-blueprint (function).

Internals

3.1.74 petalisp.ir/partitioning.lisp

Dependency

kernel-compiler.lisp (file).

Source

petalisp.ir.asd.

Parent Component

petalisp.ir (system).

Public Interface
Internals

3.1.75 petalisp.ir/coloring.lisp

Dependency

partitioning.lisp (file).

Source

petalisp.ir.asd.

Parent Component

petalisp.ir (system).

Public Interface

compute-program-buffer-coloring (function).


3.1.76 petalisp.ir/ir-backend.lisp

Dependency

coloring.lisp (file).

Source

petalisp.ir.asd.

Parent Component

petalisp.ir (system).

Public Interface
Internals

3.1.77 petalisp.ir/documentation.lisp

Dependency

ir-backend.lisp (file).

Source

petalisp.ir.asd.

Parent Component

petalisp.ir (system).


3.1.78 petalisp.test-suite/packages.lisp

Source

petalisp.test-suite.asd.

Parent Component

petalisp.test-suite (system).

Packages

petalisp.test-suite.


3.1.79 petalisp.test-suite/test-suite.lisp

Dependency

packages.lisp (file).

Source

petalisp.test-suite.asd.

Parent Component

petalisp.test-suite (system).

Public Interface
Internals

3.1.80 petalisp.test-suite/testing-backend.lisp

Dependency

test-suite.lisp (file).

Source

petalisp.test-suite.asd.

Parent Component

petalisp.test-suite (system).

Public Interface
Internals

3.1.81 petalisp.test-suite/code-statistics.lisp

Dependency

testing-backend.lisp (file).

Source

petalisp.test-suite.asd.

Parent Component

petalisp.test-suite (system).

Internals

3.1.82 petalisp.test-suite/defgenerator.lisp

Dependency

code-statistics.lisp (file).

Source

petalisp.test-suite.asd.

Parent Component

petalisp.test-suite (system).

Internals

3.1.83 petalisp.test-suite/generators.lisp

Dependency

defgenerator.lisp (file).

Source

petalisp.test-suite.asd.

Parent Component

petalisp.test-suite (system).

Internals

3.1.84 petalisp.test-suite/run-petalisp-test-suite.lisp

Dependency

generators.lisp (file).

Source

petalisp.test-suite.asd.

Parent Component

petalisp.test-suite (system).

Public Interface

3.1.85 petalisp.test-suite/petalisp.utilities.lisp

Dependency

run-petalisp-test-suite.lisp (file).

Source

petalisp.test-suite.asd.

Parent Component

petalisp.test-suite (system).

Internals

wsdeque-test (function).


3.1.86 petalisp.test-suite/petalisp.core.lisp

Dependency

petalisp.utilities.lisp (file).

Source

petalisp.test-suite.asd.

Parent Component

petalisp.test-suite (system).

Internals

3.1.87 petalisp.test-suite/petalisp.examples.lisp

Dependency

petalisp.core.lisp (file).

Source

petalisp.test-suite.asd.

Parent Component

petalisp.test-suite (system).

Internals

4 Packages

Packages are listed by definition order.


4.1 petalisp.core

Source

packages.lisp.

Use List

common-lisp.

Used By List
Public Interface
Internals

4.2 petalisp.ir

Source

packages.lisp.

Use List
Used By List

petalisp.xmas-backend.

Public Interface
Internals

4.3 petalisp-user

Source

packages.lisp.

Use List

4.4 petalisp.api

Source

packages.lisp.

Nickname

petalisp

Use List
Used By List
  • petalisp-user.
  • petalisp.examples.image-processing.
  • petalisp.examples.iterative-methods.
  • petalisp.examples.linear-algebra.
  • petalisp.examples.machine-learning.
  • petalisp.examples.mnist.
  • petalisp.examples.wave-equation.
  • petalisp.test-suite.
Public Interface
Internals

4.5 petalisp.xmas-backend

Source

packages.lisp.

Use List
Public Interface

make-xmas-backend (function).

Internals

4.6 petalisp.utilities

Source

packages.lisp.

Use List

common-lisp.

Used By List

petalisp.karmarkar-karp.

Public Interface
Internals

4.7 petalisp.test-suite

Source

packages.lisp.

Use List
Public Interface
Internals

4.8 petalisp.karmarkar-karp

Source

karmarkar-karp.lisp.

Use List
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Constants

Constant: ~

The symbols ~, ~l, ~s and ~r are self-evaluating. Their only purpose is to separate range designators in the functions named ~, ~l, ~s and ~r.

Package

petalisp.api.

Source

shape-syntax.lisp.

Constant: ~l

The symbols ~, ~l, ~s and ~r are self-evaluating. Their only purpose is to separate range designators in the functions named ~, ~l, ~s and ~r.

Package

petalisp.api.

Source

shape-syntax.lisp.

Constant: ~r

The symbols ~, ~l, ~s and ~r are self-evaluating. Their only purpose is to separate range designators in the functions named ~, ~l, ~s and ~r.

Package

petalisp.api.

Source

shape-syntax.lisp.

Constant: ~s

The symbols ~, ~l, ~s and ~r are self-evaluating. Their only purpose is to separate range designators in the functions named ~, ~l, ~s and ~r.

Package

petalisp.api.

Source

shape-syntax.lisp.


5.1.2 Special variables

Special Variable: *backend*
Package

petalisp.core.

Source

packages.lisp.

Special Variable: *lazy-array-lock*
Package

petalisp.core.

Source

lazy-array.lisp.

Special Variable: *stencil-max-radius*
Package

petalisp.ir.

Source

ir.lisp.


5.1.3 Macros

Macro: defalias (alias thing)
Package

petalisp.utilities.

Source

defalias.lisp.

Macro: define-bitfield (name &body slots)

Defines an efficient collection of booleans and small integers.

For a supplied bitfield name NAME, and for some slot definitions of the form (SLOT-NAME TYPE), this macro defines the following functions:

1. A constructor named MAKE-{NAME}, that takes one keyword argument per SLOT-NAME, similar to the default constructor generated by DEFSTRUCT. It returns a bitfield whose entries have the values indicated by the keyword arguments, or a reasonable default (NIL for booleans, 0 for numbers).

2. A clone operation named CLONE-{NAME}, that takes an existing bitfield and one keyword argument per SLOT-NAME. It returns a copy of the existing bitfield, but where each supplied keyword argument supersedes the value of the corresponding slot.

3. A reader function named {NAME}-{SLOT-NAME} for each slot.

In addition to these functions, NAME is defined as a suitable subtype of (and unsigned-byte fixnum).

Currently this macro supports boolean, unsigned-byte and signed-byte slots.

Example:

(define-bitfield examplebits
(a boolean)
(b boolean)
(c boolean)
(x (signed-byte 5))
(id (unsigned-byte 16)))

(defparameter *a*
(make-examplebits :a nil :b t :id 42))

(list
(examplebits-a *a*)
(examplebits-b *a*)
(examplebits-c *a*)
(examplebits-x *a*)
(examplebits-id *a*))

;; Returns (NIL T NIL 0 42)

(defparameter *b*
(clone-examplebits *a* :c t :x -2))

(list
(examplebits-a *b*)
(examplebits-b *b*)
(examplebits-c *b*)
(examplebits-x *b*)
(examplebits-id *b*))

;; Returns (NIL T T -2 42)

Package

petalisp.utilities.

Source

bitfield.lisp.

Macro: define-shape-syntax (delimiter (tokens collect finish) constructor-syntax pattern-syntax)
Package

petalisp.api.

Source

shape-syntax.lisp.

Macro: define-test (name &body body)

Define a test function and add it to *TESTS*.

Package

petalisp.test-suite.

Source

test-suite.lisp.

Macro: do-buffer-inputs ((kernel buffer &optional result) &body body)
Package

petalisp.ir.

Source

ir.lisp.

Macro: do-buffer-load-instructions ((load-instruction buffer &optional result) &body body)
Package

petalisp.ir.

Source

ir.lisp.

Macro: do-buffer-outputs ((kernel buffer &optional result) &body body)
Package

petalisp.ir.

Source

ir.lisp.

Macro: do-buffer-store-instructions ((store-instruction buffer &optional result) &body body)
Package

petalisp.ir.

Source

ir.lisp.

Macro: do-instruction-inputs ((input instruction &optional result) &body body)
Package

petalisp.ir.

Source

ir.lisp.

Macro: do-kernel-inputs ((buffer kernel &optional result) &body body)
Package

petalisp.ir.

Source

ir.lisp.

Macro: do-kernel-instructions ((instruction kernel &optional result) &body body)
Package

petalisp.ir.

Source

ir.lisp.

Macro: do-kernel-load-instructions ((load-instruction kernel &optional result) &body body)
Package

petalisp.ir.

Source

ir.lisp.

Macro: do-kernel-outputs ((buffer kernel &optional result) &body body)
Package

petalisp.ir.

Source

ir.lisp.

Macro: do-kernel-stencils ((stencil kernel &optional result) &body body)
Package

petalisp.ir.

Source

ir.lisp.

Macro: do-kernel-store-instructions ((store-instruction kernel &optional result) &body body)
Package

petalisp.ir.

Source

ir.lisp.

Macro: do-program-buffer-groups ((buffers program &optional result) &body body)
Package

petalisp.ir.

Source

ir.lisp.

Macro: do-program-buffers ((buffer program &optional result) &body body)
Package

petalisp.ir.

Source

ir.lisp.

Macro: do-program-kernels ((kernel program &optional result) &body body)
Package

petalisp.ir.

Source

ir.lisp.

Macro: do-program-tasks ((task program &optional result) &body body)
Package

petalisp.ir.

Source

ir.lisp.

Macro: do-stencil-load-instructions ((load-instruction stencil &optional result) &body body)
Package

petalisp.ir.

Source

ir.lisp.

Macro: do-task-defined-buffers ((defined-buffer task &optional result) &body body)
Package

petalisp.ir.

Source

ir.lisp.

Macro: do-task-kernels ((kernel task &optional result) &body body)
Package

petalisp.ir.

Source

ir.lisp.

Macro: do-task-predecessors ((predecessor task &optional result) &body body)
Package

petalisp.ir.

Source

ir.lisp.

Macro: do-task-successors ((successor task &optional result) &body body)
Package

petalisp.ir.

Source

ir.lisp.

Macro: document-compiler-macro (name &body body)
Package

petalisp.utilities.

Source

documentation.lisp.

Macro: document-compiler-macros (names &body body)
Package

petalisp.utilities.

Source

documentation.lisp.

Macro: document-function (name &body body)
Package

petalisp.utilities.

Source

documentation.lisp.

Macro: document-functions (names &body body)
Package

petalisp.utilities.

Source

documentation.lisp.

Macro: document-method-combination (name &body body)
Package

petalisp.utilities.

Source

documentation.lisp.

Macro: document-method-combinations (names &body body)
Package

petalisp.utilities.

Source

documentation.lisp.

Macro: document-setf-expander (name &body body)
Package

petalisp.utilities.

Source

documentation.lisp.

Macro: document-setf-expanders (names &body body)
Package

petalisp.utilities.

Source

documentation.lisp.

Macro: document-structure (name &body body)
Package

petalisp.utilities.

Source

documentation.lisp.

Macro: document-structures (names &body body)
Package

petalisp.utilities.

Source

documentation.lisp.

Macro: document-variable (name &body body)
Package

petalisp.utilities.

Source

documentation.lisp.

Macro: document-variables (names &body body)
Package

petalisp.utilities.

Source

documentation.lisp.

Macro: is (test-form)

Assert that TEST-FORM evaluates to true.

Package

petalisp.test-suite.

Source

test-suite.lisp.

Macro: signals (condition &body body)

Assert that ‘body’ signals a condition of type ‘condition’.

Package

petalisp.test-suite.

Source

test-suite.lisp.

Macro: transform (&rest inputs-to-outputs)

Creates a transformation that maps some inputs to the specified outputs. The syntax is (transform INPUT-1 ... INPUT-N to OUTPUT-1 OUTPUT-N).

Each input can either be a variable, an integer, or a list whose first element is a variable and whose second element is a form that evaluates to an integer.

Each output is a form that may reference up to one of the input variables. The result of an output form in a context where the referenced input variable is bound to an integer must be an integer. The mapping form the input to the output must be linear.

Examples:

(transform i to (+ i 1))
=> (transform a to (1+ a))

(transform i to (+ (+ i 1) 5))
=> (transform a to (+ a 6))

(transform 1 2 3 to)
=> (transform 1 2 3 to)

(transform to 1 2 3)
=> (transform to 1 2 3)

(transform i j to j i)
=> (transform a b to b a)

Package

petalisp.api.

Source

transform.lisp.

Macro: with-collectors (collectors &body body)

Within the lexical scope of BODY, bind the specified collectors. Each entry in COLLECTORS must be a list of two valid function names - RESULT and GATHER. Each such pair of function names is bound to local functions, with the following behavior:

The function named GATHER takes a single argument, stores this argument in some unspecified way, and returns this argument.

The function named RESULT takes either zero or one object. It returns the list of all objects that have been stored by calls to the function named GATHER. If supplied, the optional argument is used as the tail of the list being returned. Calling the function named RESULT more than once results in undefined behavior.

Examples:

(with-collectors ((odds collect-odd)
(evens collect-even))
(loop for n below 8 do
(if (oddp n)
(collect-odd n)
(collect-even n)))
(values (odds) (evens)))

=> (1 3 5 7)
=> (0 2 4 6)

(with-collectors ((numbers collect-number))
(collect-number 2)
(collect-number 3)
(numbers ’(4 5 6))) ; Here, we explicitly supply a tail.

=> (2 3 4 5 6)

Package

petalisp.utilities.

Source

with-collectors.lisp.

Macro: with-hash-table-memoization ((key &key store-key) hash-table &body body)

Memoize the value of BODY. If KEY is found in HASH-TABLE, BODY is not evaluated and the corresponding value is returned. Otherwise, BODY is evaluated and its values are first stored as the HASH-TABLE entry of KEY and then returned.

If the optional form STORE-KEY is supplied, it is evaluated after any evaluation of BODY and its value is used instead of KEY for storing the results. This way, KEY can be an object with dynamic extent (to avoid consing) and STORE-KEY can create a copy with indefinite extent when necessary.

Package

petalisp.utilities.

Source

memoization.lisp.

Macro: with-memoization ((key &key test store-key) &body body)

Memoize the value of BODY. If KEY has the same value (with respect to TEST) as some previously computed key, then BODY is not evaluated and the values of the previous computation are returned.

Note: TEST is evaluated at load time in a null lexical environment and must be a valid hash table test designator.

If the optional form STORE-KEY is supplied, it is evaluated after any evaluation of BODY and its value is used instead of KEY for storing the results. This way, KEY can be an object with dynamic extent (to avoid consing) and STORE-KEY can create a copy with indefinite extent when necessary.

Package

petalisp.utilities.

Source

memoization.lisp.

Macro: with-multiple-value-hash-table-memoization ((key &key store-key) hash-table &body body)

Memoize the multiple values of BODY. If KEY is found in HASH-TABLE, BODY is not evaluated and the values of the previous computation are returned. Otherwise, BODY is evaluated and its values are first stored at KEY in HASH-TABLE and then returned.

If the optional form STORE-KEY is supplied, it is evaluated after any evaluation of BODY and its value is used instead of KEY for storing the results. This way, KEY can be an object with dynamic extent (to avoid consing) and STORE-KEY can create a copy with indefinite extent when necessary.

Package

petalisp.utilities.

Source

memoization.lisp.

Macro: with-multiple-value-memoization ((key &key test store-key) &body body)

Memoize the multiple values of BODY. If KEY has the same value (with respect to TEST) as some previously computed key, then BODY is not evaluated and the values of the previous computation are returned.

Note: TEST is evaluated at load time in a null lexical environment and must be a suitable hash table test.

If the optional form STORE-KEY is supplied, it is evaluated after any evaluation of BODY and its value is used instead of KEY for storing the results. This way, KEY can be an object with dynamic extent (to avoid consing) and STORE-KEY can create a copy with indefinite extent when necessary.

Package

petalisp.utilities.

Source

memoization.lisp.

Macro: with-multiple-value-vector-memoization ((key &key size growth) &body body)

Memoize the values of BODY for VAR being a relatively small integer.

Package

petalisp.utilities.

Source

memoization.lisp.

Macro: with-pinned-objects ((&rest objects) &body body)
Package

petalisp.utilities.

Source

with-pinned-objects.lisp.

Macro: with-temporary-backend (backend-creation-form &body body)
Package

petalisp.core.

Source

backend.lisp.

Macro: with-vector-memoization ((key &key size growth) &body body)

Memoize the value of BODY for KEY being a relatively small integer.

Package

petalisp.utilities.

Source

memoization.lisp.


5.1.4 Compiler macros

Compiler Macro: compose-transformations (&rest transformations)
Package

petalisp.core.

Source

transformation.lisp.

Compiler Macro: range (&rest args)
Package

petalisp.core.

Source

range.lisp.


5.1.5 Ordinary functions

Function: all-tests ()
Package

petalisp.test-suite.

Source

test-suite.lisp.

Function: array-has-shape-p (array shape)
Package

petalisp.core.

Source

shape.lisp.

Function: array-shape (array)
Package

petalisp.core.

Source

shape.lisp.

Function: array-value (array)
Package

petalisp.core.

Source

lazy-array.lisp.

Function: buffer-bits (buffer)
Package

petalisp.ir.

Source

ir.lisp.

Reader: buffer-depth (instance)
Writer: (setf buffer-depth) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Target Slot

depth.

Reader: buffer-ntype (instance)
Writer: (setf buffer-ntype) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Target Slot

ntype.

Reader: buffer-number (instance)
Writer: (setf buffer-number) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Target Slot

number.

Function: buffer-number-of-inputs (buffer)
Package

petalisp.ir.

Source

ir.lisp.

Function: buffer-number-of-loads (buffer)
Package

petalisp.ir.

Source

ir.lisp.

Function: buffer-number-of-outputs (buffer)
Package

petalisp.ir.

Source

ir.lisp.

Function: buffer-number-of-stores (buffer)
Package

petalisp.ir.

Source

ir.lisp.

Function: buffer-program (buffer)
Package

petalisp.ir.

Source

ir.lisp.

Function: buffer-reuse-potential (buffer)
Package

petalisp.ir.

Source

ir.lisp.

Reader: buffer-shape (instance)
Writer: (setf buffer-shape) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Target Slot

shape.

Function: buffer-size (buffer)
Package

petalisp.ir.

Source

ir.lisp.

Reader: buffer-storage (instance)
Writer: (setf buffer-storage) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Target Slot

storage.

Reader: buffer-task (instance)
Writer: (setf buffer-task) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Target Slot

task.

Function: bufferp (object)
Package

petalisp.ir.

Source

ir.lisp.

Reader: call-instruction-fnrecord (instance)
Writer: (setf call-instruction-fnrecord) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Target Slot

fnrecord.

Function: call-instruction-function (call-instruction)
Package

petalisp.ir.

Source

ir.lisp.

Function: call-instruction-p (object)
Package

petalisp.ir.

Source

ir.lisp.

Function: call-network (network &rest plist)
Package

petalisp.api.

Source

network.lisp.

Function: cgraph-add-conflict (cgraph a b)
Package

petalisp.utilities.

Source

graph-coloring.lisp.

Function: cgraph-coloring (cgraph)

For a supplied conflict graph, returns a vector whose elements are lists of objects with no conflicts.

Package

petalisp.utilities.

Source

graph-coloring.lisp.

Function: cgraph-ensure-cnode (cgraph object)
Package

petalisp.utilities.

Source

graph-coloring.lisp.

Function: check-ir (&rest nodes)
Package

petalisp.ir.

Source

ir-checker.lisp.

Function: check-package (package &key skip)
Package

petalisp.test-suite.

Source

test-suite.lisp.

Function: chunk-bits (chunk)
Package

petalisp.ir.

Source

partitioning.lisp.

Reader: chunk-buffer (instance)
Package

petalisp.ir.

Source

partitioning.lisp.

Target Slot

buffer.

Function: chunk-infants (chunk)

An infant is a chunk without a split. This function returns the list of infants whose line of ancestry contains the supplied CHUNK.

Package

petalisp.ir.

Source

partitioning.lisp.

Reader: chunk-parent (instance)
Package

petalisp.ir.

Source

partitioning.lisp.

Target Slot

parent.

Function: chunk-primogenitor (chunk)
Package

petalisp.ir.

Source

partitioning.lisp.

Reader: chunk-shape (instance)
Package

petalisp.ir.

Source

partitioning.lisp.

Target Slot

shape.

Reader: chunk-split (instance)
Writer: (setf chunk-split) (instance)
Package

petalisp.ir.

Source

partitioning.lisp.

Target Slot

split.

Reader: chunk-writers (instance)
Writer: (setf chunk-writers) (instance)
Package

petalisp.ir.

Source

partitioning.lisp.

Target Slot

writers.

Function: chunkp (object)
Package

petalisp.ir.

Source

partitioning.lisp.

Function: clear-shape-table (shape-table)
Package

petalisp.core.

Source

shape.lisp.

Function: collapsing-transformation (shape)
Package

petalisp.core.

Source

transformation-constructors.lisp.

Function: compatible-with-lazy-array-p (object lazy-array)
Package

petalisp.core.

Source

lazy-array.lisp.

Function: compose-transformations (transformation &rest more-transformations)

Returns a single transformation that is equivalent to consecutive invocations of the supplied transformations in right-to-left order.

Examples:

(compose-transformations (transform i to (* 2 (1+ i))) (transform i to (1- (/ i 2))))
=> (transform a to a)

(compose-transformations (transform i j to (+ i 5) (+ j 7)) (transform i j to (* j 2) (* i 3))) => (transform a b to (+ (* 2 b) 5) (+ (* 3 a) 7))

Package

petalisp.core.

Source

transformation.lisp.

Function: compute (&rest arrays)

Returns, as multiple values, the computed result of each supplied argument.

The computed result of an array or lazy array with rank zero is the one element contained in this array. The computed result of any other array or lazy array is an array with the same rank and dimensions. The computed result of any other object is that object itself.

Examples:

(compute (lazy #’+ 2 #(3 4)))
=> #(5 6)

(compute (lazy-reshape #2A((1 2) (3 4)) (transform i j to j i)))
=> #2A((1 3) (2 4))

(compute 2 #0A3 #(4))
=> 2
=> 3
=> #(4)

Package

petalisp.core.

Source

backend.lisp.

Function: compute-asynchronously (&rest arrays)

Hints that it would be worthwhile to compute the supplied arrays asynchronously. Returns an opaque object that can be supplied to WAIT to wait until the scheduled operation has been performed.

This function allows speeding up certain programs like

(progn (run-expensive-task)
(compute array-1 array-2))

by rewriting them to something like

(progn (compute-asynchronously array-1 array-2) (run-expensive-task)
(compute array-1 array-2)).

Package

petalisp.core.

Source

backend.lisp.

Function: compute-chunk-vicinity (chunk)
Package

petalisp.ir.

Source

partitioning.lisp.

Function: compute-list-of-arrays (arrays)

Returns a list of computed results - one for each element in the list of supplied arrays.

The computed result of an array or lazy array with rank zero is the one element contained in this array. The computed result of any other array or lazy array is an array with the same rank and dimensions. The computed result of any other object is that object itself.

Examples:

(compute-list-of-arrays (list (lazy #’+ 2 #(3 4))))
=> (#(5 6))

(compute-list-of-arrays
(list (lazy-reshape #2A((1 2) (3 4)) (transform i j to j i))))
=> (#2A((1 3) (2 4)))

(compute-list-of-arrays (list 2 #0A3 #(4)))
=> (2 3 #(4))

Package

petalisp.core.

Source

backend.lisp.

Function: compute-program-buffer-coloring (program)

Returns a partitioning of all non-leaf buffers in PROGRAM into a list of lists of buffers. Each list of buffers has the same color, meaning that they can share the same memory location without conflicts.

All root buffers conflict with each other, so each list of buffers contains at most one root buffer. By convention, if a root buffer is present in a list of buffers, it comes first.

Package

petalisp.ir.

Source

coloring.lisp.

Function: compute-program-primogenitor-chunk-vector (program)

Returns a vector whose Nth entry is the primogenitor chunk corresponding to the buffer with number N.

Package

petalisp.ir.

Source

partitioning.lisp.

Function: compute-stencil-center (load-instruction &rest more-load-instructions)
Package

petalisp.ir.

Source

ir.lisp.

Function: copy-lazy-arrays (lazy-arrays)
Package

petalisp.core.

Source

substitute-lazy-arrays.lisp.

Function: delayed-action-p (object)
Package

petalisp.core.

Source

lazy-array.lisp.

Function: delayed-array-p (object)
Package

petalisp.core.

Source

lazy-array.lisp.

Reader: delayed-array-storage (instance)
Writer: (setf delayed-array-storage) (instance)
Package

petalisp.core.

Source

lazy-array.lisp.

Target Slot

storage.

Reader: delayed-failure-condition (instance)
Package

petalisp.core.

Source

lazy-array.lisp.

Target Slot

condition.

Function: delayed-failure-p (object)
Package

petalisp.core.

Source

lazy-array.lisp.

Reader: delayed-fuse-inputs (instance)
Writer: (setf delayed-fuse-inputs) (instance)
Package

petalisp.core.

Source

lazy-array.lisp.

Target Slot

inputs.

Function: delayed-fuse-p (object)
Package

petalisp.core.

Source

lazy-array.lisp.

Reader: delayed-map-fnrecord (instance)
Writer: (setf delayed-map-fnrecord) (instance)
Package

petalisp.core.

Source

lazy-array.lisp.

Target Slot

fnrecord.

Reader: delayed-map-inputs (instance)
Writer: (setf delayed-map-inputs) (instance)
Package

petalisp.core.

Source

lazy-array.lisp.

Target Slot

inputs.

Function: delayed-map-number-of-values (delayed-map)
Package

petalisp.core.

Source

lazy-array.lisp.

Function: delayed-map-p (object)
Package

petalisp.core.

Source

lazy-array.lisp.

Function: delayed-multiple-value-map-fnrecord (instance)
Package

petalisp.core.

Source

lazy-array.lisp.

Function: (setf delayed-multiple-value-map-fnrecord) (instance)
Package

petalisp.core.

Source

lazy-array.lisp.

Function: delayed-multiple-value-map-inputs (instance)
Package

petalisp.core.

Source

lazy-array.lisp.

Function: (setf delayed-multiple-value-map-inputs) (instance)
Package

petalisp.core.

Source

lazy-array.lisp.

Function: delayed-multiple-value-map-p (object)
Package

petalisp.core.

Source

lazy-array.lisp.

Reader: delayed-multiple-value-map-refbits (instance)
Writer: (setf delayed-multiple-value-map-refbits) (instance)
Package

petalisp.core.

Source

lazy-array.lisp.

Target Slot

refbits.

Reader: delayed-multiple-value-map-values-ntype (instance)
Package

petalisp.core.

Source

lazy-array.lisp.

Target Slot

values-ntype.

Function: delayed-nop-p (object)
Package

petalisp.core.

Source

lazy-array.lisp.

Reader: delayed-nth-value-input (instance)
Writer: (setf delayed-nth-value-input) (instance)
Package

petalisp.core.

Source

lazy-array.lisp.

Target Slot

input.

Reader: delayed-nth-value-number (instance)
Writer: (setf delayed-nth-value-number) (instance)
Package

petalisp.core.

Source

lazy-array.lisp.

Target Slot

number.

Function: delayed-nth-value-p (object)
Package

petalisp.core.

Source

lazy-array.lisp.

Function: delayed-range-p (object)
Package

petalisp.core.

Source

lazy-array.lisp.

Reader: delayed-reshape-input (instance)
Writer: (setf delayed-reshape-input) (instance)
Package

petalisp.core.

Source

lazy-array.lisp.

Target Slot

input.

Function: delayed-reshape-p (object)
Package

petalisp.core.

Source

lazy-array.lisp.

Reader: delayed-reshape-transformation (instance)
Writer: (setf delayed-reshape-transformation) (instance)
Package

petalisp.core.

Source

lazy-array.lisp.

Target Slot

transformation.

Function: delayed-unknown-p (object)
Package

petalisp.core.

Source

lazy-array.lisp.

Reader: delayed-wait-delayed-action (instance)
Writer: (setf delayed-wait-delayed-action) (instance)
Package

petalisp.core.

Source

lazy-array.lisp.

Target Slot

delayed-action.

Function: delayed-wait-p (object)
Package

petalisp.core.

Source

lazy-array.lisp.

Reader: delayed-wait-request (instance)
Package

petalisp.core.

Source

lazy-array.lisp.

Target Slot

request.

Function: differentiator (outputs gradients)

Returns a function that, for each node in a network whose roots are the supplied OUTPUTS will return the gradient at that node.

GRADIENTS must be a sequence of the same length as OUTPUTS, and whose elements are either arrays with or symbols that will be used as the name of such a parameter.

Package

petalisp.api.

Source

differentiator.lisp.

Function: empty-lazy-array (shape)
Package

petalisp.core.

Source

lazy-array.lisp.

Function: empty-lazy-arrays (n shape)
Package

petalisp.core.

Source

lazy-array.lisp.

Function: empty-range ()
Package

petalisp.core.

Source

range.lisp.

Function: empty-range-p (object)
Package

petalisp.core.

Source

range.lisp.

Function: empty-shape-p (shape)
Package

petalisp.core.

Source

shape.lisp.

Function: enlarge-shape (shape range)

For a given shape S and range R, this function returns a shape whose first range is R, and whose remaining ranges are those of S.

Examples:

(enlarge-shape (~) (range 1 10))
=> (~ 1 10)

(enlarge-shape (~ 1 3) (range 1 4))
=> (~ 1 4 ~ 1 3)

Package

petalisp.core.

Source

shape.lisp.

Function: ensure-array-buffer-compatibility (array buffer)
Package

petalisp.ir.

Source

ir.lisp.

Function: evaluator (unknowns arrays)
Package

petalisp.core.

Source

backend.lisp.

Function: extended-euclid (u v)

Given nonnegative integers u and v, returns the values u1 and u3 such that u*u1 + v*u2 = u3 = gcd(u,v).

Package

petalisp.utilities.

Source

extended-euclid.lisp.

Function: fuse-ranges (&rest ranges)
Package

petalisp.core.

Source

range.lisp.

Function: fuse-shapes (shape &rest more-shapes)
Package

petalisp.core.

Source

shape.lisp.

Function: host-device ()
Package

petalisp.ir.

Source

device.lisp.

Function: identical (sequence &key test key)

Check whether the KEYs of SEQUENCE are identical with respect to TEST.

Package

petalisp.utilities.

Source

identical.lisp.

Function: identity-transformation (rank)

Returns an identity transformation of the specified rank.

Package

petalisp.core.

Source

transformation-constructors.lisp.

Function: identity-transformation-p (object)
Package

petalisp.core.

Source

transformation.lisp.

Reader: instruction-inputs (instance)
Writer: (setf instruction-inputs) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Target Slot

inputs.

Reader: instruction-number (instance)
Writer: (setf instruction-number) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Target Slot

number.

Reader: instruction-transformation (instance)
Writer: (setf instruction-transformation) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Target Slot

transformation.

Function: instructionp (object)
Package

petalisp.ir.

Source

ir.lisp.

Function: interior-buffer-p (buffer)
Package

petalisp.ir.

Source

ir.lisp.

Function: interpret-kernel (kernel iteration-space)
Package

petalisp.ir.

Source

kernel-interpreter.lisp.

Function: ir-from-lazy-arrays (lazy-arrays &key kernel-size-threshold)

Returns a list of buffers that form the root of an IR data flow graph that is equivalent to the data flow graph specified by the supplied LAZY-ARRAYS.

An IR graph is consists of alternating buffers and kernels. Each kernel reads and writes from zero or more buffers and writes to zero and more buffers. The behavior or each kernel is described by a directed acyclic graph of instructions.

Package

petalisp.ir.

Source

ir-conversion.lisp.

Function: iref-instruction-p (object)
Package

petalisp.ir.

Source

ir.lisp.

Function: iref-instruction-transformation (instance)
Package

petalisp.ir.

Source

ir.lisp.

Function: (setf iref-instruction-transformation) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Function: iterating-instruction-p (object)
Package

petalisp.ir.

Source

ir.lisp.

Function: karmarkar-karp (s k &key weight)

Partition the set of objects S in k subsets such that the sums of the weights of the objects in each subset are nearly equal.

Returns a vector of length k whose elements are lists that partition S. As a second value, returns the difference between the sum of the weights of the smalles partition and that of the largest partition.

Package

petalisp.utilities.

Source

karmarkar-karp.lisp.

Function: kernel-blueprint (kernel)

Returns a utree that represents all information necessary to generate a high-performance implementation of KERNEL. Identical blueprints are EQ, which makes them ideal for caching.

Package

petalisp.ir.

Source

blueprint.lisp.

Function: kernel-cost (kernel)
Package

petalisp.ir.

Source

ir.lisp.

Reader: kernel-instruction-vector (instance)
Writer: (setf kernel-instruction-vector) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Target Slot

instruction-vector.

Reader: kernel-iteration-space (instance)
Writer: (setf kernel-iteration-space) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Target Slot

iteration-space.

Reader: kernel-number (instance)
Writer: (setf kernel-number) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Target Slot

number.

Function: kernel-number-of-inputs (kernel)
Package

petalisp.ir.

Source

ir.lisp.

Function: kernel-number-of-loads (kernel)
Package

petalisp.ir.

Source

ir.lisp.

Function: kernel-number-of-outputs (kernel)
Package

petalisp.ir.

Source

ir.lisp.

Function: kernel-number-of-stores (kernel)
Package

petalisp.ir.

Source

ir.lisp.

Function: kernel-program (kernel)
Package

petalisp.ir.

Source

ir.lisp.

Function: kernel-reuse-potential (kernel)
Package

petalisp.ir.

Source

ir.lisp.

Function: kernel-stencils (kernel buffer)
Package

petalisp.ir.

Source

ir.lisp.

Reader: kernel-task (instance)
Writer: (setf kernel-task) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Target Slot

task.

Function: kernelp (object)
Package

petalisp.ir.

Source

ir.lisp.

Function: lazy (function &rest arrays)

Returns one or more lazy arrays, whose contents are the values returned by the supplied function when applied element-wise to the contents of the remaining argument arrays. If the arguments don’t agree in shape, they are first broadcast with the function BROADCAST-ARRAYS.

Examples:

(lazy #’+ #(1 2) #(3 4))
=> #<lazy-array number (~ 2)>

(compute (lazy #’+ 2 3))
=> 5

(compute (lazy #’+ 2 #(1 2 3 4 5)))
=> #(3 4 5 6 7)

(compute (lazy #’* #(2 3) #2A((1 2) (3 4))))
=> #2A((2 6) (6 12))

(compute (lazy #’floor 7.5))
=> 7

(compute (lazy #’floor 7.5 #(1 2 3 4 5)))
=> #(7 3 2 1 1)

Package

petalisp.api.

Source

lazy.lisp.

Function: lazy-allreduce (function &rest arrays)
Package

petalisp.api.

Source

lazy-allreduce.lisp.

Function: lazy-array (object)
Package

petalisp.core.

Source

lazy-array.lisp.

Reader: lazy-array-delayed-action (instance)
Writer: (setf lazy-array-delayed-action) (instance)
Package

petalisp.core.

Source

lazy-array.lisp.

Target Slot

delayed-action.

Reader: lazy-array-depth (instance)
Package

petalisp.core.

Source

lazy-array.lisp.

Target Slot

depth.

Function: lazy-array-element-type (lazy-array)
Package

petalisp.core.

Source

lazy-array.lisp.

Function: lazy-array-from-array (array)
Package

petalisp.core.

Source

lazy-array.lisp.

Function: lazy-array-from-range (range)
Package

petalisp.core.

Source

lazy-array.lisp.

Function: lazy-array-from-scalar (object)
Package

petalisp.core.

Source

lazy-array.lisp.

Function: lazy-array-indices (array &optional axis)

Returns a lazy array of integers of the shape of ARRAY, where each array element at index (i_0 ... i_N) has the value i_AXIS. If AXIS is not supplied, it defaults to zero.

Examples:

(compute (lazy-array-indices #2A((1 2) (3 4))))
=> #2A((0 0) (1 1))

(compute (lazy-array-indices #2A((1 2) (3 4)) 1))
=> #2A((0 1) (0 1))

(compute (lazy-array-indices abc))
=> #(0 1 2)

Package

petalisp.api.

Source

lazy-array-indices.lisp.

Function: lazy-array-inputs (lazy-array)
Package

petalisp.core.

Source

lazy-array.lisp.

Function: lazy-array-interior (array &optional width)

For a given ARRAY and WIDTH, return a new, lazy array with those
elements that are at least WIDTH entries away from any boundary. If not supplied, WIDTH defaults to one.

Examples:

(compute (lazy-array-interior #2A((1 2 3 4) (5 6 7 8) (1 2 3 4) (5 6 7 8)))) => #2A((6 7) (2 3))

(compute (lazy-array-interior #2A((1 2 3 4) (5 6 7 8) (1 2 3 4) (5 6 7 8)) 2)) >> type-error

Package

petalisp.api.

Source

lazy-array-interior.lisp.

Reader: lazy-array-ntype (instance)
Package

petalisp.core.

Source

lazy-array.lisp.

Target Slot

ntype.

Function: lazy-array-p (object)
Package

petalisp.core.

Source

lazy-array.lisp.

Function: lazy-array-ranges (lazy-array)
Package

petalisp.core.

Source

lazy-array.lisp.

Function: lazy-array-rank (lazy-array)
Package

petalisp.core.

Source

lazy-array.lisp.

Reader: lazy-array-refcount (instance)
Writer: (setf lazy-array-refcount) (instance)
Package

petalisp.core.

Source

lazy-array.lisp.

Target Slot

refcount.

Reader: lazy-array-shape (instance)
Package

petalisp.core.

Source

lazy-array.lisp.

Target Slot

shape.

Function: lazy-array-size (lazy-array)
Package

petalisp.core.

Source

lazy-array.lisp.

Function: lazy-broadcast-arrays (&rest arrays)

Returns as many lazy arrays as there are supplied arrays, but broadcast such that all resulting arrays have the same shape. If there is no suitable broadcast shape for all supplied arrays, an error is signaled.

Examples:

(lazy-broadcast-arrays #(1 2 3) 5)
=> #<lazy-array t (~ 3)>
=> #<lazy-array (eql 5) (~ 3)>

(lazy-broadcast-arrays #(2 3 4) #2A((1 2 3) (4 5 6)))
=> #<lazy-array t (~ 2 ~ 3)>
=> #<lazy-array t (~ 2 ~ 3)>

Package

petalisp.api.

Source

lazy-broadcast.lisp.

Function: lazy-broadcast-list-of-arrays (list-of-arrays)

Returns a list of lazy arrays of the same length as the list of supplied arrays, but where each element is broadcast such that all resulting arrays have the same shape. If there is no suitable broadcast shape for all supplied arrays, an error is signaled.

Examples:

(lazy-broadcast-list-of-arrays (list #(1 2 3) 5))
=> (#<lazy-array t (~ 3)> #<lazy-array (eql 5) (~ 3)>)
=> (~ 3)

(lazy-broadcast-list-of-arrays (list #(2 3 4) #2A((1 2 3) (4 5 6)))) => (#<lazy-array t (~ 2 ~ 3)> #<lazy-array t (~ 2 ~ 3)>)
=> (~ 2 ~ 3)

Package

petalisp.api.

Source

lazy-broadcast.lisp.

Function: lazy-broadcast-to (array shape-designator)
Package

petalisp.api.

Source

lazy-broadcast.lisp.

Function: lazy-collapse (array)

Turns the supplied array into an array with the same rank and contents, but where all ranges start from zero and have a step size of one.

Example:

(lazy-collapse (lazy-reshape 42 (~ 1 100 3 ~ 1 100 8)))
=> #<lazy-array (eql 42) (~ 33 ~ 13)>

Package

petalisp.core.

Source

lazy-ref.lisp.

Function: lazy-drop-axes (array &rest axes)

Removes zero or more axes whose corresponding range has only a single element from a supplied array.

Examples:

(lazy-drop-axes (lazy-reshape 1 (~ 1 2 ~ 2 3)) 1)
=> #<lazy-array (eql 1) (~ 1 2)>

(compute (lazy-drop-axes (lazy-reshape 1 (~ 1 2 ~ 2 3)) 1))
=> #*1

(compute (lazy-drop-axes (lazy-reshape 1 (~ 1 2 ~ 2 3)) 0 1))
=> 1

(compute (lazy-drop-axes (lazy-reshape 1 (~ 1 2 ~ 2 5)) 0))
=> #*111

Package

petalisp.api.

Source

lazy-drop-axes.lisp.

Function: lazy-flatten (array)

Turns the supplied array into a rank one array, while preserving the lexicographic ordering of the elements.

Examples:

(compute (lazy-flatten #2A((1 2) (3 4))))
=> #(1 2 3 4)

(compute (lazy-flatten #3A(((1 2) (3 4)) ((5 6) (7 8)))))
=> #(1 2 3 4 5 6 7 8)

Package

petalisp.api.

Source

lazy-flatten.lisp.

Function: lazy-fuse (array &rest more-arrays)

Combine ARRAYS into a single strided array. It is an error if some of the supplied arrays overlap, or if there exists no suitable strided array to represent the fusion.

Examples:

(compute (lazy-fuse (lazy-reshape 1 (~ 0 2)) (lazy-reshape 0 (~ 2 4)))) => #*1100

(compute (lazy-fuse (lazy-reshape 1 (~ 0 7 2)) (lazy-reshape 0 (~ 1 7 2)))) => #*1010101

Package

petalisp.core.

Source

lazy-fuse.lisp.

Function: lazy-map (function inputs)
Package

petalisp.core.

Source

lazy-map.lisp.

Function: lazy-multiple-value (function n-values &rest arrays)
Package

petalisp.api.

Source

lazy-multiple-value.lisp.

Function: lazy-multiple-value-map (function n-outputs inputs)
Package

petalisp.core.

Source

lazy-map.lisp.

Function: lazy-overwrite (array &rest more-arrays)

Combines ARRAYS into a single strided array. When some of the supplied arguments overlap partially, the value of the rightmost object is used.

Example:

(compute (lazy-overwrite (lazy-reshape 1 (~ 0 4)) (lazy-reshape 0 (~ 2 4)))) => #*1100

Package

petalisp.api.

Source

lazy-overwrite.lisp.

Function: lazy-reduce (function &rest arrays)

Returns one or more lazy arrays whose contents are the multiple value reduction with the supplied function, when applied pairwise to the elements of the first axis of each of the supplied arrays. If the supplied arrays don’t agree in shape, they are first broadcast with the function BROADCAST-ARRAYS.

The supplied function F must accept 2k arguments and return k values, where k is the number of supplied arrays. All supplied arrays must have the same shape S, which is the cartesian product of some ranges, i.e., S = r_1 x ... r_n, where each range r_k is a set of integers, e.g., {0, 1, ..., m}. Then β returns k arrays of shape s = r_2 x ... x r_n, whose elements are a combination of the elements along the first axis of each array according to the following rules:

1. If the given arrays are empty, return k empty arrays.

2. If the first axis of each given array contains exactly one element, drop that axis and return arrays with the same content, but with shape s.

3. If the first axis of each given array contains more than one element, partition the indices of this axis into a lower half l and an upper half u. Then split each given array into a part with shape l x s and a part with shape u x s. Recursively process the lower and the upper halves of each array independently to obtain 2k new arrays of shape s. Finally, combine these 2k arrays element-wise with f to obtain k new arrays with all values returned by f. Return these arrays.

Examples:

(compute (lazy-reduce #’+ #(1 2 3 4)))
=> 10

(compute (lazy-reduce #’+ #2A((1 2) (3 4))))
=> #(4 6)

(let ((a #(5 2 7 1 9)))
(multiple-value-bind (max index)
(lazy-reduce
(lambda (lv li rv ri)
(if (> lv rv)
(values lv li)
(values rv ri)))
a (lazy-array-indices a 0))
(compute max index)))
=> 9
=> 4

Package

petalisp.api.

Source

lazy-reduce.lisp.

Function: lazy-ref (input shape transformation)
Package

petalisp.core.

Source

lazy-ref.lisp.

Function: lazy-reshape (array &rest modifiers)

Returns a lazy array with the contents of ARRAY, but after applying the supplied MODIFIERS in left-to-right order. A modifier must either be a shape, or a transformation.

A shape can denote one of three different modifications, depending on whether it is larger than the array, smaller than the array, or has the same number of elements as the array. If the shape is larger than the array, it denotes a broadcasting operation. If the shape is smaller than the array, it denotes a selection of a sub-array. If the shape has the same number of elements, it denotes a lexicographic reordering operation.

In case the modifier is a transformation, the new array is obtained by taking each index and corresponding value of the original array and applying the transformation to the index while retaining the value.

Examples:

(compute (lazy-reshape 4 (~ 0 4)))
=> #(4 4 4 4)

(compute (lazy-reshape #(1 2 3 4) (~ 1 2)))
=> #(2)

(compute (lazy-reshape (lazy-shape-indices (~ 9)) (~ 3 ~ 3)))
=> #2A((0 1 2) (3 4 5) (6 7 8))

(compute (lazy-reshape #2A((1 2) (3 4)) (transform i j to j i)))
=> #2A((1 3) (2 4))

(compute (lazy-reshape #(1 2 3 4) (~ 1 3) (~ 0 2 ~ 0 2)))
=> #2A((2 3) (2 3))

Package

petalisp.core.

Source

lazy-reshape.lisp.

Function: lazy-shape-indices (shape &optional axis)

Returns a lazy array of integers of the shape of SHAPE, where each array element at index (i_0 ... i_N) has the value i_AXIS. If AXIS is not supplied, it defaults to zero.

Examples:

(compute (lazy-shape-indices (~ 9)))
=> #(0 1 2 3 4 5 6 7 8)

(compute (lazy-shape-indices (~ 0 4 2 ~ 1 5 2) 0))
=> #2A((0 0) (2 2))

(compute (lazy-shape-indices (~ 0 4 2 ~ 1 5 2) 1))
=> #2A((1 3) (1 3))

Package

petalisp.api.

Source

lazy-shape-indices.lisp.

Function: lazy-slice (array index &optional axis)

For a supplied ARRAY with rank n, returns an array of rank n-1 that contains all entries that have the supplied INDEX in the position specified by AXIS.

Examples:

(compute (lazy-slice #(1 2 3 4) 2))
=> 3

(compute (lazy-slice #2A((1 2) (3 4)) 0))
=> #(1 2)

(compute (lazy-slice #2A((1 2) (3 4)) 1))
=> #(3 4)

(compute (lazy-slice #2A((1 2) (3 4)) 0 1))
=> #(1 3)

(compute (lazy-slice #2A((1 2) (3 4)) 1 1))
=> #(2 4)

Package

petalisp.api.

Source

lazy-slice.lisp.

Function: lazy-slices (array range &optional axis)

Selects those elements from ARRAY whose indices at the specified AXIS are contained in the supplied RANGE.

Examples:

(compute (lazy-slices #(1 2 3 4) (range 0 2 2)))
=> #(1)

(compute (lazy-slices #2A((1 0 0) (0 1 0) (0 0 1)) (range 2))) => #2A((1 0 0) (0 1 0))

(compute (lazy-slices #2A((1 0 0) (0 1 0) (0 0 1)) (range 0 3 2))) => #2A((1 0 0) (0 0 1))

(compute (lazy-slices #2A((1 0 0) (0 1 0) (0 0 1)) (range 0 3 2) 1)) => #2A((1 0) (0 0) (0 1))

Package

petalisp.api.

Source

lazy-slices.lisp.

Function: lazy-stack (axis array &rest more-arrays)

Stacks multiple array next to each other along the specified AXIS such that along this axis, the leftmost array will have the lowest indices, and the rightmost array will have the highest indices.

Examples:

(compute (lazy-stack 0 #(1) #(2) #(3)))
=> #(1 2 3)

(compute (lazy-stack 0 #(1 2) #(3 4) #(5 6)))
=> #(1 2 3 4 5 6)

(compute (lazy-stack 0 #2A((1 2) (3 4)) #2A((5 6) (7 8))))
=> #2A((1 2) (3 4) (5 6) (7 8))

(compute (lazy-stack 1 #2A((1 2) (3 4)) #2A((5 6) (7 8))))
=> #2A((1 2 5 6) (3 4 7 8))

Package

petalisp.api.

Source

lazy-stack.lisp.

Function: lazy-unknowns (graph-roots)
Package

petalisp.core.

Source

lazy-array.lisp.

Function: leaf-buffer-p (buffer)
Package

petalisp.ir.

Source

ir.lisp.

Reader: load-instruction-buffer (instance)
Writer: (setf load-instruction-buffer) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Target Slot

buffer.

Function: load-instruction-p (object)
Package

petalisp.ir.

Source

ir.lisp.

Function: load-instruction-transformation (instance)
Package

petalisp.ir.

Source

ir.lisp.

Function: (setf load-instruction-transformation) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Function: make-buffer (&key shape ntype depth writers readers task storage number)
Package

petalisp.ir.

Source

ir.lisp.

Function: make-buffer-like-array (buffer)
Package

petalisp.ir.

Source

ir.lisp.

Function: make-cgraph (&key table)
Package

petalisp.utilities.

Source

graph-coloring.lisp.

Function: make-delayed-array (object)
Package

petalisp.core.

Source

lazy-array.lisp.

Function: make-ir-backend (&key mode)
Package

petalisp.ir.

Source

ir-backend.lisp.

Function: make-kernel (&key iteration-space sources targets instruction-vector task data number)
Package

petalisp.ir.

Source

ir.lisp.

Function: make-network (&rest outputs)

Creates a network with the supplied inputs and outputs.

An error is signaled of any of the inputs is not of type NETWORK-INPUT, or if additional network inputs are reachable from the network outputs.

Package

petalisp.api.

Source

network.lisp.

Function: make-program (&key initial-task final-task leaf-alist root-buffers task-vector number-of-buffers number-of-kernels)
Package

petalisp.ir.

Source

ir.lisp.

Function: make-queue ()
Package

petalisp.utilities.

Source

queue.lisp.

Function: make-rank-zero-array (value)
Package

petalisp.core.

Source

lazy-array.lisp.

Function: make-reference-backend ()
Package

petalisp.core.

Source

reference-backend.lisp.

Function: make-shape (ranges)
Package

petalisp.core.

Source

shape.lisp.

Function: make-shape-table ()
Package

petalisp.core.

Source

shape.lisp.

Function: make-stencil (load-instructions)
Package

petalisp.ir.

Source

ir.lisp.

Function: make-task (&key program predecessors successors kernels defined-buffers number)
Package

petalisp.ir.

Source

ir.lisp.

Function: make-testing-backend ()
Package

petalisp.test-suite.

Source

testing-backend.lisp.

Function: make-transformation (&key input-rank output-rank input-mask output-mask scalings offsets)

Returns a transformation according to the supplied keyword arguments. Valid keyword arguments are:

:INPUT-RANK

The length or rank of any valid transformation input. A non-negative integer.

:OUTPUT-RANK

The length or rank of any transformation output. A non-negative integer.

:INPUT-MASK

A sequence with as many elements as the input rank of the transformation. Each element must either be an integer, in which case only this integer may occur in the corresponding input position, or NIL, in which case any integer may occur in the corresponding input position.

:OUTPUT-MASK

A sequence with as many elements as the output rank of the transformation. Every element must either be an integer, in which case this integer denotes the input entry that is to be scaled, shifted and sent to the current position’s output, or NIL, in which case only the corresponding offset value is sent to the current output. This way, the output mask can encode both permutations of the input, as well as insertion and removal of axes. If this keyword argument is not supplied, it defaults to a sequence with up to input rank ascending integers, starting from zero, and followed by entries of NIL in case the output rank is larger than the input rank.

:SCALINGS

A sequence with as many elements as the output rank of the transformation. Each element must be a rational number. Every transformation output is scaled with its corresponding entry in this sequence. If this keyword argument is not supplied, it defaults to a sequence of ones.

:OFFSETS

A sequence with as many elements as the output rank of the transformation. Each element must be a rational number that is added to the corresponding output value after permutation and scaling has taken place. If this keyword argument is not supplied, it defaults to a sequence of zeros.

Examples:

(make-transformation input-rank 2)
=> (transform a b to a b)

(make-transformation input-rank 2 output-rank 1)
=> (transform a b to a)

(make-transformation input-mask ’(2 nil 3))
=> (transform 2 b 3 to 2 b 3)

(make-transformation output-mask #(1 0 nil))
=> (transform a b c to b a 0)

(make-transformation offsets #(1 2 3) scalings #(4 5 6))
=> (transform a b c to (1+ (* 4 a)) (+ (* 5 b) 2) (+ (* 6 c) 3))

Package

petalisp.core.

Source

transformation-constructors.lisp.

Function: make-unknown (&key shape element-type)
Package

petalisp.core.

Source

lazy-array.lisp.

Function: make-weak-set (&key test max-size min-size)
Package

petalisp.utilities.

Source

weak-set.lisp.

Function: make-wsdeque ()
Package

petalisp.utilities.

Source

wsdeque.lisp.

Function: make-xmas-backend (&key threads)
Package

petalisp.xmas-backend.

Source

xmas-backend.lisp.

Function: map-buffer-inputs (function buffer)
Package

petalisp.ir.

Source

ir.lisp.

Function: map-buffer-load-instructions (function buffer)
Package

petalisp.ir.

Source

ir.lisp.

Function: map-buffer-outputs (function buffer)
Package

petalisp.ir.

Source

ir.lisp.

Function: map-buffer-store-instructions (function buffer)
Package

petalisp.ir.

Source

ir.lisp.

Function: map-buffers (function root-buffers)
Package

petalisp.ir.

Source

ir.lisp.

Function: map-buffers-and-kernels (buffer-fn kernel-fn root-buffers)
Package

petalisp.ir.

Source

ir.lisp.

Function: map-instruction-inputs (function instruction)
Package

petalisp.ir.

Source

ir.lisp.

Function: map-kernel-inputs (function kernel)
Package

petalisp.ir.

Source

ir.lisp.

Function: map-kernel-instructions (function kernel)
Package

petalisp.ir.

Source

ir.lisp.

Function: map-kernel-load-instructions (function kernel)
Package

petalisp.ir.

Source

ir.lisp.

Function: map-kernel-outputs (function kernel)
Package

petalisp.ir.

Source

ir.lisp.

Function: map-kernel-stencils (function kernel)
Package

petalisp.ir.

Source

ir.lisp.

Function: map-kernel-store-instructions (function kernel)
Package

petalisp.ir.

Source

ir.lisp.

Function: map-kernels (function root-buffers)
Package

petalisp.ir.

Source

ir.lisp.

Function: map-program-buffer-groups (function program)
Package

petalisp.ir.

Source

ir.lisp.

Function: map-program-buffers (function program)
Package

petalisp.ir.

Source

ir.lisp.

Function: map-program-kernels (function program)
Package

petalisp.ir.

Source

ir.lisp.

Function: map-program-tasks (function program)
Package

petalisp.ir.

Source

ir.lisp.

Function: map-range (function range)

Takes a function and a range and applies the function to all integers of that range, in ascending order.

Example:

(let ((l ’nil))
(map-range (lambda (i) (push i l)) (range 1 9 2))
(nreverse l))
=> (1 3 5 7)

Package

petalisp.core.

Source

range.lisp.

Function: map-shape (function shape)

Takes a function and a shape and applies the function to all integer tuples of that range, in ascending order.

Example:

(let ((l ’nil))
(map-shape (lambda (i) (push i l)) (~ 1 3 ~ 3 5))
(nreverse l))
=> ((1 3) (2 3) (1 4) (2 4))

Package

petalisp.core.

Source

shape.lisp.

Function: map-stencil-load-instructions (function stencil)
Package

petalisp.ir.

Source

ir.lisp.

Function: map-task-defined-buffers (function task)
Package

petalisp.ir.

Source

ir.lisp.

Function: map-task-kernels (function task)
Package

petalisp.ir.

Source

ir.lisp.

Function: map-task-predecessors (function task)
Package

petalisp.ir.

Source

ir.lisp.

Function: map-task-successors (function task)
Package

petalisp.ir.

Source

ir.lisp.

Function: map-weak-set (function weak-set)
Package

petalisp.utilities.

Source

weak-set.lisp.

Function: move-axis-to-front (array axis)
Package

petalisp.core.

Source

differentiator.lisp.

Function: non-empty-range-p (object)
Package

petalisp.core.

Source

range.lisp.

Function: normalizing-transformation (shape)
Package

petalisp.core.

Source

transformation-constructors.lisp.

Function: number-of-cpus ()
Package

petalisp.utilities.

Source

number-of-cpus.lisp.

Function: partition-chunks (chunks &key buffer-chunk split-priority split-min-priority split-max-redundancy)

Attempt to split the supplied sequence of chunks based on the supplied keyword arguments.

BUFFER-CHUNK - A function for looking up the root chunk of each buffer that is encountered during partitioning.

SPLIT-PRIORITY - A function that takes a chunk and returns an unsigned integer that is the priority when considering whether to split the chunk. Chunks with higher priority are split first, and chunks whose priority is below a certain minimum priority are not split at all.

SPLIT-MIN-PRIORITY - An unsigned integer that is the priority a chunk must exceed to be considered for splitting.

SPLIT-MAX-REDUNDANCY - A real number that is the maximum permissible ratio of ghost points to interior points for a split.

Package

petalisp.ir.

Source

partitioning.lisp.

Function: prime-factors (integer)

Return the list of prime factors of INTEGER in ascending order.

Package

petalisp.utilities.

Source

prime-factors.lisp.

Function: primep (n)
Package

petalisp.utilities.

Source

prime-factors.lisp.

Function: program-buffer (program buffer-number)
Package

petalisp.ir.

Source

ir.lisp.

Reader: program-final-task (instance)
Writer: (setf program-final-task) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Target Slot

final-task.

Function: program-from-lazy-arrays (lazy-arrays &key kernel-size-threshold)
Package

petalisp.ir.

Source

ir-conversion.lisp.

Reader: program-initial-task (instance)
Writer: (setf program-initial-task) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Target Slot

initial-task.

Function: program-kernel (program kernel-number)
Package

petalisp.ir.

Source

ir.lisp.

Reader: program-leaf-alist (instance)
Writer: (setf program-leaf-alist) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Target Slot

leaf-alist.

Reader: program-number-of-buffers (instance)
Writer: (setf program-number-of-buffers) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Target Slot

number-of-buffers.

Reader: program-number-of-kernels (instance)
Writer: (setf program-number-of-kernels) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Target Slot

number-of-kernels.

Function: program-number-of-tasks (program)
Package

petalisp.ir.

Source

ir.lisp.

Reader: program-root-buffers (instance)
Writer: (setf program-root-buffers) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Target Slot

root-buffers.

Reader: program-task-vector (instance)
Writer: (setf program-task-vector) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Target Slot

task-vector.

Function: programp (object)
Package

petalisp.ir.

Source

ir.lisp.

Function: queue-dequeue (queue)

Removes and returns the element at the front of QUEUE, or return NIL if the queue was empty. Return a second value that is a boolean indicating whether an object was taken from the queue or not.

Package

petalisp.utilities.

Source

queue.lisp.

Function: queue-enqueue (queue object)

Inserts OBJECT at the back of QUEUE.

Package

petalisp.utilities.

Source

queue.lisp.

Function: queuep (object)
Package

petalisp.utilities.

Source

queue.lisp.

Function: range (first &optional end step)

Returns a new, normalized range from the supplied parameters.

This function can be invoked with one, two or three integers. In the case of a single integer, it constructs the range from zero with step size one up to but excluding that integer. In the case of two integers, it creates a range from the first integer with step size one up to but excluding the second integer. In the case of three arguments, it creates a range from the first integer up to but excluding the second integer, using the third integer as the step size. If the first, inclusive integer and final, exclusive integer are not congruent modulo the step size, the latter one is moved towards the former until they are.

Examples:

(range 5)
=> #<range(0 ... 4)>

(range 5 9)
=> #<range(5 6 7 8)>

(range 5 13 2)
=> #<range(5 7 9 11)>

(range 5 14 2)
=> #<range(5 7 ... 13)>

(range 7 -3 3)
=> #<empty-range>

Package

petalisp.core.

Source

range.lisp.

Function: range-contains (range integer)

Check whether the supplied range contains a particular integer.

Examples:

(range-contains (range 1 10) 5)
=> t

(range-contains (range 1 10) -5)
=> nil

(range-contains (range 1 10 3) 4)
=> t

Package

petalisp.core.

Source

range.lisp.

Function: range-difference-list (range1 range2)

Compute the difference of two ranges R1 and R2. Returns a list of disjoint subranges of R1 that describe exactly those integers appearing in R1 but not in R2.

Package

petalisp.core.

Source

range.lisp.

Function: range-end (range)
Package

petalisp.core.

Source

range.lisp.

Function: range-equal (range1 range2)

Check whether two supplied ranges describe the same set of integers.

Examples:

(range-equal (range 1) (range 2))
=> nil

(range-equal (range 2) (range 2))
=> t

(range-equal (range 0 8 2) (range 0 9 2))
=> nil

(range-equal (range 0 8 3) (range 0 9 3))
=> t

Package

petalisp.core.

Source

range.lisp.

Function: range-intersection (range1 range2)

Returns the range containing exactly those elements that occur in both supplied ranges..

Examples:

(range-intersection (range 1 10) (range 2 20))
=> #<range(2 ... 9)>

(range-intersection (range 3 14 2) (range 1 14 3))
=> #<range(7 13)>

Package

petalisp.core.

Source

range.lisp.

Function: range-intersectionp (range1 range2)

Check whether two supplied ranges have at least one common element.

Examples:

(range-intersectionp (range 1 10) (range 2 20))
=> t

(range-intersectionp (range 0 7 2) (range 1 8 2))
=> nil

Package

petalisp.core.

Source

range.lisp.

Function: range-last (range)
Package

petalisp.core.

Source

range.lisp.

Reader: range-size (instance)
Package

petalisp.core.

Source

range.lisp.

Target Slot

size.

Reader: range-start (instance)
Package

petalisp.core.

Source

range.lisp.

Target Slot

start.

Reader: range-step (instance)
Package

petalisp.core.

Source

range.lisp.

Target Slot

step.

Function: rangep (object)

Checks whether a supplied object is a range.

Examples:

(rangep 42)
=> nil

(rangep (range 1 3 2))
=> t

Package

petalisp.core.

Source

range.lisp.

Function: remove-shape-table-entry (shape-table shape)
Package

petalisp.core.

Source

shape.lisp.

Function: reuse-optimizing-transformation (reuse-potential)

Takes a vector of single-precision floating-point numbers that describes the potential for memory reuse along each axis, returns a transformation that sorts all axes by increasing reuse potential.

Package

petalisp.ir.

Source

ir.lisp.

Function: root-buffer-p (buffer)
Package

petalisp.ir.

Source

ir.lisp.

Function: run-petalisp-test-suite ()
Package

petalisp.test-suite.

Source

run-petalisp-test-suite.lisp.

Function: run-tests (&rest tests)
Package

petalisp.test-suite.

Source

run-petalisp-test-suite.lisp.

Function: shape-contains (shape index)

Check whether the supplied shape contains a particular integer tuple.

Examples:

(shape-contains (~ 1 9) (list 4))
=> t

(shape-contains (~ 1 2 9) (list 4))
=> nil

Package

petalisp.core.

Source

shape.lisp.

Function: shape-difference-list (shape1 shape2)

Computes the difference of two shapes S1 and S2. Returns a list of disjoint subshapes of S1 that describe exactly those integer tuples appearing in S1 but not in S2.

Examples:

(shape-difference-list (~ 1 11) (~ 2 10))
=> ((~ 1 2) (~ 10 11))

(shape-difference-list (~ 1 11) (~ 4 8))
=> ((~ 1 4) (~ 8 11))

(shape-difference-list (~ 1 11) (~ 2 9 2))
=> ((~ 1 10 2) (~ 10 11))

(shape-difference-list (~ 1 11) (~ 2 21))
=> ((~ 1 2))

(shape-difference-list (~ 1 21 2) (~ 1 21 3))
=> ((~ 3 16 6) (~ 5 18 6))

Package

petalisp.core.

Source

shape.lisp.

Function: shape-dimensions (shape)

Return the array dimensions corresponding to a shape. Signal an error if any of the ranges of the shape have a nonzero start or a step size other than one.

Examples:

(shape-dimensions (~))
=> nil

(shape-dimensions (~ 0 9))
=> (9)

(shape-dimensions (~ 1 9))
>> simple-error

(shape-dimensions (~ 0 2 9))
=> (1)

(shape-dimensions (~ 0 4 ~ 0 5 ~ 0 6))
=> (4 5 6)

Package

petalisp.core.

Source

shape.lisp.

Function: shape-interior (shape &optional width)
Package

petalisp.api.

Source

shape-interior.lisp.

Function: shape-intersection (shape1 shape2)

Returns the shape containing exactly those integer tuples that occur in both supplied shapes. Returns NIL if there are no such elements.

Examples:

(shape-intersection (~ 1 11 ~ 3 14 2) (~ 1 6 ~ 1 14 3))
=> (~ 1 6 ~ 7 14 6)

(shape-intersection (~ 1 6) (~ 6 11))
=> (~ 0)

Package

petalisp.core.

Source

shape.lisp.

Function: shape-intersectionp (shape1 shape2)

Check whether two supplied shapes have at least one common element.

Examples:

(shape-intersectionp (~ 1 6) (~ 6 10))
=> nil

(shape-intersectionp (~ 1 5) (~ 6 10))
=> nil

Package

petalisp.core.

Source

shape.lisp.

Function: shape-range (shape axis)
Package

petalisp.core.

Source

shape.lisp.

Reader: shape-ranges (instance)

Returns a list of all ranges contained in the supplied shape.

Examples:

(shape-ranges (~))
=> nil

(shape-ranges (~ 1 ~ 2 ~ 3))
=> (#<range(0)> #<range(0 1)> #<range(0 1 2)>)

(shape-ranges (~ 0 9 ~ 0 9))
=> (#<range(0 ... 8)> #<range(0 ... 8)>)

Package

petalisp.core.

Source

shape.lisp.

Target Slot

ranges.

Reader: shape-rank (instance)

Returns the rank of the supplied shape, i.e., the number of ranges it contains.

Examples:

(shape-rank (~))
=> 0

(shape-rank (~ 1 ~ 2 ~ 3))
=> 3

(shape-rank (~ 0 9 ~ 0 9))
=> 2

Package

petalisp.core.

Source

shape.lisp.

Target Slot

rank.

Reader: shape-size (instance)

Returns that number of integer tuples denoted by the supplied shape.

Examples:

(shape-size (~))
=> 1

(shape-size (~ 2 9))
=> 7

(shape-size (~ 1 9 ~ 1 8))
=> 56

Package

petalisp.core.

Source

shape.lisp.

Target Slot

size.

Function: shape-table-p (object)
Package

petalisp.core.

Source

shape.lisp.

Function: shape-table-value (shape-table shape &optional default)
Package

petalisp.core.

Source

shape.lisp.

Function: (setf shape-table-value) (shape-table shape &optional default)
Package

petalisp.core.

Source

shape.lisp.

Function: shape< (shape1 shape2)
Package

petalisp.core.

Source

shape.lisp.

Function: shape= (shape1 shape2)

Checks whether two supplied shapes denote the same set of integer tuples.

Examples:

(shape= (~) (~))
=> t

(shape= (~ 42) (~ 42))
=> t

(shape= (~ 1 42) (~ 1 42))
=> t

(shape= (~ 1 42) (~ 2 42))
=> nil

Package

petalisp.core.

Source

shape.lisp.

Function: shapep (object)

Checks whether a supplied object is a shape.

Examples:

(shapep 42)
=> nil

(shapep (~ 1 ~ 2 ~ 3 4))
=> t

Package

petalisp.core.

Source

shape.lisp.

Function: shrink-shape (shape)

This function expects a single shape with one or more ranges R1 to Rn. It returns a shape with the ranges R2 to R1, and, as a second value, the range R1 that has been peeled off.

Examples:

(shrink-shape (~ 1 10))
=> (~)
=> #<range(1 ... 9)>

(shrink-shape (~ 1 10 ~ 0 2))
=> (~ 2)
=> #<range(1 ... 9)>

Package

petalisp.core.

Source

shape.lisp.

Function: size-one-range-p (range)

Checks whether the supplied range has a size of one.

Examples:

(size-one-range-p (range 5))
=> nil

(size-one-range-p (range 5 7 2))
=> t

(size-one-range-p (range 5 7 3))
=> t

Package

petalisp.core.

Source

range.lisp.

Reader: split-axis (instance)
Package

petalisp.ir.

Source

partitioning.lisp.

Target Slot

axis.

Reader: split-left-child (instance)
Package

petalisp.ir.

Source

partitioning.lisp.

Target Slot

left-child.

Reader: split-parent (instance)
Package

petalisp.ir.

Source

partitioning.lisp.

Target Slot

parent.

Function: split-position (split)
Package

petalisp.ir.

Source

partitioning.lisp.

Function: split-range (range &optional position)

Splits the supplied range R into a lower and an upper half and returns them as multiple values. In case R has an odd number of elements, the lower half will have one more element than the upper half.

The optional POSITION argument is a real number that can be used to prescribe the point at which to split the range.

Examples:

(split-range (range 0))
=> #<empty-range>
=> #<empty-range>

(split-range (range 1))
=> #<range(0)>
=> #<empty-range>

(split-range (range 1 10))
=> #<range(1 ... 5)>
=> #<range(6 7 8 9)>

(split-range (range 1 10) 3)
=> #<range(1 2)>
=> #<range(3 ... 9)>

(split-range (range 1 10) 1)
=> #<empty-range>
=> #<range(1 ... 9)>

(split-range (range 1 10) 10)
=> #<range(1 ... 9)>
=> #<empty-range>

(split-range (range 1 9))
=> #<range(1 2 3 4)>
=> #<range(5 6 7 8)>

(split-range (range 2 9 2))
=> #<range(2 4)>
=> #<range(6 8)>

(split-range (range 2 9 2) 3)
=> #<range(2)>
=> #<range(4 6 8)>

Package

petalisp.core.

Source

range.lisp.

Reader: split-right-child (instance)
Package

petalisp.ir.

Source

partitioning.lisp.

Target Slot

right-child.

Function: split-shape (shape axis &optional position)

Split the supplied SHAPE at AXIS. The optional POSITION argument can be supplied to describe the position at which to split. If no POSITION argument is supplied, split into two halves of roughly equal size. Returns two values, which are two shapes resulting from the split.

Examples:

(split-shape (~ 10 ~ 10) 0)
=> (~ 5 ~ 10)
=> (~ 5 10 ~ 10)

(split-shape (~ 10 ~ 10) 1)
=> (~ 10 ~ 5)
=> (~ 10 ~ 5 10)

(split-shape (~ 10 ~ 10) 0 3)
=> (~ 3 ~ 10)
=> (~ 3 10 ~ 10)

(split-shape (~ 2 9 2 ~ 2 9 2) 0 3)
=> (~ 2 3 ~ 2 9 2)
=> (~ 4 9 2 ~ 2 9 2)

(split-shape (~ 2 9 2 ~ 2 9 2) 1 3)
=> (~ 2 9 2 ~ 2 3)
=> (~ 2 9 2 ~ 4 9 2)

Package

petalisp.core.

Source

shape.lisp.

Function: splitp (object)
Package

petalisp.ir.

Source

partitioning.lisp.

Function: stencil-buffer (stencil)
Package

petalisp.ir.

Source

ir.lisp.

Reader: stencil-center (instance)
Writer: (setf stencil-center) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Target Slot

center.

Function: stencil-from-load-instruction (load-instruction)
Package

petalisp.ir.

Source

ir.lisp.

Function: stencil-input-rank (stencil)
Package

petalisp.ir.

Source

ir.lisp.

Reader: stencil-load-instructions (instance)
Writer: (setf stencil-load-instructions) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Target Slot

load-instructions.

Function: stencil-output-mask (stencil)
Package

petalisp.ir.

Source

ir.lisp.

Function: stencil-output-rank (stencil)
Package

petalisp.ir.

Source

ir.lisp.

Function: stencil-scalings (stencil)
Package

petalisp.ir.

Source

ir.lisp.

Function: stencilp (object)
Package

petalisp.ir.

Source

ir.lisp.

Reader: store-instruction-buffer (instance)
Writer: (setf store-instruction-buffer) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Target Slot

buffer.

Function: store-instruction-p (object)
Package

petalisp.ir.

Source

ir.lisp.

Function: store-instruction-transformation (instance)
Package

petalisp.ir.

Source

ir.lisp.

Function: (setf store-instruction-transformation) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Function: subdivide-arrays (arrays)

Invoke SUBDIVIDE-SHAPES on the shapes of the supplied ARRAYS.

Examples:

(subdivide-arrays (list))
=> nil

(subdivide-arrays (list #()))
=> (((~ 0) . 1))

(subdivide-arrays (list #() #()))
=> (((~ 0) . 1) ((~ 0) . 2))

(subdivide-arrays (list #(1 2 3 4) #(1 2)))
=> (((~ 2) . 3) ((~ 2 4) . 1))

Package

petalisp.core.

Source

lazy-array.lisp.

Function: subdivide-shapes (shapes)

Returns a list of (shape . bitmask) conses. Each shape is a proper subshape of one or more of the supplied shapes and their fusion covers all supplied shapes. The bitmask indicates which of the supplied shapes are supersets of the corresponding resulting shape.

Examples:

(subdivide-shapes (list (~ 1 3 ~ 1 3) (~ 1 2 ~ 1 2)))
=> (((~ 1 2 ~ 1 2) . 3) ((~ 1 2 ~ 2 3) . 1) ((~ 2 3 ~ 1 3) . 1))

(subdivide-shapes (list (~ 1 10) (~ 2 20)))
=> (((~ 2 10) . 3) ((~ 1 2) . 1) ((~ 10 20) . 2))

Package

petalisp.core.

Source

shape.lisp.

Function: subrangep (range1 range2)
Package

petalisp.core.

Source

range.lisp.

Function: subshapep (shape1 shape2)

Checks for two shapes whether the former is fully contained in the latter.

Examples:

(subshapep (~) (~))
=> t

(subshapep (~ 0 9) (~ 0 9))
=> t

(subshapep (~ 0 3) (~ 1 9))
=> nil

(subshapep (~ 0 3 ~ 0 3) (~ 0 9 ~ 0 9))
=> t

Package

petalisp.core.

Source

shape.lisp.

Function: substitute-lazy-array (lazy-array)
Package

petalisp.core.

Source

substitute-lazy-arrays.lisp.

Function: substitute-lazy-arrays (roots new-lazy-arrays old-lazy-arrays)
Package

petalisp.core.

Source

substitute-lazy-arrays.lisp.

Reader: task-number (instance)
Writer: (setf task-number) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Target Slot

number.

Reader: task-program (instance)
Writer: (setf task-program) (instance)
Package

petalisp.ir.

Source

ir.lisp.

Target Slot

program.

Function: taskp (object)
Package

petalisp.ir.

Source

ir.lisp.

Function: topological-sort (start-nodes map-node-successors map-node-predecessors)

Returns a list of all nodes in supplied DAG, in topological ordering. The graph is specified by a list of start nodes, a function for applying a supplied function to each successor of a supplied node, and a function for applying a supplied function to each predecessor of a supplied node.

Package

petalisp.utilities.

Source

topological-sort.lisp.

Function: transform-lazy-array (lazy-array transformation)
Package

petalisp.core.

Source

lazy-ref.lisp.

Reader: transformation-input-mask (instance)
Package

petalisp.core.

Source

transformation.lisp.

Target Slot

input-mask.

Reader: transformation-input-rank (instance)
Package

petalisp.core.

Source

transformation.lisp.

Target Slot

input-rank.

Function: transformation-invertiblep (transformation)

Check whether a supplied transformation is invertible.

Examples:

(transformation-invertiblep (transform i j to j i)) => t

(transformation-invertiblep (transform i j to i)) => nil

Package

petalisp.core.

Source

transformation.lisp.

Reader: transformation-offsets (instance)
Package

petalisp.core.

Source

transformation.lisp.

Target Slot

offsets.

Reader: transformation-output-mask (instance)
Package

petalisp.core.

Source

transformation.lisp.

Target Slot

output-mask.

Reader: transformation-output-rank (instance)
Package

petalisp.core.

Source

transformation.lisp.

Target Slot

output-rank.

Reader: transformation-scalings (instance)
Package

petalisp.core.

Source

transformation.lisp.

Target Slot

scalings.

Function: transformationp (object)
Package

petalisp.core.

Source

transformation.lisp.

Function: translate-blueprint (blueprint)
Package

petalisp.ir.

Source

kernel-compiler.lisp.

Function: value-array (object)
Package

petalisp.core.

Source

lazy-array.lisp.

Function: vectorize (function &optional arity)

Turns the supplied function into a lazy, vector-valued Petalisp function. The desired number of return values can be supplied as an optional second argument.

Examples:

(compute (funcall (vectorize #’+) #(1 2 3 4) 5))
=> #(6 7 8 9)

(let ((fn (vectorize #’floor 2)))
(multiple-value-bind (quot rem)
(funcall fn #(1 2 3 4) #(4 3 2 1))
(compute quot rem)))
=> #(0 0 1 4)
=> #(1 2 1 0)

Package

petalisp.api.

Source

vectorize.lisp.

Function: vicinity-left-neighbors (vicinity axis)
Package

petalisp.ir.

Source

partitioning.lisp.

Function: vicinity-right-neighbors (vicinity axis)
Package

petalisp.ir.

Source

partitioning.lisp.

Function: vicinityp (object)
Package

petalisp.ir.

Source

partitioning.lisp.

Function: wait (&rest requests)

Blocks until the work designated by some COMPUTE-ASYNCHRONOUSLY operations has been completed. Each argument must be one of the opaque objects returned by COMPUTE-ASYNCHRONOUSLY.

Package

petalisp.core.

Source

backend.lisp.

Function: weak-set-add (weak-set item)
Package

petalisp.utilities.

Source

weak-set.lisp.

Function: weak-set-p (object)
Package

petalisp.utilities.

Source

weak-set.lisp.

Function: weak-set-size (weak-set)
Package

petalisp.utilities.

Source

weak-set.lisp.

Function: wsdeque-pop (wsdeque)

Remove the VALUE at the bottom of the WSDEQUE. Returns two values: The object that has been removed and T, or NIL and NIL.

This operation must only be carried out by the thread that owns the WSDEQUE.

Package

petalisp.utilities.

Source

wsdeque.lisp.

Function: wsdeque-push (wsdeque value)

Insert VALUE at the bottom of the WSDEQUE. Returns that value.

This operation must only be carried out by the thread that owns the WSDEQUE.

Package

petalisp.utilities.

Source

wsdeque.lisp.

Function: wsdeque-steal (wsdeque)

Remove the VALUE at the top of the WSDEQUE. Returns two values: The object that has been removed and T, or NIL and NIL.

This operation is thread safe.

Package

petalisp.utilities.

Source

wsdeque.lisp.

Function: wsdequep (object)
Package

petalisp.utilities.

Source

wsdeque.lisp.

Function: ~ (&rest args)

The functions ~, ~l, ~s and ~r can be used to construct new shapes from some given range designators, from lists of ranges, from shapes, or from a single range, respectively. Each of these patterns can be used repeatedly in a single call.

Examples:

(~)
=> (~)

(~ 8)
=> (~ 8)

(~ 1 10)
=> (~ 1 10)

(~ 0 10 2 ~ 0 10 2)
=> (~ 0 9 2 ~ 0 9 2)

(~ 5 ~s (~ 1 4 2 ~ 4 10 5) ~ 5)
=> (~ 5 ~ 1 4 2 ~ 4 10 5 ~ 5)

(~r (range 1 10) ~l (list (range 2 9)) ~ 42)
=> (~ 1 10 ~ 2 9 ~ 42)

(apply #’~ 1 10
(loop repeat 3
append ’(~ 2 6)))
=> (~ 1 10 ~ 2 6 ~ 2 6 ~ 2 6)

Package

petalisp.api.

Source

shape-syntax.lisp.

Function: ~l (&rest args)

The functions ~, ~l, ~s and ~r can be used to construct new shapes from some given range designators, from lists of ranges, from shapes, or from a single range, respectively. Each of these patterns can be used repeatedly in a single call.

Examples:

(~)
=> (~)

(~ 8)
=> (~ 8)

(~ 1 10)
=> (~ 1 10)

(~ 0 10 2 ~ 0 10 2)
=> (~ 0 9 2 ~ 0 9 2)

(~ 5 ~s (~ 1 4 2 ~ 4 10 5) ~ 5)
=> (~ 5 ~ 1 4 2 ~ 4 10 5 ~ 5)

(~r (range 1 10) ~l (list (range 2 9)) ~ 42)
=> (~ 1 10 ~ 2 9 ~ 42)

(apply #’~ 1 10
(loop repeat 3
append ’(~ 2 6)))
=> (~ 1 10 ~ 2 6 ~ 2 6 ~ 2 6)

Package

petalisp.api.

Source

shape-syntax.lisp.

Function: ~r (&rest args)

The functions ~, ~l, ~s and ~r can be used to construct new shapes from some given range designators, from lists of ranges, from shapes, or from a single range, respectively. Each of these patterns can be used repeatedly in a single call.

Examples:

(~)
=> (~)

(~ 8)
=> (~ 8)

(~ 1 10)
=> (~ 1 10)

(~ 0 10 2 ~ 0 10 2)
=> (~ 0 9 2 ~ 0 9 2)

(~ 5 ~s (~ 1 4 2 ~ 4 10 5) ~ 5)
=> (~ 5 ~ 1 4 2 ~ 4 10 5 ~ 5)

(~r (range 1 10) ~l (list (range 2 9)) ~ 42)
=> (~ 1 10 ~ 2 9 ~ 42)

(apply #’~ 1 10
(loop repeat 3
append ’(~ 2 6)))
=> (~ 1 10 ~ 2 6 ~ 2 6 ~ 2 6)

Package

petalisp.api.

Source

shape-syntax.lisp.

Function: ~s (&rest args)

The functions ~, ~l, ~s and ~r can be used to construct new shapes from some given range designators, from lists of ranges, from shapes, or from a single range, respectively. Each of these patterns can be used repeatedly in a single call.

Examples:

(~)
=> (~)

(~ 8)
=> (~ 8)

(~ 1 10)
=> (~ 1 10)

(~ 0 10 2 ~ 0 10 2)
=> (~ 0 9 2 ~ 0 9 2)

(~ 5 ~s (~ 1 4 2 ~ 4 10 5) ~ 5)
=> (~ 5 ~ 1 4 2 ~ 4 10 5 ~ 5)

(~r (range 1 10) ~l (list (range 2 9)) ~ 42)
=> (~ 1 10 ~ 2 9 ~ 42)

(apply #’~ 1 10
(loop repeat 3
append ’(~ 2 6)))
=> (~ 1 10 ~ 2 6 ~ 2 6 ~ 2 6)

Package

petalisp.api.

Source

shape-syntax.lisp.


5.1.6 Generic functions

Generic Function: backend-compute (backend lazy-arrays)

Returns a list of delayed local arrays, one for each of the supplied list of LAZY-ARRAYS.

This function is invoked by COMPUTE, which guarantees that the supplied LAZY-ARRAYS are already collapsed. The resulting delayed actions replace the delayed actions of the corresponding LAZY-ARRAYS.

Package

petalisp.core.

Source

backend.lisp.

Methods
Method: backend-compute ((testing-backend testing-backend) (data-structures list))
Source

testing-backend.lisp.

Method: backend-compute ((ir-backend ir-backend) (lazy-arrays list))
Source

ir-backend.lisp.

Method: backend-compute ((backend reference-backend) (lazy-arrays list))
Source

reference-backend.lisp.

Method: backend-compute ((backend backend) (lazy-arrays list))
Method: backend-compute ((backend backend) (lazy-arrays null))
Generic Function: backend-compute-asynchronously (backend lazy-arrays)

Returns a REQUEST object that can be used to wait until all of the supplied LAZY-ARRAYS have been computed.

Package

petalisp.core.

Source

backend.lisp.

Methods
Method: backend-compute-asynchronously ((backend backend) (lazy-arrays list))
Method: backend-compute-asynchronously ((backend backend) (lazy-arrays null))
Generic Function: backend-evaluator (backend unknowns lazy-arrays)

For a supplied BACKEND, list of UNKNOWNS of length N, and list of LAZY-ARRAYS of length K, returns a function with K+N arguments that returns, as multiple values, the K array values obtained by computing the supplied arrays after substituting the Ith unknown with the supplied argument in position K+I.

The first N arguments specify which storage to use for the results. A value of NIL indicates that the corresponding result shall be a fresh array. A value that is an array ensures that the result is written to that array.

An error is signaled if any of the supplied arrays has a different shape or element type as the corresponding result or unknown.

Package

petalisp.core.

Source

backend.lisp.

Methods
Method: backend-evaluator ((xmas-backend xmas-backend) (unknowns list) (lazy-arrays list))
Source

xmas-backend.lisp.

Method: backend-evaluator ((backend backend) (unknowns list) (lazy-arrays list))
Method: backend-evaluator ((backend backend) (unknowns list) (lazy-arrays null))
Method: backend-evaluator :before ((backend backend) (unknowns list) (lazy-arrays list))
Generic Function: backendp (object)

Returns whether the supplied OBJECT is a Petalisp backend.

Package

petalisp.core.

Source

backend.lisp.

Methods
Method: backendp ((backend backend))
Method: backendp (object)
Generic Reader: core-memory (device)
Package

petalisp.ir.

Source

device.lisp.

Methods
Reader Method: core-memory ((core core))

automatically generated reader method

Target Slot

%memory.

Generic Reader: core-name (device)
Package

petalisp.ir.

Source

device.lisp.

Methods
Reader Method: core-name ((core core))

automatically generated reader method

Target Slot

%name.

Generic Function: delayed-action-inputs (delayed-action)
Package

petalisp.core.

Source

lazy-array.lisp.

Methods
Method: delayed-action-inputs ((delayed-action delayed-action))
Method: delayed-action-inputs ((delayed-map delayed-map))
Method: delayed-action-inputs ((delayed-nth-value delayed-nth-value))
Method: delayed-action-inputs ((delayed-reshape delayed-reshape))
Method: delayed-action-inputs ((delayed-fuse delayed-fuse))
Generic Function: delete-backend (backend)

Permanently disable the supplied BACKEND and free any resources that might be held by it. No other actions may be performed on a backend once it has been deleted.

Package

petalisp.core.

Source

backend.lisp.

Methods
Method: delete-backend ((testing-backend testing-backend))
Source

testing-backend.lisp.

Method: delete-backend ((xmas-backend xmas-backend))
Source

xmas-backend.lisp.

Method: delete-backend ((backend backend))
Generic Function: device-cores (device)
Package

petalisp.ir.

Source

device.lisp.

Generic Reader: device-memory (device)
Package

petalisp.ir.

Source

device.lisp.

Methods
Reader Method: device-memory ((device device))

automatically generated reader method

Target Slot

%memory.

Generic Reader: device-name (device)
Package

petalisp.ir.

Source

device.lisp.

Methods
Reader Method: device-name ((device device))

automatically generated reader method

Target Slot

%name.

Generic Function: enlarge-transformation (transformation scale offset)

Given a transformation mapping from (i1 ... iN) to (j1 ... jM), return a transformation mapping from (i0 i1 ... iN iN+1) to ((+(* i0 SCALE) OFFSET) j1 ... jM).

Package

petalisp.core.

Source

transformation.lisp.

Methods
Method: enlarge-transformation ((transformation hairy-transformation) (scaling rational) (offset rational))
Method: enlarge-transformation ((transformation identity-transformation) (scale rational) (offset rational))
Method: enlarge-transformation ((transformation identity-transformation) (scale (eql 1)) (offset (eql 0)))
Generic Function: invert-transformation (transformation)

Returns the inverse of the supplied transformation.

An error is signaled if the supplied transformation is not invertible.

Examples:

(invert-transformation (transform i to (+ 2 i)))
=> (transform a to (+ a -2))

(invert-transformation (transform a b to (+ (* 2 b) 5) (+ (* 3 a) 7))) => (transform a b to (+ (* 1/3 b) -7/3) (+ (* 1/2 a) -5/2))

(invert-transformation (transform a 0 to a))
=> (transform a to a 0)

(invert-transformation (transform a b to a))
>> simple-error

Package

petalisp.core.

Source

transformation.lisp.

Methods
Method: invert-transformation ((transformation hairy-transformation))
Method: invert-transformation ((transformation identity-transformation))
Generic Function: map-transformation-inputs (function transformation &key from-end)

For each input of TRANSFORMATION, invoke FUNCTION with the input index and the corresponding input constraint, or null, if there is no input constraint for this input.

If FROM-END is false, the input indices are traversed in ascending order. Otherwise, they are traversed in descending order.

Package

petalisp.core.

Source

transformation.lisp.

Methods
Method: map-transformation-inputs ((function function) (transformation hairy-transformation) &key from-end)
Method: map-transformation-inputs ((function function) (transformation identity-transformation) &key from-end)
Generic Function: map-transformation-outputs (function transformation &key from-end)

For each output of TRANSFORMATION, invoke FUNCTION with the output index, input index, the scaling and the offset of that output.

An input index of NIL and a scaling of zero is used, if (and only if) the output is constant.

If FROM-END is false, the output indices are traversed in ascending order. Otherwise, they are traversed in descending order.

Package

petalisp.core.

Source

transformation.lisp.

Methods
Method: map-transformation-outputs ((function function) (transformation hairy-transformation) &key from-end)
Method: map-transformation-outputs ((function function) (transformation identity-transformation) &key from-end)
Generic Reader: memory-bandwidth (memory)
Package

petalisp.ir.

Source

device.lisp.

Methods
Reader Method: memory-bandwidth ((memory memory))

automatically generated reader method

Target Slot

%bandwidth.

Generic Reader: memory-children (memory)
Package

petalisp.ir.

Source

device.lisp.

Methods
Reader Method: memory-children ((memory memory))

automatically generated reader method

Target Slot

%children.

Generic Reader: memory-cores (memory)
Package

petalisp.ir.

Source

device.lisp.

Methods
Reader Method: memory-cores ((memory memory))

automatically generated reader method

Target Slot

%cores.

Generic Reader: memory-granularity (memory)
Package

petalisp.ir.

Source

device.lisp.

Methods
Reader Method: memory-granularity ((memory memory))

automatically generated reader method

Target Slot

%granularity.

Generic Reader: memory-latency (memory)
Package

petalisp.ir.

Source

device.lisp.

Methods
Reader Method: memory-latency ((memory memory))

automatically generated reader method

Target Slot

%latency.

Generic Reader: memory-name (memory)
Package

petalisp.ir.

Source

device.lisp.

Methods
Reader Method: memory-name ((memory memory))

automatically generated reader method

Target Slot

%name.

Generic Reader: memory-parent (memory)
Package

petalisp.ir.

Source

device.lisp.

Methods
Reader Method: memory-parent ((memory memory))

automatically generated reader method

Target Slot

%parent.

Generic Reader: memory-parent-bandwidth (memory)
Package

petalisp.ir.

Source

device.lisp.

Methods
Reader Method: memory-parent-bandwidth ((memory memory))

automatically generated reader method

Target Slot

%parent-bandwidth.

Generic Reader: memory-size (memory)
Package

petalisp.ir.

Source

device.lisp.

Methods
Reader Method: memory-size ((memory memory))

automatically generated reader method

Target Slot

%size.

Generic Reader: network-outputs (object)
Package

petalisp.api.

Methods
Reader Method: network-outputs ((network network))

automatically generated reader method

Source

network.lisp.

Target Slot

%outputs.

Generic Reader: network-parameters (object)
Package

petalisp.api.

Methods
Reader Method: network-parameters ((network network))

automatically generated reader method

Source

network.lisp.

Target Slot

%parameters.

Generic Function: request-completedp (request)

Returns whether all lazy arrays that are part of the supplied REQUEST have already been computed.

Package

petalisp.core.

Source

backend.lisp.

Methods
Method: request-completedp ((completed-request completed-request))
Method: request-completedp ((request request))
Generic Function: request-wait (request)

Block until all lazy arrays that are part of the supplied REQUEST have been computed.

Package

petalisp.core.

Source

backend.lisp.

Methods
Method: request-wait ((completed-request completed-request))
Generic Function: requestp (object)

Returns whether the supplied OBJECT is a request.

Package

petalisp.core.

Source

backend.lisp.

Methods
Method: requestp ((request request))
Method: requestp (object)
Generic Function: shape-designator-shape (shape-designator)
Package

petalisp.core.

Source

shape.lisp.

Methods
Method: shape-designator-shape ((lazy-array lazy-array))
Source

lazy-array.lisp.

Method: shape-designator-shape (object)
Method: shape-designator-shape ((shape shape))
Method: shape-designator-shape ((array array))
Generic Function: substitute-delayed-action (delayed-action)
Package

petalisp.core.

Source

substitute-lazy-arrays.lisp.

Methods
Method: substitute-delayed-action ((delayed-action delayed-action))
Method: substitute-delayed-action ((delayed-fuse delayed-fuse))
Method: substitute-delayed-action ((delayed-reshape delayed-reshape))
Method: substitute-delayed-action ((delayed-nth-value delayed-nth-value))
Method: substitute-delayed-action ((delayed-multiple-value-map delayed-multiple-value-map))
Method: substitute-delayed-action ((delayed-map delayed-map))
Generic Function: transform-axis (axis transformation)
Package

petalisp.core.

Source

transformation.lisp.

Methods
Method: transform-axis ((axis integer) (hairy-transformation hairy-transformation))
Method: transform-axis ((axis integer) (transformation identity-transformation))
Method: transform-axis ((axis integer) (transformation transformation))
Generic Function: transform-sequence (sequence transformation)
Package

petalisp.core.

Source

transformation.lisp.

Methods
Method: transform-sequence ((vector vector) (transformation hairy-transformation))
Method: transform-sequence ((list list) (transformation hairy-transformation))
Method: transform-sequence ((sequence sequence) (transformation identity-transformation))
Method: transform-sequence :before ((sequence sequence) (transformation hairy-transformation))
Method: transform-sequence :before ((sequence sequence) (transformation transformation))
Generic Function: transform-shape (shape transformation)
Package

petalisp.core.

Source

transformation.lisp.

Methods
Method: transform-shape ((shape shape) (transformation hairy-transformation))
Method: transform-shape ((shape shape) (operator identity-transformation))
Method: transform-shape :before ((shape shape) (transformation hairy-transformation))
Method: transform-shape :before ((shape shape) (transformation transformation))
Generic Function: transformation-similar (transformation-1 transformation-2 delta)

Check whether two supplied transformations are similar. Two transformations are similar if they have the same permutation, the same inputs constraints, the same scalings, and offsets whose entries differ in at most DELTA.

Examples:

(transformation-similar (transform a to a) (transform a to (1+ a)) 0) => nil

(transformation-similar (transform a to a) (transform a to (1+ a)) 1) => t

(transformation-similar (transform i j to (+ j 2) i)
(transform i j to (- j 1) i) 2)
=> nil

(transformation-similar (transform i j to (+ j 2) i)
(transform i j to (- j 1) i) 3)
=> t

Package

petalisp.core.

Source

transformation.lisp.

Methods
Method: transformation-similar ((t1 transformation) (t2 transformation) (delta integer))
Generic Function: transformation= (transformation-1 transformation-2)

Check whether two supplied transformations describe the same mapping.

Examples:

(transformation= (transform i to (* 2 (1+ i))) (transform i to (+ 2 (* 2 i)))) => t

(transformation= (transform i j to i j) (transform i j to j i))
=> nil

Package

petalisp.core.

Source

transformation.lisp.

Methods
Method: transformation= ((t1 hairy-transformation) (t2 hairy-transformation))
Method: transformation= ((t1 identity-transformation) (t2 identity-transformation))
Method: transformation= ((t1 transformation) (t2 transformation))

5.1.7 Standalone methods

Method: print-object ((shape shape) stream)
Source

shape-syntax.lisp.

Method: print-object ((range non-empty-range) stream)
Source

range.lisp.

Method: print-object ((lazy-array lazy-array) stream)
Source

lazy-array.lisp.

Method: print-object ((empty-range empty-range) stream)
Source

range.lisp.

Method: print-object ((transformation transformation) stream)
Source

transform.lisp.

Method: print-object ((kernel kernel) stream)
Source

ir.lisp.

Method: print-object ((split split) stream)
Source

partitioning.lisp.

Method: print-object ((program program) stream)
Source

ir.lisp.

Method: print-object ((device device) stream)
Source

device.lisp.

Method: print-object ((iref-instruction iref-instruction) stream)
Source

ir.lisp.

Method: print-object ((memory memory) stream)
Source

device.lisp.

Method: print-object ((core core) stream)
Source

device.lisp.

Method: print-object ((task task) stream)
Source

ir.lisp.

Method: print-object ((buffer buffer) stream)
Source

ir.lisp.

Method: print-object ((store-instruction store-instruction) stream)
Source

ir.lisp.

Method: print-object ((call-instruction call-instruction) stream)
Source

ir.lisp.

Method: print-object ((load-instruction load-instruction) stream)
Source

ir.lisp.

Method: print-object ((chunk chunk) stream)
Source

partitioning.lisp.

Method: print-object ((ad-record ad-record) stream)
Source

differentiator.lisp.

Method: shared-initialize :after ((memory memory) slot-names &key &allow-other-keys)
Source

device.lisp.

Method: shared-initialize :after ((core core) slot-names &key &allow-other-keys)
Source

device.lisp.


5.1.8 Structures

Structure: buffer
Package

petalisp.ir.

Source

ir.lisp.

Direct superclasses

structure-object.

Direct methods
Direct slots
Slot: shape
Package

petalisp.core.

Type

petalisp.core:shape

Readers

buffer-shape.

Writers

(setf buffer-shape).

Slot: ntype
Type

typo:ntype

Readers

buffer-ntype.

Writers

(setf buffer-ntype).

Slot: depth
Type

(and unsigned-byte fixnum)

Readers

buffer-depth.

Writers

(setf buffer-depth).

Slot: writers
Type

list

Initform

(quote nil)

Readers

buffer-writers.

Writers

(setf buffer-writers).

Slot: readers
Type

list

Initform

(quote nil)

Readers

buffer-readers.

Writers

(setf buffer-readers).

Slot: task
Type

(or null petalisp.ir:task)

Readers

buffer-task.

Writers

(setf buffer-task).

Slot: storage
Readers

buffer-storage.

Writers

(setf buffer-storage).

Slot: number
Package

common-lisp.

Type

(and unsigned-byte fixnum)

Initform

0

Readers

buffer-number.

Writers

(setf buffer-number).

Structure: call-instruction
Package

petalisp.ir.

Source

ir.lisp.

Direct superclasses

instruction.

Direct methods
Direct slots
Slot: fnrecord
Type

typo:fnrecord

Readers

call-instruction-fnrecord.

Writers

(setf call-instruction-fnrecord).

Slot: number-of-values
Type

(integer 0 (4611686018427387903))

Readers

call-instruction-number-of-values.

Writers

(setf call-instruction-number-of-values).

Structure: chunk
Package

petalisp.ir.

Source

partitioning.lisp.

Direct superclasses

structure-object.

Direct methods

print-object.

Direct slots
Slot: buffer
Type

petalisp.ir:buffer

Readers

chunk-buffer.

Writers

This slot is read-only.

Slot: domain
Type

petalisp.core:shape

Readers

chunk-domain.

Writers

This slot is read-only.

Slot: shape
Package

petalisp.core.

Type

petalisp.core:shape

Readers

chunk-shape.

Writers

This slot is read-only.

Slot: parent
Type

(or null petalisp.ir:chunk)

Readers

chunk-parent.

Writers

This slot is read-only.

Slot: writers
Type

list

Initform

(quote nil)

Readers

chunk-writers.

Writers

(setf chunk-writers).

Slot: split-priority-cache
Type

(or null unsigned-byte)

Readers

chunk-split-priority-cache.

Writers

(setf chunk-split-priority-cache).

Slot: split
Type

(or null structure-object)

Readers

chunk-split.

Writers

(setf chunk-split).

Structure: delayed-action
Package

petalisp.core.

Source

lazy-array.lisp.

Direct superclasses

structure-object.

Direct subclasses
Direct methods
Structure: delayed-array
Package

petalisp.core.

Source

lazy-array.lisp.

Direct superclasses

delayed-action.

Direct methods
Direct slots
Slot: storage
Type

array

Initform

(alexandria:required-argument :storage)

Readers

delayed-array-storage.

Writers

(setf delayed-array-storage).

Structure: delayed-failure
Package

petalisp.core.

Source

lazy-array.lisp.

Direct superclasses

delayed-action.

Direct methods
Direct slots
Slot: condition
Package

common-lisp.

Type

condition

Initform

(alexandria:required-argument :condition)

Readers

delayed-failure-condition.

Writers

This slot is read-only.

Structure: delayed-fuse
Package

petalisp.core.

Source

lazy-array.lisp.

Direct superclasses

delayed-action.

Direct methods
Direct slots
Slot: inputs
Type

list

Initform

(alexandria:required-argument :inputs)

Readers

delayed-fuse-inputs.

Writers

(setf delayed-fuse-inputs).

Structure: delayed-map
Package

petalisp.core.

Source

lazy-array.lisp.

Direct superclasses

delayed-action.

Direct subclasses

delayed-multiple-value-map.

Direct methods
Direct slots
Slot: fnrecord
Type

typo:fnrecord

Initform

(alexandria:required-argument :fnrecord)

Readers

delayed-map-fnrecord.

Writers

(setf delayed-map-fnrecord).

Slot: inputs
Type

list

Initform

(alexandria:required-argument :inputs)

Readers

delayed-map-inputs.

Writers

(setf delayed-map-inputs).

Structure: delayed-multiple-value-map
Package

petalisp.core.

Source

lazy-array.lisp.

Direct superclasses

delayed-map.

Direct methods
Direct slots
Slot: values-ntype
Type

typo:values-ntype

Initform

(alexandria:required-argument :values-ntype)

Readers

delayed-multiple-value-map-values-ntype.

Writers

This slot is read-only.

Slot: refbits
Type

unsigned-byte

Initform

0

Readers

delayed-multiple-value-map-refbits.

Writers

(setf delayed-multiple-value-map-refbits).

Structure: delayed-nop
Package

petalisp.core.

Source

lazy-array.lisp.

Direct superclasses

delayed-action.

Direct methods

delayed-action-value.

Structure: delayed-nth-value
Package

petalisp.core.

Source

lazy-array.lisp.

Direct superclasses

delayed-action.

Direct methods
Direct slots
Slot: number
Package

common-lisp.

Type

typo:argument-index

Initform

(alexandria:required-argument :number)

Readers

delayed-nth-value-number.

Writers

(setf delayed-nth-value-number).

Slot: input
Type

petalisp.core:lazy-array

Initform

(alexandria:required-argument :input)

Readers

delayed-nth-value-input.

Writers

(setf delayed-nth-value-input).

Structure: delayed-range
Package

petalisp.core.

Source

lazy-array.lisp.

Direct superclasses

delayed-action.

Direct methods
Structure: delayed-reshape
Package

petalisp.core.

Source

lazy-array.lisp.

Direct superclasses

delayed-action.

Direct methods
Direct slots
Slot: transformation
Type

petalisp.core:transformation

Initform

(alexandria:required-argument :transformation)

Readers

delayed-reshape-transformation.

Writers

(setf delayed-reshape-transformation).

Slot: input
Type

petalisp.core:lazy-array

Initform

(alexandria:required-argument :input)

Readers

delayed-reshape-input.

Writers

(setf delayed-reshape-input).

Structure: delayed-unknown
Package

petalisp.core.

Source

lazy-array.lisp.

Direct superclasses

delayed-action.

Direct methods
Structure: delayed-wait
Package

petalisp.core.

Source

lazy-array.lisp.

Direct superclasses

delayed-action.

Direct methods
Direct slots
Slot: request
Initform

(alexandria:required-argument :request)

Readers

delayed-wait-request.

Writers

This slot is read-only.

Slot: delayed-action
Type

petalisp.core:delayed-action

Initform

(alexandria:required-argument :delayed-action)

Readers

delayed-wait-delayed-action.

Writers

(setf delayed-wait-delayed-action).

Structure: empty-range

An empty range is a range with zero elements.

Package

petalisp.core.

Source

range.lisp.

Direct superclasses

range.

Direct methods

print-object.

Structure: identity-transformation

An identity transformation of rank N maps every list of length N to itself. An identity transformation is its own inverse.

Package

petalisp.core.

Source

transformation.lisp.

Direct superclasses

transformation.

Direct methods
Structure: instruction
Package

petalisp.ir.

Source

ir.lisp.

Direct superclasses

structure-object.

Direct subclasses
Direct methods
Direct slots
Slot: inputs
Type

list

Initform

(quote nil)

Readers

instruction-inputs.

Writers

(setf instruction-inputs).

Slot: number
Package

common-lisp.

Type

(and unsigned-byte fixnum)

Initform

0

Readers

instruction-number.

Writers

(setf instruction-number).

Structure: iref-instruction
Package

petalisp.ir.

Source

ir.lisp.

Direct superclasses

iterating-instruction.

Direct methods
Structure: iterating-instruction
Package

petalisp.ir.

Source

ir.lisp.

Direct superclasses

instruction.

Direct subclasses
Direct methods
Direct slots
Slot: transformation
Package

petalisp.core.

Type

petalisp.core:transformation

Readers

instruction-transformation.

Writers

(setf instruction-transformation).

Structure: kernel
Package

petalisp.ir.

Source

ir.lisp.

Direct superclasses

structure-object.

Direct methods
Direct slots
Slot: iteration-space
Type

petalisp.core:shape

Readers

kernel-iteration-space.

Writers

(setf kernel-iteration-space).

Slot: sources
Type

list

Initform

(quote nil)

Readers

kernel-sources.

Writers

(setf kernel-sources).

Slot: targets
Type

list

Initform

(quote nil)

Readers

kernel-targets.

Writers

(setf kernel-targets).

Slot: instruction-vector
Type

simple-vector

Initform

#()

Readers

kernel-instruction-vector.

Writers

(setf kernel-instruction-vector).

Slot: task
Type

(or null petalisp.ir:task)

Readers

kernel-task.

Writers

(setf kernel-task).

Slot: data
Readers

kernel-data.

Writers

(setf kernel-data).

Slot: number
Package

common-lisp.

Type

(and unsigned-byte fixnum)

Initform

0

Readers

kernel-number.

Writers

(setf kernel-number).

Structure: lazy-array

A lazy array encapsulates some information that can be used to compute actual Common Lisp arrays.

Package

petalisp.core.

Source

lazy-array.lisp.

Direct superclasses

structure-object.

Direct methods
Direct slots
Slot: shape
Type

petalisp.core:shape

Initform

(alexandria:required-argument :shape)

Readers

lazy-array-shape.

Writers

This slot is read-only.

Slot: ntype
Type

typo:ntype

Initform

(alexandria:required-argument :ntype)

Readers

lazy-array-ntype.

Writers

This slot is read-only.

Slot: depth
Type

(and unsigned-byte fixnum)

Initform

0

Readers

lazy-array-depth.

Writers

This slot is read-only.

Slot: refcount
Type

(and unsigned-byte fixnum)

Initform

0

Readers

lazy-array-refcount.

Writers

(setf lazy-array-refcount).

Slot: delayed-action
Type

petalisp.core:delayed-action

Initform

(alexandria:required-argument :delayed-action)

Readers

lazy-array-delayed-action.

Writers

(setf lazy-array-delayed-action).

Structure: load-instruction
Package

petalisp.ir.

Source

ir.lisp.

Direct superclasses

iterating-instruction.

Direct methods
Direct slots
Slot: buffer
Type

petalisp.ir:buffer

Readers

load-instruction-buffer.

Writers

(setf load-instruction-buffer).

Structure: non-empty-range

A non-empty range denotes a set of integers, starting from a lower bound START, by a fixed stride STEP, to an exclusive upper bound END.

Package

petalisp.core.

Source

range.lisp.

Direct superclasses

range.

Direct methods

print-object.

Direct slots
Slot: step
Package

common-lisp.

Type

(integer 1 *)

Readers

range-step.

Writers

This slot is read-only.

Slot: start
Type

integer

Readers

range-start.

Writers

This slot is read-only.

Structure: program
Package

petalisp.ir.

Source

ir.lisp.

Direct superclasses

structure-object.

Direct methods
Direct slots
Slot: initial-task
Readers

program-initial-task.

Writers

(setf program-initial-task).

Slot: final-task
Readers

program-final-task.

Writers

(setf program-final-task).

Slot: leaf-alist
Type

list

Initform

(quote nil)

Readers

program-leaf-alist.

Writers

(setf program-leaf-alist).

Slot: root-buffers
Type

list

Initform

(quote nil)

Readers

program-root-buffers.

Writers

(setf program-root-buffers).

Slot: task-vector
Type

simple-vector

Initform

#()

Readers

program-task-vector.

Writers

(setf program-task-vector).

Slot: number-of-buffers
Type

(and unsigned-byte fixnum)

Initform

0

Readers

program-number-of-buffers.

Writers

(setf program-number-of-buffers).

Slot: number-of-kernels
Type

(and unsigned-byte fixnum)

Initform

0

Readers

program-number-of-kernels.

Writers

(setf program-number-of-kernels).

Structure: queue
Package

petalisp.utilities.

Source

queue.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: h-lock
Type

bordeaux-threads:lock

Initform

(bordeaux-threads:make-lock "h-lock")

Readers

queue-h-lock.

Writers

(setf queue-h-lock).

Slot: t-lock
Type

bordeaux-threads:lock

Initform

(bordeaux-threads:make-lock "t-lock")

Readers

queue-t-lock.

Writers

(setf queue-t-lock).

Slot: head
Type

cons

Readers

queue-head