CellularAutomata
Loading...
Searching...
No Matches
CellularAutomata::Kernel< T > Class Template Reference

2D convolution kernel More...

#include <common.hpp>

Public Member Functions

 Kernel (const unsigned int size, kernelFunc< T > fn, Device device)
 Initalizes a kernel.
 
 ~Kernel ()
 Frees dynamically allocated memory.
 
void copyTo (Kernel< T > *to)
 Copy the own kernel array to another kernel array across devices.
 
void print ()
 Prints the kernel array.
 

Public Attributes

T * kernel
 2D Matrix
 
const unsigned int size
 Side length of matrix.
 
const Device device
 Computational device.
 

Detailed Description

template<typename T>
class CellularAutomata::Kernel< T >

2D convolution kernel

Template Parameters
Ttype

Constructor & Destructor Documentation

◆ Kernel()

template<typename T >
CellularAutomata::Kernel< T >::Kernel ( const unsigned int  size,
kernelFunc< T >  fn,
Device  device 
)

Initalizes a kernel.

Parameters
sizeside length of kernel (always square)
fnfunction to fill the kernel. May be 'nullptr'
devicecomputational device
Exceptions
DeviceNotAvailable

Member Function Documentation

◆ copyTo()

template<typename T >
void CellularAutomata::Kernel< T >::copyTo ( Kernel< T > *  to)

Copy the own kernel array to another kernel array across devices.

Parameters
toother kernel
Exceptions
ShapesUnequal

The documentation for this class was generated from the following files: