The petalisp Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The petalisp Reference Manual

This is the petalisp Reference Manual, generated automatically by Declt version 2.4 patchlevel 1 "Will Decker" on Mon Jul 29 16:23:52 2019 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

#+TITLE: Petalisp

Petalisp is an attempt to generate high performance code for parallel
computers by JIT-compiling array definitions. It is not a full blown
programming language, but rather a carefully crafted extension of Common
Lisp that allows for extreme optimization and parallelization.

** Getting Started
1. Install Lisp and a suitable IDE.  If unsure, pick [[https://portacle.github.io/][Portacle]].
2. Download Petalisp via [[https://www.quicklisp.org/][Quicklisp]].
3. Check out some of the [[file:examples][examples]].

** Showcases
Petalisp is still under development, so the following examples may still
change slightly. Nevertheless they give a good glimpse on what programming
with Petalisp will be like.

Example 1: transposing a matrix
#+BEGIN_SRC lisp
(defun transpose (A)
  (reshape A (τ (m n) (n m))))
#+END_SRC

Example 2: matrix-matrix multiplication
#+BEGIN_SRC lisp
(defun matrix-multiplication (A B)
  (β #'+
     (α #'*
        (reshape A (τ (m n) (n m 1)))
        (reshape B (τ (n k) (n 1 k))))))
#+END_SRC

Example 3: the numerical Jacobi scheme in two dimensions
#+BEGIN_SRC lisp
(defun jacobi-2d (grid iterations)
  (let ((interior (interior grid)))
    (if (zerop iterations) grid
        (jacobi-2d
         (fuse x
               (α #'* 0.25
                  (α #'+
                     (reshape x (τ (i0 i1) ((+ i0 1) i1)) interior)
                     (reshape x (τ (i0 i1) ((- i0 1) i1)) interior)
                     (reshape x (τ (i0 i1) (i0 (+ i1 1))) interior)
                     (reshape x (τ (i0 i1) (i0 (- i1 1))) interior))))
         (- iterations 1)))))
#+END_SRC

** Performance

Coming soon!

** Frequently Asked Questions

*** Is Petalisp similar to NumPy?
NumPy is a widely used Python library for scientific computing on arrays.
It provides powerful N-dimensional arrays and a variety of functions for
working with these arrays.

Petalisp works on a more fundamental level.  It provides even more powerful
N-dimensional arrays, but just a few building blocks for working on them -
element-wise function application, reduction, reshaping and array fusion.

So Petalisp is not a substitute for NumPy.  However, it could be used to
write a library that behaves like NumPy, but that is much faster and fully
parallelized.  In fact, writing such a library is one of my future goals.

*** Do I have to program Lisp to use Petalisp?
Not necessarily.  Not everyone has the time to learn Common Lisp.  That is
why I am also working on some [[https://github.com/marcoheisig/petalisp-for-python][convenient Python bindings]] for Petalisp.

But: If you ever have time to learn Lisp, do it!  It is an enlightening
experience.

*** Why the Greek letters?
There are several reasons:
1. It underlines the beautiful, mathematical nature of this programming model.
2. The α and β functions are a tribute to Connection Machine Lisp.
3. Compared to programming a computer with billions of transistors and
   terabytes of memory, typing Greek letters is easy. Right?

Note: Following community feedback, it is now also possible to write =a=
instead of =α= and =b= instead of =β=.  But as a convention, please use the
ASCII aliases only as a shortcut for scripting.  If I ever see =a= and =b=
being called in a Quicklisp project, I will remove them from the API :)

*** Why is Petalisp licensed under AGPL?
I am aware that this license prevents some people from using or
contributing to this piece of software, which is a shame. But unfortunately
the majority of software developers have not yet understood that

1. In a digital world, free software is a necessary prerequisite for a free
   society.
2. When developing software, open collaboration is way more efficient than
   competition.

So as long as distribution of non-free software is socially accepted,
copyleft licenses like the AGPL seem to be the lesser evil.

That being said, I am willing to discuss relicensing on an individual
basis.

*** Why is Petalisp written in Common Lisp?
I couldn't wish for a better tool for the job. Common Lisp is extremely
rich in features, standardized, fast, safe and mature. The Lisp community
is amazing and there are excellent libraries for almost every imaginable
task.

To illustrate why Lisp is particularly well suited for a project like
Petalisp, consider the following implementation of a JIT-compiler for
mapping a function over a vector of a certain element type:

#+BEGIN_SRC lisp
(defun vector-mapper (element-type)
  (compile nil `(lambda (fn vec)
                  (declare (function fn)
                           (type (simple-array ,element-type (*)) vec)
                           (optimize (speed 3) (safety 0)))
                  (loop for index below (length vec) do
                    (symbol-macrolet ((elt (aref vec index)))
                      (setf elt (funcall fn elt)))))))
#+END_SRC

Not only is this JIT-compiler just 8 lines of code, it is also 20 times
faster than invoking GCC or Clang on a roughly equivalent piece of C code.


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

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


Next: , Previous: , Up: Systems   [Contents][Index]

2.1 petalisp

Author

Marco Heisig <marco.heisig@fau.de>

License

AGPLv3

Description

Elegant High Performance Computing

Dependency

petalisp.api (system)

Source

petalisp.asd (file)


Next: , Previous: , Up: Systems   [Contents][Index]

2.2 petalisp.api

Author

Marco Heisig <marco.heisig@fau.de>

License

AGPLv3

Description

A Convenient API for Petalisp.

Dependencies
Source

petalisp.api.asd (file)

Components

Next: , Previous: , Up: Systems   [Contents][Index]

2.3 petalisp.reference-backend

Author

Marco Heisig <marco.heisig@fau.de>

License

AGPLv3

Dependency

petalisp.core (system)

Source

petalisp.reference-backend.asd (file)

Components

Next: , Previous: , Up: Systems   [Contents][Index]

2.4 petalisp.ir-backend

Author

Marco Heisig <marco.heisig@fau.de>

License

AGPLv3

Dependencies
Source

petalisp.ir-backend.asd (file)

Components

Next: , Previous: , Up: Systems   [Contents][Index]

2.5 petalisp.native-backend

Author

Marco Heisig <marco.heisig@fau.de>

License

AGPLv3

Dependencies
Source

petalisp.native-backend.asd (file)

Components

Next: , Previous: , Up: Systems   [Contents][Index]

2.6 petalisp.ir

Author

Marco Heisig <marco.heisig@fau.de>

License

AGPLv3

Dependencies
Source

petalisp.ir.asd (file)

Components

Next: , Previous: , Up: Systems   [Contents][Index]

2.7 petalisp.core

Author

Marco Heisig <marco.heisig@fau.de>

License

AGPLv3

Dependencies
Source

petalisp.core.asd (file)

Components

Next: , Previous: , Up: Systems   [Contents][Index]

2.8 petalisp.utilities

Author

Marco Heisig <marco.heisig@fau.de>

License

AGPLv3

Dependencies
Source

petalisp.utilities.asd (file)

Components

Next: , Previous: , Up: Systems   [Contents][Index]

2.9 petalisp.type-codes

Author

Marco Heisig <marco.heisig@fau.de>

License

AGPLv3

Dependencies
Source

petalisp.type-codes.asd (file)

Components

Previous: , Up: Systems   [Contents][Index]

2.10 petalisp.specialization

Author

Marco Heisig <marco.heisig@fau.de>

License

AGPLv3

Dependencies
Source

petalisp.specialization.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Modules

Modules are listed depth-first from the system components tree.


Next: , Previous: , Up: Modules   [Contents][Index]

3.1 petalisp.type-codes/type-inference-rules

Dependency

type-inference.lisp (file)

Parent

petalisp.type-codes (system)

Location

type-codes/type-inference-rules/

Components

Previous: , Up: Modules   [Contents][Index]

3.2 petalisp.specialization/common-lisp

Dependency

macros.lisp (file)

Parent

petalisp.specialization (system)

Location

specialization/common-lisp/

Components

Next: , Previous: , Up: Top   [Contents][Index]

4 Files

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


Previous: , Up: Files   [Contents][Index]

4.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.1 petalisp.asd

Location

petalisp.asd

Systems

petalisp (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.2 petalisp.api.asd

Location

api/petalisp.api.asd

Systems

petalisp.api (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.3 petalisp.reference-backend.asd

Location

reference-backend/petalisp.reference-backend.asd

Systems

petalisp.reference-backend (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.4 petalisp.ir-backend.asd

Location

ir-backend/petalisp.ir-backend.asd

Systems

petalisp.ir-backend (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.5 petalisp.native-backend.asd

Location

native-backend/petalisp.native-backend.asd

Systems

petalisp.native-backend (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.6 petalisp.ir.asd

Location

ir/petalisp.ir.asd

Systems

petalisp.ir (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.7 petalisp.core.asd

Location

core/petalisp.core.asd

Systems

petalisp.core (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.8 petalisp.utilities.asd

Location

utilities/petalisp.utilities.asd

Systems

petalisp.utilities (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.9 petalisp.type-codes.asd

Location

type-codes/petalisp.type-codes.asd

Systems

petalisp.type-codes (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.10 petalisp.specialization.asd

Location

specialization/petalisp.specialization.asd

Systems

petalisp.specialization (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.11 petalisp.api/packages.lisp

Parent

petalisp.api (system)

Location

api/packages.lisp

Packages

petalisp.api


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.12 petalisp.api/api.lisp

Dependency

packages.lisp (file)

Parent

petalisp.api (system)

Location

api/api.lisp

Exported Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.13 petalisp.reference-backend/packages.lisp

Parent

petalisp.reference-backend (system)

Location

reference-backend/packages.lisp

Packages

petalisp.reference-backend


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.14 petalisp.reference-backend/simple-immediate.lisp

Dependency

packages.lisp (file)

Parent

petalisp.reference-backend (system)

Location

reference-backend/simple-immediate.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.15 petalisp.reference-backend/reference-backend.lisp

Dependency

simple-immediate.lisp (file)

Parent

petalisp.reference-backend (system)

Location

reference-backend/reference-backend.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.16 petalisp.ir-backend/packages.lisp

Parent

petalisp.ir-backend (system)

Location

ir-backend/packages.lisp

Packages

petalisp.ir-backend


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.17 petalisp.ir-backend/ir-backend.lisp

Dependency

packages.lisp (file)

Parent

petalisp.ir-backend (system)

Location

ir-backend/ir-backend.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.18 petalisp.native-backend/packages.lisp

Parent

petalisp.native-backend (system)

Location

native-backend/packages.lisp

Packages

petalisp.native-backend


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.19 petalisp.native-backend/utilities.lisp

Dependency

packages.lisp (file)

Parent

petalisp.native-backend (system)

Location

native-backend/utilities.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.20 petalisp.native-backend/basic-block.lisp

Dependency

utilities.lisp (file)

Parent

petalisp.native-backend (system)

Location

native-backend/basic-block.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.21 petalisp.native-backend/lambda-block.lisp

Dependency

basic-block.lisp (file)

Parent

petalisp.native-backend (system)

Location

native-backend/lambda-block.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.22 petalisp.native-backend/loop-block.lisp

Dependency

lambda-block.lisp (file)

Parent

petalisp.native-backend (system)

Location

native-backend/loop-block.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.23 petalisp.native-backend/tail-block.lisp

Dependency

loop-block.lisp (file)

Parent

petalisp.native-backend (system)

Location

native-backend/tail-block.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.24 petalisp.native-backend/translation-unit.lisp

Dependency

tail-block.lisp (file)

Parent

petalisp.native-backend (system)

Location

native-backend/translation-unit.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.25 petalisp.native-backend/blueprint-compiler.lisp

Dependency

translation-unit.lisp (file)

Parent

petalisp.native-backend (system)

Location

native-backend/blueprint-compiler.lisp

Exported Definitions

instruction (function)

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.26 petalisp.native-backend/memory-pool.lisp

Dependency

blueprint-compiler.lisp (file)

Parent

petalisp.native-backend (system)

Location

native-backend/memory-pool.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.27 petalisp.native-backend/native-backend.lisp

Dependency

memory-pool.lisp (file)

Parent

petalisp.native-backend (system)

Location

native-backend/native-backend.lisp

Exported Definitions

make-native-backend (function)

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.28 petalisp.native-backend/execution.lisp

Dependency

native-backend.lisp (file)

Parent

petalisp.native-backend (system)

Location

native-backend/execution.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.29 petalisp.ir/packages.lisp

Parent

petalisp.ir (system)

Location

ir/packages.lisp

Packages

petalisp.ir


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.30 petalisp.ir/ir.lisp

Dependency

packages.lisp (file)

Parent

petalisp.ir (system)

Location

ir/ir.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.31 petalisp.ir/compute-buffer-table.lisp

Dependency

ir.lisp (file)

Parent

petalisp.ir (system)

Location

ir/compute-buffer-table.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.32 petalisp.ir/compute-iteration-spaces.lisp

Dependency

compute-buffer-table.lisp (file)

Parent

petalisp.ir (system)

Location

ir/compute-iteration-spaces.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.33 petalisp.ir/ir-conversion.lisp

Dependency

compute-iteration-spaces.lisp (file)

Parent

petalisp.ir (system)

Location

ir/ir-conversion.lisp

Exported Definitions

ir-from-lazy-arrays (function)

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.34 petalisp.ir/blueprint.lisp

Dependency

ir-conversion.lisp (file)

Parent

petalisp.ir (system)

Location

ir/blueprint.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.35 petalisp.ir/documentation.lisp

Dependency

blueprint.lisp (file)

Parent

petalisp.ir (system)

Location

ir/documentation.lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.36 petalisp.core/packages.lisp

Parent

petalisp.core (system)

Location

core/packages.lisp

Packages

petalisp.core


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.37 petalisp.core/set.lisp

Dependency

packages.lisp (file)

Parent

petalisp.core (system)

Location

core/set.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.38 petalisp.core/empty-set.lisp

Dependency

set.lisp (file)

Parent

petalisp.core (system)

Location

core/empty-set.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.39 petalisp.core/explicit-set.lisp

Dependency

empty-set.lisp (file)

Parent

petalisp.core (system)

Location

core/explicit-set.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.40 petalisp.core/range.lisp

Dependency

explicit-set.lisp (file)

Parent

petalisp.core (system)

Location

core/range.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.41 petalisp.core/shape.lisp

Dependency

range.lisp (file)

Parent

petalisp.core (system)

Location

core/shape.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.42 petalisp.core/transformation.lisp

Dependency

shape.lisp (file)

Parent

petalisp.core (system)

Location

core/transformation.lisp

Exported Definitions
Internal Definitions

map-transformation-inputs (generic function)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.43 petalisp.core/identity-transformation.lisp

Dependency

transformation.lisp (file)

Parent

petalisp.core (system)

Location

core/identity-transformation.lisp

Exported Definitions
Internal Definitions

map-transformation-inputs (method)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.44 petalisp.core/invertible-transformation.lisp

Dependency

identity-transformation.lisp (file)

Parent

petalisp.core (system)

Location

core/invertible-transformation.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.45 petalisp.core/hairy-transformation.lisp

Dependency

invertible-transformation.lisp (file)

Parent

petalisp.core (system)

Location

core/hairy-transformation.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.46 petalisp.core/transformation-constructors.lisp

Dependency

hairy-transformation.lisp (file)

Parent

petalisp.core (system)

Location

core/transformation-constructors.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.47 petalisp.core/shape-transformations.lisp

Dependency

transformation-constructors.lisp (file)

Parent

petalisp.core (system)

Location

core/shape-transformations.lisp

Exported Definitions
Internal Definitions

from-storage-transformation (function)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.48 petalisp.core/lazy-array.lisp

Dependency

shape-transformations.lisp (file)

Parent

petalisp.core (system)

Location

core/lazy-array.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.49 petalisp.core/broadcasting.lisp

Dependency

lazy-array.lisp (file)

Parent

petalisp.core (system)

Location

core/broadcasting.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.50 petalisp.core/lazy-array-constructors.lisp

Dependency

broadcasting.lisp (file)

Parent

petalisp.core (system)

Location

core/lazy-array-constructors.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.51 petalisp.core/backend.lisp

Dependency

lazy-array-constructors.lisp (file)

Parent

petalisp.core (system)

Location

core/backend.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.52 petalisp.core/documentation.lisp

Dependency

backend.lisp (file)

Parent

petalisp.core (system)

Location

core/documentation.lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.53 petalisp.utilities/packages.lisp

Parent

petalisp.utilities (system)

Location

utilities/packages.lisp

Packages

petalisp.utilities


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.54 petalisp.utilities/documentation.lisp

Dependency

packages.lisp (file)

Parent

petalisp.utilities (system)

Location

utilities/documentation.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.55 petalisp.utilities/identical.lisp

Dependency

documentation.lisp (file)

Parent

petalisp.utilities (system)

Location

utilities/identical.lisp

Exported Definitions

identical (function)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.56 petalisp.utilities/memoization.lisp

Dependency

identical.lisp (file)

Parent

petalisp.utilities (system)

Location

utilities/memoization.lisp

Exported Definitions
Internal Definitions

+empty+ (constant)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.57 petalisp.utilities/extended-euclid.lisp

Dependency

memoization.lisp (file)

Parent

petalisp.utilities (system)

Location

utilities/extended-euclid.lisp

Exported Definitions

extended-euclid (function)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.58 petalisp.utilities/define-method-pair.lisp

Dependency

extended-euclid.lisp (file)

Parent

petalisp.utilities (system)

Location

utilities/define-method-pair.lisp

Exported Definitions

define-method-pair (macro)

Internal Definitions

parse-defmethod (function)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.59 petalisp.utilities/define-class-predicate.lisp

Dependency

define-method-pair.lisp (file)

Parent

petalisp.utilities (system)

Location

utilities/define-class-predicate.lisp

Exported Definitions

define-class-predicate (macro)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.60 petalisp.utilities/defalias.lisp

Dependency

define-class-predicate.lisp (file)

Parent

petalisp.utilities (system)

Location

utilities/defalias.lisp

Exported Definitions

defalias (macro)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.61 petalisp.utilities/float-bits.lisp

Dependency

defalias.lisp (file)

Parent

petalisp.utilities (system)

Location

utilities/float-bits.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.62 petalisp.type-codes/packages.lisp

Parent

petalisp.type-codes (system)

Location

type-codes/packages.lisp

Packages

petalisp.type-codes


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.63 petalisp.type-codes/type-codes.lisp

Dependency

packages.lisp (file)

Parent

petalisp.type-codes (system)

Location

type-codes/type-codes.lisp

Exported Definitions
Internal Definitions

+types+ (constant)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.64 petalisp.type-codes/type-code-utilities.lisp

Dependency

type-codes.lisp (file)

Parent

petalisp.type-codes (system)

Location

type-codes/type-code-utilities.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.65 petalisp.type-codes/function-lambda-lists.lisp

Dependency

type-code-utilities.lisp (file)

Parent

petalisp.type-codes (system)

Location

type-codes/function-lambda-lists.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.66 petalisp.type-codes/type-inference.lisp

Dependency

function-lambda-lists.lisp (file)

Parent

petalisp.type-codes (system)

Location

type-codes/type-inference.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.67 petalisp.type-codes/type-inference-rules/characters.lisp

Parent

type-inference-rules (module)

Location

type-codes/type-inference-rules/characters.lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.68 petalisp.type-codes/type-inference-rules/data-and-control-flow.lisp

Parent

type-inference-rules (module)

Location

type-codes/type-inference-rules/data-and-control-flow.lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.69 petalisp.type-codes/type-inference-rules/numbers.lisp

Parent

type-inference-rules (module)

Location

type-codes/type-inference-rules/numbers.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.70 petalisp.type-codes/type-inference-rules/objects.lisp

Parent

type-inference-rules (module)

Location

type-codes/type-inference-rules/objects.lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.71 petalisp.type-codes/type-inference-rules/symbols.lisp

Parent

type-inference-rules (module)

Location

type-codes/type-inference-rules/symbols.lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.72 petalisp.specialization/packages.lisp

Parent

petalisp.specialization (system)

Location

specialization/packages.lisp

Packages

petalisp.specialization


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.73 petalisp.specialization/auxiliary-types.lisp

Dependency

packages.lisp (file)

Parent

petalisp.specialization (system)

Location

specialization/auxiliary-types.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.74 petalisp.specialization/function-lambda-lists.lisp

Dependency

auxiliary-types.lisp (file)

Parent

petalisp.specialization (system)

Location

specialization/function-lambda-lists.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.75 petalisp.specialization/type-codes.lisp

Dependency

function-lambda-lists.lisp (file)

Parent

petalisp.specialization (system)

Location

specialization/type-codes.lisp

Exported Definitions
Internal Definitions

+types+ (constant)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.76 petalisp.specialization/type-code-utilities.lisp

Dependency

type-codes.lisp (file)

Parent

petalisp.specialization (system)

Location

specialization/type-code-utilities.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.77 petalisp.specialization/specialization-error.lisp

Dependency

type-code-utilities.lisp (file)

Parent

petalisp.specialization (system)

Location

specialization/specialization-error.lisp

Exported Definitions

abort-specialization (function)

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.78 petalisp.specialization/specialize.lisp

Dependency

specialization-error.lisp (file)

Parent

petalisp.specialization (system)

Location

specialization/specialize.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.79 petalisp.specialization/macros.lisp

Dependency

specialize.lisp (file)

Parent

petalisp.specialization (system)

Location

specialization/macros.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.80 petalisp.specialization/common-lisp/auxiliary.lisp

Parent

common-lisp (module)

Location

specialization/common-lisp/auxiliary.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.81 petalisp.specialization/common-lisp/data-and-control-flow.lisp

Parent

common-lisp (module)

Location

specialization/common-lisp/data-and-control-flow.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.82 petalisp.specialization/common-lisp/type-checks.lisp

Parent

common-lisp (module)

Location

specialization/common-lisp/type-checks.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.83 petalisp.specialization/common-lisp/casts.lisp

Parent

common-lisp (module)

Location

specialization/common-lisp/casts.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.84 petalisp.specialization/common-lisp/add.lisp

Parent

common-lisp (module)

Location

specialization/common-lisp/add.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.85 petalisp.specialization/common-lisp/sub.lisp

Parent

common-lisp (module)

Location

specialization/common-lisp/sub.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.86 petalisp.specialization/common-lisp/mul.lisp

Parent

common-lisp (module)

Location

specialization/common-lisp/mul.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.87 petalisp.specialization/common-lisp/div.lisp

Parent

common-lisp (module)

Location

specialization/common-lisp/div.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.88 petalisp.specialization/common-lisp/cmpeq.lisp

Parent

common-lisp (module)

Location

specialization/common-lisp/cmpeq.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.89 petalisp.specialization/common-lisp/cmpneq.lisp

Parent

common-lisp (module)

Location

specialization/common-lisp/cmpneq.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.90 petalisp.specialization/common-lisp/cmpx.lisp

Parent

common-lisp (module)

Location

specialization/common-lisp/cmpx.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.91 petalisp.specialization/common-lisp/min.lisp

Parent

common-lisp (module)

Location

specialization/common-lisp/min.lisp

Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

4.1.92 petalisp.specialization/common-lisp/max.lisp

Parent

common-lisp (module)

Location

specialization/common-lisp/max.lisp

Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

5.1 petalisp.api

Source

packages.lisp (file)

Nickname

petalisp

Use List
Exported Definitions

Next: , Previous: , Up: Packages   [Contents][Index]

5.2 petalisp.reference-backend

Source

packages.lisp (file)

Use List
Exported Definitions

make-reference-backend (function)

Internal Definitions

Next: , Previous: , Up: Packages   [Contents][Index]

5.3 petalisp.ir-backend

Source

packages.lisp (file)

Use List
Exported Definitions

make-ir-backend (function)

Internal Definitions

Next: , Previous: , Up: Packages   [Contents][Index]

5.4 petalisp.native-backend

Source

packages.lisp (file)

Use List
Exported Definitions

make-native-backend (function)

Internal Definitions

Next: , Previous: , Up: Packages   [Contents][Index]

5.5 petalisp.ir

Source

packages.lisp (file)

Use List
Used By List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Packages   [Contents][Index]

5.6 petalisp.core

Source

packages.lisp (file)

Use List
Used By List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Packages   [Contents][Index]

5.7 petalisp.utilities

Source

packages.lisp (file)

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Packages   [Contents][Index]

5.8 petalisp.type-codes

Source

packages.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Previous: , Up: Packages   [Contents][Index]

5.9 petalisp.specialization

Source

packages.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

6 Definitions

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


Next: , Previous: , Up: Definitions   [Contents][Index]

6.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.1 Constants

Constant: type-code-limit
Package

petalisp.type-codes

Source

type-codes.lisp (file)

Constant: type-code-limit
Package

petalisp.specialization

Source

type-codes.lisp (file)

Constant: ~
Package

petalisp.core

Source

shape.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.2 Special variables

Special Variable: *backend*
Package

petalisp.core

Source

api.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.3 Macros

Macro: defalias ALIAS FUNCTION
Package

petalisp.utilities

Source

defalias.lisp (file)

Macro: define-class-predicate CLASS-NAME &key HYPHENATE
Package

petalisp.utilities

Source

define-class-predicate.lisp (file)

Macro: define-external-rewrite-rule NAME LAMBDA-LIST &body BODY
Package

petalisp.specialization

Source

macros.lisp (file)

Macro: define-method-pair NAME &rest ARGS
Package

petalisp.utilities

Source

define-method-pair.lisp (file)

Macro: define-parallel-aliases NAME
Package

petalisp.api

Source

api.lisp (file)

Macro: define-predicate-type-inference-rule NAME TYPE

Define an inference rule for the function named NAME that is a predicate that returns - as a generalized boolean - whether its argument is of TYPE.

Examples:

(define-predicate-type-inference-rule numberp number)

(define-predicate-type-inference-rule random-state-p random-state)

Package

petalisp.type-codes

Source

type-inference.lisp (file)

Macro: define-rewrite-rules NAME TYPES LAMBDA-LIST &body BODY
Package

petalisp.specialization

Source

macros.lisp (file)

Macro: define-type-inference-rule NAME LAMBDA-LIST &body BODY

Define a type inference rule for the function with the supplied NAME.
The supplied LAMBDA-LIST must accept as many arguments as the corresponding
function, while consisting only of mandatory, optional and rest arguments.

During type inference, each statement in BODY will be evaluated in an
environment where each lambda list argument is bound to a type code. It
should return zero or more type codes, describing what values the function
will return if called with arguments of the prescribed types.

If a type inference function can determine that the call can never be
successful, it should call ABORT-TYPE-INFERENCE. If a type inference
function can determine that it won’t be able to derive any useful type
information, it should call GIVE-UP-TYPE-INFERENCE. Each type inference
rule will automatically abort when the number of supplied argument type
codes does not match LAMBDA-LIST.

Examples:

(define-type-inference-rule cl:identity (type-code)
type-code)

(define-type-inference-rule cl:values (&rest type-codes)
(values-list type-codes))

(define-type-inference-rule cl:values-list (type-code)
(give-up-type-inference))

(define-type-inference-rule cl:constantly (type-code)
(type-code-from-type-specifier ’function))

(define-type-inference-rule float-sign (type-code-1 &optional (type-code-2 type-code-1)) (check-type-code type-code-1 float)
(check-type-code type-code-2 float)
type-code-2)

Package

petalisp.type-codes

Source

type-inference.lisp (file)

Macro: defop (BASE-NAME NAME) OUTPUT-TYPES INPUT-TYPES &optional ARGUMENTS &body BODY
Package

petalisp.specialization

Source

macros.lisp (file)

Macro: type-code-subtypecase TYPE-CODE &body CLAUSES
Package

petalisp.type-codes

Source

type-code-utilities.lisp (file)

Macro: type-code-subtypecase TYPE-CODE &body CLAUSES
Package

petalisp.specialization

Source

type-code-utilities.lisp (file)

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 (file)

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 (file)

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 (file)

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 (file)

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 (file)

Macro: with-type-code-caching TYPE-CODES &body BODY
Package

petalisp.type-codes

Source

type-code-utilities.lisp (file)

Macro: with-type-code-caching TYPE-CODES &body BODY
Package

petalisp.specialization

Source

type-code-utilities.lisp (file)

Macro: with-type-inference-barrier &body BODY
Package

petalisp.type-codes

Source

type-inference.lisp (file)

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 (file)

Macro: τ INPUT-FORMS OUTPUT-FORMS
Package

petalisp.core

Source

transformation-constructors.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.4 Compiler macros

Compiler Macro: range &rest ARGS
Package

petalisp.core

Source

range.lisp (file)

Compiler Macro: type-code-from-type-specifier TYPE-SPECIFIER
Package

petalisp.type-codes

Source

type-codes.lisp (file)

Compiler Macro: type-code-from-type-specifier TYPE-SPECIFIER
Package

petalisp.specialization

Source

type-codes.lisp (file)

Compiler Macro: type-code-of OBJECT
Package

petalisp.type-codes

Source

type-codes.lisp (file)

Compiler Macro: type-code-of OBJECT
Package

petalisp.specialization

Source

type-codes.lisp (file)

Compiler Macro: ~ &rest TILDE-SEPARATED-RANGE-DESIGNATORS
Package

petalisp.core

Source

shape.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.5 Functions

Function: a 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 supplied arrays. If the supplied arrays don’t agree in shape, they are first broadcast with the function BROADCAST-ARRAYS.

Examples:

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

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

(compute (α #’* #(2 3) #2a((1 2) (3 4))))
=> #2A((2 4) (9 12))

(compute (α #’floor 7.5))
=> 1

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

(multiple-value-bind (quot rem)
(α #’floor 7.5 #(1 2 3 4 5))
(compute quot rem))
=> #(7 3 2 1 1)
=> #(0.5 1.5 1.5 3.5 2.5)

Package

petalisp.api

Source

lazy-array-constructors.lisp (file)

Function: abort-specialization ()
Package

petalisp.specialization

Source

specialization-error.lisp (file)

Function: abort-type-inference ()
Package

petalisp.type-codes

Source

type-inference.lisp (file)

Function: array-element-type-code ARRAY
Package

petalisp.type-codes

Source

type-code-utilities.lisp (file)

Function: array-element-type-code ARRAY
Package

petalisp.specialization

Source

type-code-utilities.lisp (file)

Function: assign-instruction-numbers KERNEL
Package

petalisp.ir

Source

ir.lisp (file)

Function: b 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 (β #’+ #(1 2 3 4)))
=> 10

(compute (β #’+ #2a((1 2) (3 4))))
=> #(4 6)

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

Package

petalisp.api

Source

lazy-array-constructors.lisp (file)

Function: broadcast ARRAY SHAPE
Package

petalisp.core

Source

broadcasting.lisp (file)

Function: 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:

(broadcast-arrays #(1 2 3) 5)
=> #<array-immediate #(1 2 3)>
=> #<reference (unsigned-byte 4) (~ 0 2)>

(broadcast-arrays #(2 3 4) #2a((1 2 3) (4 5 6)))
=> #<reference t (~ 0 1 ~ 0 2)>
=> #<array-immediate #2A((1 2 3) (4 5 6))>

Package

petalisp.core

Source

broadcasting.lisp (file)

Function: 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:

(petalisp.core::broadcast-list-of-arrays (list #(1 2 3) 5))
=> (#<array-immediate #(1 2 3)> #<reference (unsigned-byte 4) (~ 0 2)>)

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

Package

petalisp.core

Source

broadcasting.lisp (file)

Function: buffer-executedp INSTANCE
Function: (setf buffer-executedp) VALUE INSTANCE
Package

petalisp.ir

Source

ir.lisp (file)

Function: buffer-inputs INSTANCE
Function: (setf buffer-inputs) VALUE INSTANCE
Package

petalisp.ir

Source

ir.lisp (file)

Function: buffer-outputs INSTANCE
Function: (setf buffer-outputs) VALUE INSTANCE
Package

petalisp.ir

Source

ir.lisp (file)

Function: buffer-reusablep INSTANCE
Function: (setf buffer-reusablep) VALUE INSTANCE
Package

petalisp.ir

Source

ir.lisp (file)

Function: buffer-shape INSTANCE
Function: (setf buffer-shape) VALUE INSTANCE
Package

petalisp.ir

Source

ir.lisp (file)

Function: buffer-storage INSTANCE
Function: (setf buffer-storage) VALUE INSTANCE
Package

petalisp.ir

Source

ir.lisp (file)

Function: buffer-type-code INSTANCE
Function: (setf buffer-type-code) VALUE INSTANCE
Package

petalisp.ir

Source

ir.lisp (file)

Function: bufferp OBJECT
Package

petalisp.ir

Source

ir.lisp (file)

Function: call-instruction-operator INSTANCE
Function: (setf call-instruction-operator) VALUE INSTANCE
Package

petalisp.ir

Source

ir.lisp (file)

Function: call-instruction-p OBJECT
Package

petalisp.ir

Source

ir.lisp (file)

Function: collapsing-transformation SHAPE
Package

petalisp.core

Source

shape-transformations.lisp (file)

Function: compute &rest ARGUMENTS

Return the computed values of all ARGUMENTS.

Package

petalisp.core

Source

backend.lisp (file)

Function: empty-array ()
Package

petalisp.core

Source

lazy-array-constructors.lisp (file)

Function: empty-type-code-p TYPE-CODE
Package

petalisp.type-codes

Source

type-code-utilities.lisp (file)

Function: empty-type-code-p TYPE-CODE
Package

petalisp.specialization

Source

type-code-utilities.lisp (file)

Function: extended-euclid U V

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

Package

petalisp.utilities

Source

extended-euclid.lisp (file)

Function: fuse &rest INPUTS

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 (fuse (reshape 1 (~ 0 1))
(reshape 0 (~ 2 3))))
=> #*1100

(compute (fuse (reshape 1 (~ 0 2 6))
(reshape 0 (~ 1 2 6))))
=> #*1010101

Package

petalisp.core

Source

lazy-array-constructors.lisp (file)

Function: fuse* &rest INPUTS

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

Examples:

(compute (fuse* (reshape 1 (~ 0 3))
(reshape 0 (~ 2 3))))
=> #*1100

Package

petalisp.core

Source

lazy-array-constructors.lisp (file)

Function: give-up-type-inference ()
Package

petalisp.type-codes

Source

type-inference.lisp (file)

Function: identical SEQUENCE &key TEST KEY

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

Package

petalisp.utilities

Source

identical.lisp (file)

Function: identity-transformation RANK
Package

petalisp.core

Source

identity-transformation.lisp (file)

Function: indices ARRAY-OR-SHAPE &optional AXIS

Returns a lazy array of integers of the shape indicated by the first argument ARRAY-OR-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 (indices #2a((1 2) (3 4))))
=> #2a((0 0) (1 1))

(compute (indices #2a((1 2) (3 4)) 1))
=> #2a((0 1) (0 1))

(compute (indices (reshape #2a((1 2) (3 4)) (τ (i j) (i (1+ j)))) 1)) => #2a((1 2) (1 2))

(compute (indices "abc"))
=> #(0 1 2)

Package

petalisp.core

Source

lazy-array-constructors.lisp (file)

Function: input OBJECT
Package

petalisp.core

Source

lazy-array.lisp (file)

Function: instruction INSTRUCTION-NUMBER
Package

petalisp.ir

Source

blueprint-compiler.lisp (file)

Function: instruction-inputs INSTANCE
Function: (setf instruction-inputs) VALUE INSTANCE
Package

petalisp.ir

Source

ir.lisp (file)

Function: instruction-number INSTANCE
Function: (setf instruction-number) VALUE INSTANCE
Package

petalisp.ir

Source

ir.lisp (file)

Function: instruction-transformation INSTANCE
Function: (setf instruction-transformation) VALUE INSTANCE
Package

petalisp.ir

Source

ir.lisp (file)

Function: instructionp OBJECT
Package

petalisp.ir

Source

ir.lisp (file)

Function: ir-from-lazy-arrays LAZY-ARRAYS

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 (file)

Function: iref-instruction-p OBJECT
Package

petalisp.ir

Source

ir.lisp (file)

Function: iterating-instruction-p OBJECT
Package

petalisp.ir

Source

ir.lisp (file)

Function: kernel-blueprint KERNEL
Package

petalisp.ir

Source

blueprint.lisp (file)

Function: kernel-buffers KERNEL
Package

petalisp.ir

Source

ir.lisp (file)

Function: kernel-executedp INSTANCE
Function: (setf kernel-executedp) VALUE INSTANCE
Package

petalisp.ir

Source

ir.lisp (file)

Function: kernel-highest-instruction-number KERNEL
Package

petalisp.ir

Source

ir.lisp (file)

Function: kernel-iteration-space INSTANCE
Function: (setf kernel-iteration-space) VALUE INSTANCE
Package

petalisp.ir

Source

ir.lisp (file)

Function: kernel-number-of-loads KERNEL
Package

petalisp.ir

Source

ir.lisp (file)

Function: kernel-number-of-stores KERNEL
Package

petalisp.ir

Source

ir.lisp (file)

Function: kernel-reduction-range INSTANCE
Function: (setf kernel-reduction-range) VALUE INSTANCE
Package

petalisp.ir

Source

ir.lisp (file)

Function: kernelp OBJECT
Package

petalisp.ir

Source

ir.lisp (file)

Function: load-instruction-buffer INSTANCE
Function: (setf load-instruction-buffer) VALUE INSTANCE
Package

petalisp.ir

Source

ir.lisp (file)

Function: load-instruction-p OBJECT
Package

petalisp.ir

Source

ir.lisp (file)

Function: make-array-immediate ARRAY &optional REUSABLEP
Package

petalisp.core

Source

lazy-array-constructors.lisp (file)

Function: make-buffer ARRAY
Package

petalisp.ir

Source

ir.lisp (file)

Function: make-explicit-set SEQUENCE
Package

petalisp.core

Source

explicit-set.lisp (file)

Function: make-ir-backend ()
Package

petalisp.ir-backend

Source

ir-backend.lisp (file)

Function: make-kernel &key (ITERATION-SPACE ITERATION-SPACE) (REDUCTION-RANGE REDUCTION-RANGE) (LOAD-INSTRUCTIONS LOAD-INSTRUCTIONS) (STORE-INSTRUCTIONS STORE-INSTRUCTIONS) (EXECUTEDP EXECUTEDP)
Package

petalisp.ir

Source

ir.lisp (file)

Function: make-native-backend &key THREADS
Package

petalisp.native-backend

Source

native-backend.lisp (file)

Function: make-range START STEP END
Package

petalisp.core

Source

range.lisp (file)

Function: make-range-immediate RANGE
Package

petalisp.core

Source

lazy-array-constructors.lisp (file)

Function: make-reference-backend ()
Package

petalisp.reference-backend

Source

reference-backend.lisp (file)

Function: make-shape RANGES
Package

petalisp.core

Source

shape.lisp (file)

Function: make-transformation &key INPUT-MASK OUTPUT-MASK OFFSETS SCALINGS INPUT-RANK OUTPUT-RANK
Package

petalisp.core

Source

transformation-constructors.lisp (file)

Function: map-buffer-inputs FUNCTION BUFFER
Package

petalisp.ir

Source

ir.lisp (file)

Function: map-buffer-outputs FUNCTION BUFFER
Package

petalisp.ir

Source

ir.lisp (file)

Function: map-instruction-inputs FUNCTION INSTRUCTION
Package

petalisp.ir

Source

ir.lisp (file)

Function: map-instructions FUNCTION KERNEL
Package

petalisp.ir

Source

ir.lisp (file)

Function: map-kernel-inputs FUNCTION KERNEL
Package

petalisp.ir

Source

ir.lisp (file)

Function: map-kernel-load-instructions FUNCTION KERNEL
Package

petalisp.ir

Source

ir.lisp (file)

Function: map-kernel-outputs FUNCTION KERNEL
Package

petalisp.ir

Source

ir.lisp (file)

Function: map-kernel-store-instructions FUNCTION KERNEL
Package

petalisp.ir

Source

ir.lisp (file)

Function: map-range FUNCTION RANGE
Package

petalisp.core

Source

range.lisp (file)

Function: normalize-ir ROOT-BUFFERS

Modify the IR data flow graph specified by the supplied ROOT-BUFFERS such that it has fewer degrees of freedom. This is achieved by transforming all buffers to a zero-based coordinate system with minimal stride, and by arranging each buffer such that the kernels using it have optimal spatial locality.

In any case, the IR normalization preserves semantics.

Package

petalisp.ir

Source

ir.lisp (file)

Function: parse-kernel-blueprint BLUEPRINT
Package

petalisp.ir

Source

blueprint.lisp (file)

Function: range START &optional STEP-OR-END END
Package

petalisp.core

Source

range.lisp (file)

Function: range-contains RANGE INTEGER
Package

petalisp.core

Source

range.lisp (file)

Function: range-difference-list RANGE-1 RANGE-2
Package

petalisp.core

Source

range.lisp (file)

Function: range-end RANGE
Package

petalisp.core

Source

range.lisp (file)

Function: range-equal RANGE-1 RANGE-2
Package

petalisp.core

Source

range.lisp (file)

Function: range-intersection RANGE-1 RANGE-2
Package

petalisp.core

Source

range.lisp (file)

Function: range-intersectionp RANGE-1 RANGE-2
Package

petalisp.core

Source

range.lisp (file)

Function: range-size INSTANCE
Package

petalisp.core

Source

range.lisp (file)

Function: range-start INSTANCE
Package

petalisp.core

Source

range.lisp (file)

Function: range-start-step-end RANGE
Package

petalisp.core

Source

range.lisp (file)

Function: range-step INSTANCE
Package

petalisp.core

Source

range.lisp (file)

Function: rangep OBJECT
Package

petalisp.core

Source

range.lisp (file)

Function: reduce-instruction-operator INSTANCE
Function: (setf reduce-instruction-operator) VALUE INSTANCE
Package

petalisp.ir

Source

ir.lisp (file)

Function: reduce-instruction-p OBJECT
Package

petalisp.ir

Source

ir.lisp (file)

Function: reduction-kernel-p OBJECT
Package

petalisp.ir

Source

ir.lisp (file)

Function: reshape ARRAY &rest SHAPES-AND-TRANSFORMATIONS

Return a data structure of given SHAPE, either by selecting a subset of the elements of DATA, or by broadcasting them.

Examples:

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

(compute (reshape 0 (~ 0 1 ~ 0 1)))
=> #2A((0 0) (0 0))

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

Package

petalisp.core

Source

lazy-array-constructors.lisp (file)

Function: schedule &rest ARGUMENTS

Instruct Petalisp to compute all given ARGUMENTS asynchronously.

Package

petalisp.core

Source

backend.lisp (file)

Function: size-one-range-p RANGE
Package

petalisp.core

Source

range.lisp (file)

Function: specialize FUNCTION ARGUMENTS &key PROCESS-ARGUMENT PROCESS-CONSTANT PROCESS-CALL

Returns a list of type codes describing the set of values returned by
FUNCTION when applied to ARGUMENTS. Returns a second value that is
obtained by processing the functions, constants and arguments of the most specialized call in a user-defined manner.

Arguments:

FUNCTION - A function.

ARGUMENTS - A list of objects. Each such object must be a suitable argument
for the function PROCESS-ARGUMENT.

PROCESS-ARGUMENT - A function that is invoked once for each argument in ARGUMENTS. It must return a type code, and, optionally, an arbitrary object for further processing.

PROCESS-CONSTANT - A function that is invoked on each constant that appears
in a rewrite rule. It must return a type code, and, optionally, an
arbitrary object for further processing.

PROCESS-CALL - A function that is invoked with a first argument that is a
function name, and zero or more objects that have previously been returned
as second argument of calls to PROCESS-ARGUMENT, PROCESS-CONSTANT or
PROCESS-CALL.

Package

petalisp.specialization

Source

specialize.lisp (file)

Function: specialize-verbosely FUNCTION ARGUMENTS &key PROCESS-ARGUMENT PROCESS-CONSTANT PROCESS-CALL
Package

petalisp.specialization

Source

specialize.lisp (file)

Function: split-range RANGE
Package

petalisp.core

Source

range.lisp (file)

Function: store-instruction-buffer INSTANCE
Function: (setf store-instruction-buffer) VALUE INSTANCE
Package

petalisp.ir

Source

ir.lisp (file)

Function: store-instruction-p OBJECT
Package

petalisp.ir

Source

ir.lisp (file)

Function: subtypep-mask TYPE-SPECIFIER &optional ENV
Package

petalisp.specialization

Source

type-code-utilities.lisp (file)

Function: type-code-from-type-specifier TYPE-SPECIFIER
Package

petalisp.type-codes

Source

type-codes.lisp (file)

Function: type-code-from-type-specifier TYPE-SPECIFIER
Package

petalisp.specialization

Source

type-codes.lisp (file)

Function: type-code-of OBJECT
Package

petalisp.type-codes

Source

type-codes.lisp (file)

Function: type-code-of OBJECT
Package

petalisp.specialization

Source

type-codes.lisp (file)

Function: type-code-subtypep TYPE-CODE-1 TYPE-CODE-2
Package

petalisp.specialization

Source

type-code-utilities.lisp (file)

Function: type-code-union TYPE-CODE-1 TYPE-CODE-2
Package

petalisp.type-codes

Source

type-code-utilities.lisp (file)

Function: type-code-union TYPE-CODE-1 TYPE-CODE-2
Package

petalisp.specialization

Source

type-code-utilities.lisp (file)

Function: type-specifier-from-type-code TYPE-CODE
Package

petalisp.type-codes

Source

type-codes.lisp (file)

Function: type-specifier-from-type-code TYPE-CODE
Package

petalisp.specialization

Source

type-codes.lisp (file)

Function: values-type-codes FUNCTION &rest ARGUMENT-TYPE-CODES

Returns one or more type codes that describe what values will be returned by FUNCTION when called with arguments that match the supplied ARGUMENT-TYPE-CODES.

Returns a single value that is the empty type code, if and only if it can be determined that FUNCTION will never return for the specified argument types.

Package

petalisp.type-codes

Source

type-inference.lisp (file)

Function: ~ &rest TILDE-SEPARATED-RANGE-DESIGNATORS
Package

petalisp.core

Source

shape.lisp (file)

Function: α 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 supplied arrays. If the supplied arrays don’t agree in shape, they are first broadcast with the function BROADCAST-ARRAYS.

Examples:

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

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

(compute (α #’* #(2 3) #2a((1 2) (3 4))))
=> #2A((2 4) (9 12))

(compute (α #’floor 7.5))
=> 1

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

(multiple-value-bind (quot rem)
(α #’floor 7.5 #(1 2 3 4 5))
(compute quot rem))
=> #(7 3 2 1 1)
=> #(0.5 1.5 1.5 3.5 2.5)

Package

petalisp.core

Source

lazy-array-constructors.lisp (file)

Function: β 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 (β #’+ #(1 2 3 4)))
=> 10

(compute (β #’+ #2a((1 2) (3 4))))
=> #(4 6)

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

Package

petalisp.core

Source

lazy-array-constructors.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.6 Generic functions

Generic Function: coerce-to-lazy-array ARRAY
Package

petalisp.core

Source

lazy-array.lisp (file)

Methods
Method: coerce-to-lazy-array OBJECT
Method: coerce-to-lazy-array (ARRAY array)
Method: coerce-to-lazy-array (LAZY-ARRAY lazy-array)
Generic Function: compose-transformations G F
Package

petalisp.core

Source

transformation.lisp (file)

Methods
Method: compose-transformations (G hairy-transformation) (F hairy-transformation)
Source

hairy-transformation.lisp (file)

Method: compose-transformations (G transformation) (F identity-transformation)
Source

identity-transformation.lisp (file)

Method: compose-transformations (G identity-transformation) (F transformation)
Source

identity-transformation.lisp (file)

Method: compose-transformations (G transformation) (F transformation) before
Generic Function: compute-immediates LAZY-ARRAYS BACKEND
Package

petalisp.core

Source

backend.lisp (file)

Methods
Method: compute-immediates (LAZY-ARRAYS list) (NATIVE-BACKEND native-backend) after
Source

execution.lisp (file)

Method: compute-immediates (LAZY-ARRAYS list) (NATIVE-BACKEND native-backend)
Source

execution.lisp (file)

Method: compute-immediates (LAZY-ARRAYS list) (IR-BACKEND ir-backend)
Source

ir-backend.lisp (file)

Method: compute-immediates (LAZY-ARRAYS list) (BACKEND reference-backend) around
Source

reference-backend.lisp (file)

Method: compute-immediates (LAZY-ARRAYS list) (BACKEND reference-backend)
Source

reference-backend.lisp (file)

Generic Function: compute-on-backend LAZY-ARRAYS BACKEND
Package

petalisp.core

Source

backend.lisp (file)

Methods
Method: compute-on-backend (LAZY-ARRAYS list) (BACKEND backend)
Generic Function: delete-backend BACKEND
Package

petalisp.core

Source

backend.lisp (file)

Methods
Method: delete-backend (ASYNCHRONOUS-BACKEND asynchronous-backend)
Method: delete-backend (BACKEND backend)
Generic Function: element-type ARRAY
Package

petalisp.core

Source

lazy-array.lisp (file)

Methods
Method: element-type OBJECT
Generic Function: empty-array-p OBJECT
Package

petalisp.core

Source

lazy-array.lisp (file)

Methods
Method: empty-array-p (EMPTY-ARRAY empty-array)
Method: empty-array-p (ARRAY array)
Method: empty-array-p OBJECT
Generic Function: enlarge-shape SHAPE RANGE
Package

petalisp.core

Source

shape.lisp (file)

Methods
Method: enlarge-shape (SHAPE shape) (RANGE range)
Generic Function: enlarge-transformation TRANSFORMATION SCALE OFFSET
Package

petalisp.core

Source

transformation.lisp (file)

Methods
Method: enlarge-transformation (TRANSFORMATION hairy-transformation) SCALING OFFSET
Source

hairy-transformation.lisp (file)

Method: enlarge-transformation (TRANSFORMATION identity-transformation) (SCALE rational) (OFFSET rational)
Source

identity-transformation.lisp (file)

Method: enlarge-transformation (TRANSFORMATION identity-transformation) (SCALE (eql 1)) (OFFSET (eql 0))
Source

identity-transformation.lisp (file)

Generic Function: identity-transformation-p OBJECT
Package

petalisp.core

Source

identity-transformation.lisp (file)

Methods
Method: identity-transformation-p OBJECT
Method: identity-transformation-p (IDENTITY-TRANSFORMATION identity-transformation)
Generic Function: immediatep OBJECT
Package

petalisp.core

Source

lazy-array.lisp (file)

Methods
Method: immediatep (IMMEDIATE immediate)
Method: immediatep OBJECT
Generic Function: input-rank TRANSFORMATION
Package

petalisp.core

Source

transformation.lisp (file)

Methods
Method: input-rank (HAIRY-TRANSFORMATION hairy-transformation)

automatically generated reader method

Source

hairy-transformation.lisp (file)

Method: input-rank (IDENTITY-TRANSFORMATION identity-transformation)

automatically generated reader method

Source

identity-transformation.lisp (file)

Generic Function: inputs ARRAY
Package

petalisp.core

Source

lazy-array.lisp (file)

Methods
Method: inputs OBJECT
Method: inputs (NON-IMMEDIATE non-immediate)

automatically generated reader method

Generic Function: invert-transformation TRANSFORMATION
Package

petalisp.core

Source

transformation.lisp (file)

Methods
Method: invert-transformation (TRANSFORMATION hairy-invertible-transformation)
Source

hairy-transformation.lisp (file)

Method: invert-transformation (TRANSFORMATION transformation)
Source

invertible-transformation.lisp (file)

Method: invert-transformation (TRANSFORMATION cached-inverse-transformation-mixin) around
Source

invertible-transformation.lisp (file)

Method: invert-transformation (TRANSFORMATION identity-transformation)
Source

identity-transformation.lisp (file)

Generic Function: invertible-transformation-p OBJECT
Package

petalisp.core

Source

invertible-transformation.lisp (file)

Methods
Method: invertible-transformation-p (TRANSFORMATION invertible-transformation)
Method: invertible-transformation-p OBJECT
Generic Function: lazy-array-p OBJECT
Package

petalisp.core

Source

lazy-array.lisp (file)

Methods
Method: lazy-array-p (LAZY-ARRAY lazy-array)
Method: lazy-array-p OBJECT
Generic Function: lisp-datum-from-immediate LAZY-ARRAY
Package

petalisp.core

Source

backend.lisp (file)

Methods
Method: lisp-datum-from-immediate (SIMPLE-IMMEDIATE simple-immediate)
Source

simple-immediate.lisp (file)

Method: lisp-datum-from-immediate (RANGE-IMMEDIATE range-immediate)
Method: lisp-datum-from-immediate (ARRAY-IMMEDIATE array-immediate)
Generic Function: make-reference INPUT SHAPE TRANSFORMATION
Package

petalisp.core

Source

lazy-array-constructors.lisp (file)

Methods
Method: make-reference (LAZY-ARRAY lazy-array) (SHAPE shape) (TRANSFORMATION transformation) before
Method: make-reference (LAZY-ARRAY lazy-array) (SHAPE shape) (TRANSFORMATION transformation)
Method: make-reference (LAZY-ARRAY lazy-array) (EMPTY-SET empty-set) (TRANSFORMATION transformation)
Method: make-reference (LAZY-ARRAY lazy-array) (SHAPE shape) (IDENTITY-TRANSFORMATION identity-transformation)
Method: make-reference (REFERENCE reference) (SHAPE shape) (TRANSFORMATION transformation)
Generic Function: map-transformation-outputs FUNCTION TRANSFORMATION &key FROM-END
Package

petalisp.core

Source

transformation.lisp (file)

Methods
Method: map-transformation-outputs (FUNCTION function) (TRANSFORMATION hairy-transformation) &key FROM-END
Source

hairy-transformation.lisp (file)

Method: map-transformation-outputs (FUNCTION function) (TRANSFORMATION identity-transformation) &key FROM-END
Source

identity-transformation.lisp (file)

Generic Function: operator ARRAY
Package

petalisp.core

Source

lazy-array.lisp (file)

Methods
Method: operator (REDUCTION reduction)

automatically generated reader method

Method: operator (APPLICATION application)

automatically generated reader method

Generic Function: output-rank TRANSFORMATION
Package

petalisp.core

Source

transformation.lisp (file)

Methods
Method: output-rank (HAIRY-TRANSFORMATION hairy-transformation)

automatically generated reader method

Source

hairy-transformation.lisp (file)

Method: output-rank (IDENTITY-TRANSFORMATION identity-transformation)

automatically generated reader method

Source

identity-transformation.lisp (file)

Generic Function: overwrite-instance INSTANCE REPLACEMENT
Package

petalisp.core

Source

backend.lisp (file)

Methods
Method: overwrite-instance (INSTANCE lazy-array) (REPLACEMENT simple-immediate)
Source

simple-immediate.lisp (file)

Method: overwrite-instance (INSTANCE lazy-array) (REPLACEMENT range-immediate)
Method: overwrite-instance (INSTANCE lazy-array) (REPLACEMENT array-immediate)
Method: overwrite-instance (INSTANCE lazy-array) (REPLACEMENT reference)
Method: overwrite-instance (INSTANCE reference) (REPLACEMENT reference)
Generic Function: ranges SHAPE
Package

petalisp.core

Source

shape.lisp (file)

Methods
Method: ranges (SHAPE shape)

automatically generated reader method

Generic Function: rank SHAPE
Package

petalisp.core

Source

shape.lisp (file)

Methods
Method: rank (LAZY-ARRAY lazy-array)
Source

lazy-array.lisp (file)

Method: rank (ARRAY array)
Source

lazy-array.lisp (file)

Method: rank OBJECT
Source

lazy-array.lisp (file)

Method: rank (SHAPE shape)

automatically generated reader method

Generic Function: refcount ARRAY
Package

petalisp.core

Source

lazy-array.lisp (file)

Writer

(setf refcount) (generic function)

Methods
Method: refcount OBJECT
Method: refcount (NON-EMPTY-NON-IMMEDIATE non-empty-non-immediate)

automatically generated reader method

Generic Function: (setf refcount) NEW-VALUE OBJECT
Package

petalisp.core

Reader

refcount (generic function)

Methods
Method: (setf refcount) NEW-VALUE (NON-EMPTY-NON-IMMEDIATE non-empty-non-immediate)

automatically generated writer method

Source

lazy-array.lisp (file)

Generic Function: reusablep OBJECT
Package

petalisp.core

Source

lazy-array.lisp (file)

Methods
Method: reusablep (ARRAY-IMMEDIATE array-immediate)

automatically generated reader method

Generic Function: schedule-on-backend LAZY-ARRAYS BACKEND
Package

petalisp.core

Source

backend.lisp (file)

Methods
Method: schedule-on-backend (DATA-STRUCTURES list) (ASYNCHRONOUS-BACKEND asynchronous-backend)
Method: schedule-on-backend (LAZY-ARRAYS list) (BACKEND backend)
Generic Function: set-contains SET OBJECT
Package

petalisp.core

Source

set.lisp (file)

Methods
Method: set-contains (SHAPE shape) (TUPLE list)
Source

shape.lisp (file)

Method: set-contains (SET explicit-set) OBJECT
Source

explicit-set.lisp (file)

Method: set-contains (SET empty-set) OBJECT
Source

empty-set.lisp (file)

Method: set-contains (SET finite-set) OBJECT
Generic Function: set-difference SET-1 SET-2
Package

petalisp.core

Source

set.lisp (file)

Methods
Method: set-difference (SHAPE-1 shape) (SHAPE-2 shape)
Source

shape.lisp (file)

Method: set-difference (SET-1 finite-set) (SET-2 finite-set)
Source

explicit-set.lisp (file)

Method: set-difference (SET-1 explicit-set) (SET-2 explicit-set)
Source

explicit-set.lisp (file)

Method: set-difference (ANY-SET any-set) (EMPTY-SET empty-set)
Source

empty-set.lisp (file)

Generic Function: set-elements SET
Package

petalisp.core

Source

set.lisp (file)

Methods
Method: set-elements (SET empty-set)
Source

empty-set.lisp (file)

Method: set-elements (SET finite-set)
Generic Function: set-emptyp SET
Package

petalisp.core

Source

set.lisp (file)

Methods
Method: set-emptyp (SET empty-set)
Source

empty-set.lisp (file)

Method: set-emptyp (SET any-set)
Generic Function: set-for-each FUNCTION SET
Package

petalisp.core

Source

set.lisp (file)

Methods
Method: set-for-each (FUNCTION function) (SHAPE shape)
Source

shape.lisp (file)

Method: set-for-each (FUNCTION function) (SET explicit-set)
Source

explicit-set.lisp (file)

Method: set-for-each (FUNCTION function) (SET empty-set)
Source

empty-set.lisp (file)

Generic Function: set-intersection SET-1 SET-2
Package

petalisp.core

Source

set.lisp (file)

Methods
Method: set-intersection (SHAPE-1 shape) (SHAPE-2 shape)
Source

shape.lisp (file)

Method: set-intersection (SET-1 finite-set) (SET-2 finite-set)
Source

explicit-set.lisp (file)

Method: set-intersection (SET-1 explicit-set) (SET-2 explicit-set)
Source

explicit-set.lisp (file)

Method: set-intersection (ANY-SET any-set) (EMPTY-SET empty-set)
Source

empty-set.lisp (file)

Method: set-intersection (EMPTY-SET empty-set) (ANY-SET any-set)
Source

empty-set.lisp (file)

Generic Function: set-intersectionp SET-1 SET-2
Package

petalisp.core

Source

set.lisp (file)

Methods
Method: set-intersectionp (SHAPE-1 shape) (SHAPE-2 shape)
Source

shape.lisp (file)

Method: set-intersectionp (SET-1 explicit-set) (SET-2 explicit-set)
Source

explicit-set.lisp (file)

Method: set-intersectionp (ANY-SET any-set) (EMPTY-SET empty-set)
Source

empty-set.lisp (file)

Method: set-intersectionp (EMPTY-SET empty-set) (ANY-SET any-set)
Source

empty-set.lisp (file)

Method: set-intersectionp (SET-1 any-set) (SET-2 any-set)
Generic Function: set-size SET
Package

petalisp.core

Source

set.lisp (file)

Methods
Method: set-size (SHAPE shape)
Source

shape.lisp (file)

Method: set-size (SET explicit-set)
Source

explicit-set.lisp (file)

Method: set-size (SET empty-set)
Source

empty-set.lisp (file)

Method: set-size (SET finite-set)
Generic Function: set-subsetp SET-1 SET-2
Package

petalisp.core

Source

set.lisp (file)

Methods
Method: set-subsetp (SET-1 any-set) (SET-2 any-set)
Method: set-subsetp (SET-1 infinite-set) (SET-2 finite-set)
Generic Function: set-union SET-1 SET-2
Package

petalisp.core

Source

set.lisp (file)

Methods
Method: set-union (SET-1 explicit-set) (SET-2 explicit-set)
Source

explicit-set.lisp (file)

Method: set-union (ANY-SET any-set) (EMPTY-SET empty-set)
Source

empty-set.lisp (file)

Method: set-union (EMPTY-SET empty-set) (ANY-SET any-set)
Source

empty-set.lisp (file)

Generic Function: shape ARRAY
Package

petalisp.core

Source

lazy-array.lisp (file)

Methods
Method: shape (EMPTY-ARRAY empty-array)
Method: shape (ANY-SET any-set)
Method: shape (ARRAY array)
Method: shape OBJECT
Method: shape (NON-EMPTY-ARRAY non-empty-array)

automatically generated reader method

Generic Function: shape-difference-list SHAPE-1 SHAPE-2
Package

petalisp.core

Source

shape.lisp (file)

Methods
Method: shape-difference-list (SHAPE-1 shape) (SHAPE-2 shape)
Generic Function: shapep OBJECT
Package

petalisp.core

Source

shape.lisp (file)

Methods
Method: shapep OBJECT
Method: shapep (SHAPE shape)
Generic Function: shrink-shape SHAPE
Package

petalisp.core

Source

shape.lisp (file)

Methods
Method: shrink-shape (SHAPE shape)
Generic Function: storage ARRAY
Package

petalisp.core

Source

lazy-array.lisp (file)

Methods
Method: storage (ARRAY-IMMEDIATE array-immediate)

automatically generated reader method

Generic Function: total-size ARRAY
Package

petalisp.core

Source

lazy-array.lisp (file)

Methods
Method: total-size (NON-EMPTY-ARRAY non-empty-array)
Method: total-size (EMPTY-ARRAY empty-array)
Method: total-size (ARRAY array)
Method: total-size OBJECT
Generic Function: transform OBJECT TRANSFORMATION
Package

petalisp.core

Source

transformation.lisp (file)

Methods
Method: transform (LAZY-ARRAY lazy-array) (TRANSFORMATION transformation)
Source

lazy-array.lisp (file)

Method: transform (SHAPE shape) (TRANSFORMATION hairy-transformation)
Source

shape-transformations.lisp (file)

Method: transform (SHAPE shape) (OPERATOR identity-transformation)
Source

shape-transformations.lisp (file)

Method: transform (SHAPE shape) (TRANSFORMATION hairy-transformation) before
Source

shape-transformations.lisp (file)

Method: transform (SHAPE shape) (TRANSFORMATION transformation) before
Source

shape-transformations.lisp (file)

Method: transform (LIST list) (TRANSFORMATION hairy-transformation)
Source

hairy-transformation.lisp (file)

Method: transform (SEQUENCE sequence) (TRANSFORMATION hairy-transformation) before
Source

hairy-transformation.lisp (file)

Method: transform (SEQUENCE sequence) (OPERATOR identity-transformation)
Source

identity-transformation.lisp (file)

Method: transform (SEQUENCE sequence) (TRANSFORMATION transformation)
Generic Function: transform-axis AXIS TRANSFORMATION
Package

petalisp.core

Source

transformation.lisp (file)

Methods
Method: transform-axis (AXIS integer) (HAIRY-TRANSFORMATION hairy-transformation)
Source

hairy-transformation.lisp (file)

Method: transform-axis (AXIS integer) (TRANSFORMATION identity-transformation)
Source

identity-transformation.lisp (file)

Method: transform-axis (AXIS integer) (TRANSFORMATION transformation)
Generic Function: transformation OBJECT
Package

petalisp.core

Methods
Method: transformation (REFERENCE reference)

automatically generated reader method

Source

lazy-array.lisp (file)

Generic Function: transformation-equal TRANSFORMATION-1 TRANSFORMATION-2
Package

petalisp.core

Source

transformation.lisp (file)

Methods
Method: transformation-equal (T1 hairy-transformation) (T2 hairy-transformation)
Source

hairy-transformation.lisp (file)

Method: transformation-equal (TRANSFORMATION-1 identity-transformation) (TRANSFORMATION-2 identity-transformation)
Source

identity-transformation.lisp (file)

Method: transformation-equal (T1 transformation) (T2 transformation)
Generic Function: transformationp OBJECT
Package

petalisp.core

Source

transformation.lisp (file)

Methods
Method: transformationp OBJECT
Method: transformationp (TRANSFORMATION transformation)
Generic Function: type-code ARRAY
Package

petalisp.core

Source

lazy-array.lisp (file)

Methods
Method: type-code (EMPTY-ARRAY empty-array)
Method: type-code (ARRAY array)
Method: type-code OBJECT
Method: type-code (NON-EMPTY-ARRAY non-empty-array)

automatically generated reader method

Generic Function: value-n ARRAY
Package

petalisp.core

Source

lazy-array.lisp (file)

Methods
Method: value-n (REDUCTION reduction)

automatically generated reader method

Method: value-n (APPLICATION application)

automatically generated reader method


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.7 Structures

Structure: buffer ()
Package

petalisp.ir

Source

ir.lisp (file)

Direct superclasses

structure-object (structure)

Direct methods
Direct slots
Slot: shape
Type

petalisp.core:shape

Readers

buffer-shape (function)

Writers

(setf buffer-shape) (function)

Slot: type-code
Type

petalisp.type-codes:type-code

Readers

buffer-type-code (function)

Writers

(setf buffer-type-code) (function)

Slot: inputs
Type

list

Initform

(quote nil)

Readers

buffer-inputs (function)

Writers

(setf buffer-inputs) (function)

Slot: outputs
Type

list

Initform

(quote nil)

Readers

buffer-outputs (function)

Writers

(setf buffer-outputs) (function)

Slot: executedp
Type

boolean

Readers

buffer-executedp (function)

Writers

(setf buffer-executedp) (function)

Slot: reusablep
Type

boolean

Readers

buffer-reusablep (function)

Writers

(setf buffer-reusablep) (function)

Slot: storage
Readers

buffer-storage (function)

Writers

(setf buffer-storage) (function)

Structure: call-instruction ()
Package

petalisp.ir

Source

ir.lisp (file)

Direct superclasses

instruction (structure)

Direct methods
Direct slots
Slot: operator
Type

(or function symbol)

Readers

call-instruction-operator (function)

Writers

(setf call-instruction-operator) (function)

Structure: instruction ()
Package

petalisp.ir

Source

ir.lisp (file)

Direct superclasses

structure-object (structure)

Direct subclasses
Direct methods

instruction-values (method)

Direct slots
Slot: number
Type

fixnum

Initform

0

Readers

instruction-number (function)

Writers

(setf instruction-number) (function)

Slot: inputs
Type

list

Initform

(quote nil)

Readers

instruction-inputs (function)

Writers

(setf instruction-inputs) (function)

Structure: iref-instruction ()
Package

petalisp.ir

Source

ir.lisp (file)

Direct superclasses

iterating-instruction (structure)

Direct methods
Structure: iterating-instruction ()
Package

petalisp.ir

Source

ir.lisp (file)

Direct superclasses

instruction (structure)

Direct subclasses
Direct slots
Slot: transformation
Type

petalisp.core:transformation

Readers

instruction-transformation (function)

Writers

(setf instruction-transformation) (function)

Structure: kernel ()
Package

petalisp.ir

Source

ir.lisp (file)

Direct superclasses

structure-object (structure)

Direct methods
Direct slots
Slot: iteration-space
Type

petalisp.core:shape

Readers

kernel-iteration-space (function)

Writers

(setf kernel-iteration-space) (function)

Slot: reduction-range
Type

(or petalisp.core:range null)

Readers

kernel-reduction-range (function)

Writers

(setf kernel-reduction-range) (function)

Slot: load-instructions
Type

list

Readers

kernel-load-instructions (function)

Writers

(setf kernel-load-instructions) (function)

Slot: store-instructions
Type

list

Readers

kernel-store-instructions (function)

Writers

(setf kernel-store-instructions) (function)

Slot: executedp
Type

boolean

Readers

kernel-executedp (function)

Writers

(setf kernel-executedp) (function)

Structure: load-instruction ()
Package

petalisp.ir

Source

ir.lisp (file)

Direct superclasses

iterating-instruction (structure)

Direct methods
Direct slots
Slot: buffer
Type

petalisp.ir:buffer

Readers

load-instruction-buffer (function)

Writers

(setf load-instruction-buffer) (function)

Structure: range ()
Package

petalisp.core

Source

range.lisp (file)

Direct superclasses

structure-object (structure)

Direct methods
Direct slots
Slot: start
Type

integer

Initform

0

Readers

range-start (function)

Writers

(setf range-start) (function)

Slot: step
Type

(integer 1 *)

Initform

1

Readers

range-step (function)

Writers

(setf range-step) (function)

Slot: size
Type

(integer 1 *)

Initform

1

Readers

range-size (function)

Writers

(setf range-size) (function)

Structure: reduce-instruction ()
Package

petalisp.ir

Source

ir.lisp (file)

Direct superclasses

instruction (structure)

Direct methods
Direct slots
Slot: operator
Type

function

Readers

reduce-instruction-operator (function)

Writers

(setf reduce-instruction-operator) (function)

Structure: store-instruction ()
Package

petalisp.ir

Source

ir.lisp (file)

Direct superclasses

iterating-instruction (structure)

Direct methods
Direct slots
Slot: buffer
Type

petalisp.ir:buffer

Readers

store-instruction-buffer (function)

Writers

(setf store-instruction-buffer) (function)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.8 Classes

Class: application ()
Package

petalisp.core

Source

lazy-array.lisp (file)

Direct superclasses

non-empty-non-immediate (class)

Direct methods
Direct slots
Slot: %operator
Initargs

:operator

Readers

operator (generic function)

Slot: %value-n
Type

(integer 0 4611686018427387903)

Initargs

:value-n

Readers

value-n (generic function)

Class: array-immediate ()
Package

petalisp.core

Source

lazy-array.lisp (file)

Direct superclasses

non-empty-immediate (class)

Direct methods
Direct slots
Slot: %reusablep
Initargs

:reusablep

Readers

reusablep (generic function)

Slot: %storage
Initargs

:storage

Readers

storage (generic function)

Class: asynchronous-backend ()
Package

petalisp.core

Source

backend.lisp (file)

Direct superclasses

backend (class)

Direct subclasses

native-backend (class)

Direct methods
Direct slots
Slot: %scheduler-queue
Initform

(lparallel.queue:make-queue)

Readers

scheduler-queue (generic function)

Slot: %scheduler-thread
Readers

scheduler-thread (generic function)

Writers

(setf scheduler-thread) (generic function)

Class: backend ()
Package

petalisp.core

Source

backend.lisp (file)

Direct superclasses

standard-object (class)

Direct subclasses
Direct methods
Class: empty-array ()
Package

petalisp.core

Source

lazy-array.lisp (file)

Direct superclasses

immediate (class)

Direct methods
Class: fusion ()
Package

petalisp.core

Source

lazy-array.lisp (file)

Direct superclasses

non-empty-non-immediate (class)

Direct methods
Class: identity-transformation ()
Package

petalisp.core

Source

identity-transformation.lisp (file)

Direct superclasses

invertible-transformation (class)

Direct methods
Direct slots
Slot: %rank
Type

(integer 0 *)

Initargs

:rank

Readers
Class: immediate ()
Package

petalisp.core

Source

lazy-array.lisp (file)

Direct superclasses

lazy-array (class)

Direct subclasses
Direct methods
Class: lazy-array ()
Package

petalisp.core

Source

lazy-array.lisp (file)

Direct superclasses

standard-object (class)

Direct subclasses
Direct methods
Class: non-empty-array ()
Package

petalisp.core

Source

lazy-array.lisp (file)

Direct superclasses

lazy-array (class)

Direct subclasses
Direct methods
Direct slots
Slot: %shape
Initargs

:shape

Readers
  • shape (generic function)
  • shape (generic function)
Slot: %type-code