accelerate-0.9.0.1: An embedded language for accelerated array processing

Portabilitynon-portable (GHC extensions)
Stabilityexperimental
MaintainerManuel M T Chakravarty <chak@cse.unsw.edu.au>
Safe HaskellNone

Data.Array.Accelerate.Analysis.Type

Contents

Description

The Accelerate AST does not explicitly store much type information. Most of it is only indirectly through type class constraints -especially, Elt constraints- available. This module provides functions that reify that type information in the form of a TupleType value. This is, for example, needed to emit type information in a backend.

Synopsis

Query AST types

type AccType acc = forall aenv sh e. acc aenv (Array sh e) -> TupleType (EltRepr e)Source

Determine the type of an expressions -------------------------------------

type AccType2 acc = forall aenv sh1 e1 sh2 e2. acc aenv (Array sh1 e1, Array sh2 e2) -> (TupleType (EltRepr e1), TupleType (EltRepr e2))Source

arrayType :: forall sh e. Array sh e -> TupleType (EltRepr e)Source

Determine an array type ------------------------

Reify the element type of an array.

accType :: AccType OpenAccSource

Reify the element type of the result of an array computation.

accType2 :: AccType2 OpenAccSource

Reify the element types of the results of an array computation that yields two arrays.

expType :: OpenExp aenv env t -> TupleType (EltRepr t)Source

Reify the result type of a scalar expression.

sizeOf :: TupleType a -> IntSource

Size of a tuple type, in bytes

preAccType :: forall acc aenv sh e. AccType acc -> PreOpenAcc acc aenv (Array sh e) -> TupleType (EltRepr e)Source

Reify the element type of the result of an array computation using the array computation AST before tying the knot.

preAccType2 :: forall acc aenv sh1 e1 sh2 e2. AccType acc -> AccType2 acc -> PreOpenAcc acc aenv (Array sh1 e1, Array sh2 e2) -> (TupleType (EltRepr e1), TupleType (EltRepr e2))Source

Reify the element types of the results of an array computation that yields two arrays using the array computation AST before tying the knot.

preExpType :: forall acc aenv env t. AccType acc -> PreOpenExp acc aenv env t -> TupleType (EltRepr t)Source

Reify the result types of of a scalar expression using the expression AST before tying the knot.