![]() |
GeNN
3.3.0
GPU enhanced Neuronal Networks (GeNN)
|
This file contains standard utility functions provide within the NVIDIA CUDA software development toolkit (SDK). The remainder of the file contains a function that defines the standard neuron models. More...
#include <cstdlib>#include <iostream>#include <string>#include <cuda.h>#include <cuda_runtime.h>Go to the source code of this file.
Macros | |
| #define | _UTILS_H_ |
| macro for avoiding multiple inclusion during compilation More... | |
| #define | CHECK_CU_ERRORS(call) call |
| Macros for catching errors returned by the CUDA driver and runtime APIs. More... | |
| #define | CHECK_CUDA_ERRORS(call) |
| #define | B(x, i) ((x) & (0x80000000 >> (i))) |
| Bit tool macros. More... | |
| #define | setB(x, i) x= ((x) | (0x80000000 >> (i))) |
| Set the bit at the specified position i in x to 1. More... | |
| #define | delB(x, i) x= ((x) & (~(0x80000000 >> (i)))) |
| Set the bit at the specified position i in x to 0. More... | |
| #define | USE(expr) do { (void)(expr); } while (0) |
| Miscellaneous macros. More... | |
Functions | |
| CUresult | cudaFuncGetAttributesDriver (cudaFuncAttributes *attr, CUfunction kern) |
| Function for getting the capabilities of a CUDA device via the driver API. More... | |
| void | gennError (const string &error) |
| Function called upon the detection of an error. Outputs an error message and then exits. More... | |
| size_t | theSize (const string &type) |
| Tool for determining the size of variable types on the current architecture. More... | |
| void | writeHeader (CodeStream &os) |
| Function to write the comment header denoting file authorship and contact details into the generated code. More... | |
This file contains standard utility functions provide within the NVIDIA CUDA software development toolkit (SDK). The remainder of the file contains a function that defines the standard neuron models.
| #define _UTILS_H_ |
macro for avoiding multiple inclusion during compilation
| #define B | ( | x, | |
| i | |||
| ) | ((x) & (0x80000000 >> (i))) |
Bit tool macros.
Extract the bit at the specified position i from x
| #define CHECK_CU_ERRORS | ( | call | ) | call |
Macros for catching errors returned by the CUDA driver and runtime APIs.
| #define CHECK_CUDA_ERRORS | ( | call | ) |
| #define delB | ( | x, | |
| i | |||
| ) | x= ((x) & (~(0x80000000 >> (i)))) |
Set the bit at the specified position i in x to 0.
| #define setB | ( | x, | |
| i | |||
| ) | x= ((x) | (0x80000000 >> (i))) |
Set the bit at the specified position i in x to 1.
| #define USE | ( | expr | ) | do { (void)(expr); } while (0) |
Miscellaneous macros.
Silence 'unused parameter' warnings
| CUresult cudaFuncGetAttributesDriver | ( | cudaFuncAttributes * | attr, |
| CUfunction | kern | ||
| ) |
Function for getting the capabilities of a CUDA device via the driver API.
|
inline |
Function called upon the detection of an error. Outputs an error message and then exits.
| size_t theSize | ( | const string & | type | ) |
Tool for determining the size of variable types on the current architecture.
| void writeHeader | ( | CodeStream & | os | ) |
Function to write the comment header denoting file authorship and contact details into the generated code.