CUDA utilities. More...
#include <iostream>#include <cuda.h>#include <cuda_runtime.h>#include "../parameter.h"#include <assert.h>
Include dependency graph for cuda_utilities.cuh:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Namespaces | |
| namespace | CudaUtils |
| namespace | CudaUtils::Kernel |
| namespace | CudaUtils::Kernel::Launch |
| namespace | cuda |
| namespace | cuda::math |
| Device/CUDA math functions. | |
Macros | |
| #define | MILUPHPC_CUDAUTILITIES_CUH |
| #define | CUDA_CALLABLE_MEMBER |
| #define | safeCudaCall(call) checkCudaCall(call, #call, __FILE__, __LINE__) |
| check CUDA call More... | |
| #define | gpuErrorcheck(ans) { gpuAssert((ans), __FILE__, __LINE__); } |
| check CUDA call More... | |
| #define | cudaAssert(...) |
| #define | cudaTerminate(...) |
Functions | |
| void | gpuAssert (cudaError_t code, const char *file, int line, bool abort=true) |
| Check CUDA error codes. More... | |
| void | checkCudaCall (cudaError_t command, const char *commandName, const char *fileName, int line) |
| Check CUDA call. More... | |
| __global__ void | CudaUtils::Kernel::collectValues (integer *indices, real *entries, real *collector, integer count) |
| __global__ void | CudaUtils::Kernel::checkValues (integer *indices, real *entry1, real *entry2, real *entry3, integer count) |
| template<typename T > | |
| __global__ void | CudaUtils::Kernel::findDuplicates (T *array, integer *duplicateCounter, int length) |
| template<typename T > | |
| __global__ void | CudaUtils::Kernel::findDuplicateEntries (T *array1, T *array2, integer *duplicateCounter, int length) |
| template<typename T > | |
| __global__ void | CudaUtils::Kernel::findDuplicateEntries (T *array1, T *array2, T *array3, integer *duplicateCounter, int length) |
| template<typename T , typename U > | |
| __global__ void | CudaUtils::Kernel::findDuplicates (T *array, U *entry1, U *entry2, integer *duplicateCounter, int length) |
| template<typename T > | |
| __global__ void | CudaUtils::Kernel::markDuplicates (T *array, integer *duplicateCounter, int length) |
| template<typename T , typename U > | |
| __global__ void | CudaUtils::Kernel::markDuplicates (T *array, U *entry1, U *entry2, U *entry3, integer *duplicateCounter, integer *child, int length) |
| template<typename T > | |
| __global__ void | CudaUtils::Kernel::removeDuplicates (T *array, T *removedArray, integer *duplicateCounter, int length) |
| real | CudaUtils::Kernel::Launch::collectValues (integer *indices, real *entries, real *collector, integer count) |
| real | CudaUtils::Kernel::Launch::checkValues (integer *indices, real *entry1, real *entry2, real *entry3, integer count) |
| template<typename T > | |
| real | CudaUtils::Kernel::Launch::findDuplicates (T *array, integer *duplicateCounter, int length) |
| template<typename T > | |
| real | CudaUtils::Kernel::Launch::findDuplicateEntries (T *array1, T *array2, integer *duplicateCounter, int length) |
| template<typename T > | |
| real | CudaUtils::Kernel::Launch::findDuplicateEntries (T *array1, T *array2, T *array3, integer *duplicateCounter, int length) |
| template<typename T , typename U > | |
| real | CudaUtils::Kernel::Launch::findDuplicates (T *array, U *entry1, U *entry2, integer *duplicateCounter, int length) |
| template<typename T > | |
| real | CudaUtils::Kernel::Launch::markDuplicates (T *array, integer *duplicateCounter, int length) |
| template<typename T , typename U > | |
| real | CudaUtils::Kernel::Launch::markDuplicates (T *array, U *entry1, U *entry2, U *entry3, integer *duplicateCounter, integer *child, int length) |
| template<typename T > | |
| real | CudaUtils::Kernel::Launch::removeDuplicates (T *array, T *removedArray, integer *duplicateCounter, int length) |
| __device__ real | cuda::math::min (real a, real b) |
| Minimum value out of two floating point values. More... | |
| __device__ real | cuda::math::min (real a, real b, real c) |
| Minimum value out of three floating point values. More... | |
| __device__ real | cuda::math::max (real a, real b) |
| Maximum value out of two floating point values. More... | |
| __device__ real | cuda::math::max (real a, real b, real c) |
| Maximum value out of three floating point values. More... | |
| __device__ real | cuda::math::abs (real a) |
| Absolute value of a floating point value. More... | |
| __device__ real | cuda::math::sqrt (real a) |
| Square root of a floating point value. More... | |
| __device__ real | cuda::math::rsqrt (real a) |
| Inverse square root of a floating point value. More... | |
CUDA utilities.
CUDA utilities like:
Definition in file cuda_utilities.cuh.
| #define CUDA_CALLABLE_MEMBER |
Definition at line 30 of file cuda_utilities.cuh.
| #define cudaAssert | ( | ... | ) |
Somewhat of an assertion, printing warning and/or terminating in dependence of SAFETY_LEVEL
Definition at line 50 of file cuda_utilities.cuh.
| #define cudaTerminate | ( | ... | ) |
Terminate from within CUDA kernel using assert(0)
Definition at line 70 of file cuda_utilities.cuh.
| #define gpuErrorcheck | ( | ans | ) | { gpuAssert((ans), __FILE__, __LINE__); } |
check CUDA call
Definition at line 41 of file cuda_utilities.cuh.
| #define MILUPHPC_CUDAUTILITIES_CUH |
Definition at line 19 of file cuda_utilities.cuh.
| #define safeCudaCall | ( | call | ) | checkCudaCall(call, #call, __FILE__, __LINE__) |
check CUDA call
Definition at line 36 of file cuda_utilities.cuh.
| void checkCudaCall | ( | cudaError_t | command, |
| const char * | commandName, | ||
| const char * | fileName, | ||
| int | line | ||
| ) |
Check CUDA call.
| command | |
| commandName | |
| fileName | |
| line |
Definition at line 30 of file cuda_utilities.cu.
| void gpuAssert | ( | cudaError_t | code, |
| const char * | file, | ||
| int | line, | ||
| bool | abort = true |
||
| ) |
Check CUDA error codes.
| code | CUDA error code |
| file | File |
| line | Line |
| abort | Abort in case of error |
Definition at line 21 of file cuda_utilities.cu.