synthesizer-llvm-0.9: Efficient signal processing using runtime compilation

Safe HaskellNone

Synthesizer.LLVM.Parameterized.SignalPacked

Description

Signal generators that generate the signal in chunks that can be processed natively by the processor. Some of the functions for plain signals can be re-used without modification. E.g. rendering a signal and reading from and to signals work because the vector type as element type warrents correct alignment. We can convert between atomic and chunked signals.

The article http://perilsofparallel.blogspot.com/2008/09/larrabee-vs-nvidia-mimd-vs-simd.html explains the difference between Vector and SIMD computing. According to that the SSE extensions in Intel processors must be called Vector computing. But since we use the term Vector already in the mathematical sense, I like to use the term packed that is used in Intel mnemonics like mulps.

Synopsis

Documentation

pack :: (C signal, C v, a ~ Element v) => signal a -> signal vSource

Convert a signal of scalar values into one using processor vectors. If the signal length is not divisible by the chunk size, then the last chunk is dropped.

packRotate :: (C signal, C v, a ~ Element v) => signal a -> signal vSource

Convert a signal of scalar values into one using processor vectors. If the signal length is not divisible by the chunk size, then the last chunk is dropped.

packSmall :: (C signal, C v, a ~ Element v) => signal a -> signal vSource

Like pack but duplicates the code for creating elements. That is, for vectors of size n, the code of the input signal will be emitted n times. This is efficient only for simple input generators.

unpack :: (C signal, Read v, a ~ Element v, ReadIt v ~ itv, C itv) => signal v -> signal aSource

unpackRotate :: (C signal, Read v, a ~ Element v, ReadIt v ~ itv, C itv) => signal v -> signal aSource

constant :: (Vector n a, ValueOf a ~ Value a, IsConst a, VectorValueOf n a ~ Value (Vector n a), IsPrimitive a, SizeOf a ~ asize, Positive (n :*: asize), Positive n) => T p a -> T p (Value n a)Source

exponential2 :: (C a, Vector n a, ValueOf a ~ Value a, VectorValueOf n a ~ Value (Vector n a), IsArithmetic a, IsConst a, IsPrimitive a, SizeOf a ~ asize, Positive (n :*: asize), Positive n) => T p a -> T p a -> T p (Value n a)Source

exponentialBounded2 :: (C a, Vector n a, ValueOf a ~ Value a, VectorValueOf n a ~ Value (Vector n a), Real a, IsConst a, IsPrimitive a, SizeOf a ~ as, Positive (n :*: as), Positive n) => T p a -> T p a -> T p a -> T p (Value n a)Source

osciCore :: (Vector n t, ValueOf t ~ Value t, VectorValueOf n t ~ Value (Vector n t), IsPrimitive t, SizeOf t ~ tsize, Positive (n :*: tsize), Real t, IsFloating t, C t, IsConst t, Positive n) => T p t -> T p t -> T p (Value n t)Source

osci :: (Vector n t, ValueOf t ~ Value t, C c, ValueOf c ~ cl, VectorValueOf n t ~ Value (Vector n t), IsPrimitive t, SizeOf t ~ tsize, Positive (n :*: tsize), C cl, Real t, IsFloating t, C t, IsConst t, Positive n) => (forall r. cl -> Value n t -> CodeGenFunction r y) -> T p c -> T p t -> T p t -> T p ySource

osciSimple :: (Vector n t, ValueOf t ~ Value t, VectorValueOf n t ~ Value (Vector n t), IsPrimitive t, SizeOf t ~ tsize, Positive (n :*: tsize), Real t, IsFloating t, C t, IsConst t, Positive n) => (forall r. Value n t -> CodeGenFunction r y) -> T p t -> T p t -> T p ySource

parabolaFadeInInf :: (C a, Vector n a, ValueOf a ~ Value a, VectorValueOf n a ~ Value (Vector n a), IsPrimitive a, SizeOf a ~ as, Positive (n :*: as), IsArithmetic a, IntegerConstant a, Positive n) => T p a -> T p (Value n a)Source

parabolaFadeOutInf :: (C a, Vector n a, ValueOf a ~ Value a, VectorValueOf n a ~ Value (Vector n a), IsPrimitive a, SizeOf a ~ as, Positive (n :*: as), IsArithmetic a, IntegerConstant a, Positive n) => T p a -> T p (Value n a)Source

rampInf :: (C a, Vector n a, ValueOf a ~ Value a, VectorValueOf n a ~ Value (Vector n a), IsPrimitive a, SizeOf a ~ as, Positive (n :*: as), IsArithmetic a, IntegerConstant a, Positive n) => T p a -> T p (Value n a)Source

rampSlope :: (C a, Vector n a, ValueOf a ~ Value a, VectorValueOf n a ~ Value (Vector n a), IsPrimitive a, SizeOf a ~ as, Positive (n :*: as), IsArithmetic a, IntegerConstant a, Positive n) => T p a -> T p (Value n a)Source

noise :: (C a, IsFloating a, IntegerConstant a, Positive n, Positive (n :*: D32), IsPrimitive a, SizeOf a ~ as, Positive (n :*: as), Vector n a, VectorValueOf n a ~ Value (Vector n a), ValueOf a ~ Value a) => T p Word32 -> T p a -> T p (Value n a)Source

For the mysterious rate parameter see noise.