|
| #define | ACTIVATION(name, body) |
| | Macro for defining custom activations.
|
| |
Shorthand for creating a class and overloading the 'operator()'-function.
- Note
- Functors are needed because CUDA function pointers are not (easily) accessible from host code.
◆ ACTIVATION
| #define ACTIVATION |
( |
|
name, |
|
|
|
body |
|
) |
| |
Value: template <typename T> \
class name \
{ \
public: \
cudaFn T operator()(const T x) const body \
};
Macro for defining custom activations.
- Parameters
-
| name | Functor name |
| body | Function body (input as parameter 'x') |