#include <MTLComputeGPU.hpp>
|
| | GPU (std::string libname, std::string functionName) |
| | Constructor for the GPU class.
|
| |
| | GPU () |
| | Default constructor for the GPU class.
|
| |
| | ~GPU () |
| | Destructor for the GPU class.
|
| |
| void | loadKernel (std::string libname, std::string functionName) |
| | Load a metal library and function.
|
| |
| void | loadArray (std::vector< T > &array, int index) |
| | Load an array into the GPU.
|
| |
| void | loadMatrix (std::vector< std::vector< T > > &matrix, int index) |
| | Load a matrix into the GPU.
|
| |
| void | runKernel () |
| | Run the kernel.
|
| |
| std::vector< T > | getArray (int index) |
| | Get an array from the GPU.
|
| |
| std::vector< std::vector< T > > | getMatrix (int index) |
| | Get a matrix from the GPU.
|
| |
| void | reset () |
| | Reset the GPU.
|
| |
| MTL::Device * | getGPU () |
| | Get the GPU device.
|
| |
|
| void | checkloaded () |
| | Check if the kernel has been loaded.
|
| |
◆ GPU() [1/2]
template<typename T >
| MTLCompute::GPU< T >::GPU |
( |
std::string | libname, |
|
|
std::string | functionName ) |
|
inline |
Constructor for the GPU class.
Takes in the name of the Metal library and the name of the function and creates a new GPU object, MTLCompute::Kernel object, and MTLCompute::CommandManager object
- Parameters
-
| libname | The name of the Metal library |
| functionName | The name of the function |
◆ GPU() [2/2]
◆ ~GPU()
Destructor for the GPU class.
Releases the GPU object
◆ checkloaded()
Check if the kernel has been loaded.
If the kernel has not been loaded, print an error message
◆ getArray()
Get an array from the GPU.
Takes in an index and returns the array at that index
- Parameters
-
| index | The index of the array |
- Returns
- The array at the index
◆ getGPU()
Get the GPU device.
- Returns
- The GPU device
◆ getMatrix()
template<typename T >
| std::vector< std::vector< T > > MTLCompute::GPU< T >::getMatrix |
( |
int | index | ) |
|
|
inline |
Get a matrix from the GPU.
Takes in an index and returns the matrix at that index
- Parameters
-
| index | The index of the matrix |
- Returns
- The matrix at the index
◆ loadArray()
template<typename T >
| void MTLCompute::GPU< T >::loadArray |
( |
std::vector< T > & | array, |
|
|
int | index ) |
|
inline |
Load an array into the GPU.
Takes in a vector of type T and an index and loads the array into the GPU at that index
- Parameters
-
| array | The array to load |
| index | The index to load the array into |
◆ loadKernel()
template<typename T >
| void MTLCompute::GPU< T >::loadKernel |
( |
std::string | libname, |
|
|
std::string | functionName ) |
|
inline |
Load a metal library and function.
Takes in the name of the Metal library and the name of the function and creates a new MTLCompute::Kernel object and MTLCompute::CommandManager object
- Parameters
-
| libname | The name of the Metal library |
| functionName | The name of the function |
◆ loadMatrix()
template<typename T >
| void MTLCompute::GPU< T >::loadMatrix |
( |
std::vector< std::vector< T > > & | matrix, |
|
|
int | index ) |
|
inline |
Load a matrix into the GPU.
Takes in a vector of vectors of type T and an index and loads the matrix into the GPU at that index
- Parameters
-
| matrix | The matrix to load |
| index | The index to load the matrix into |
◆ reset()
Reset the GPU.
Resets the command manager
◆ runKernel()
Run the kernel.
Dispatches the command manager
◆ commandManager
The MetalCompute command manager object.
◆ gpu
◆ kernel
The MetalCompute kernel object.
◆ kernelLoaded
Whether the kernel has been loaded.
The documentation for this class was generated from the following file: