#include <stdio.h>#include <stdlib.h>#include <string.h>#include "AMP/utils/UtilityMacros.h"#include "AMP/utils/cuda/helper_string.h"#include "StackTrace/source_location.h"#include <cuda.h>#include <cuda_runtime.h>
Go to the source code of this file.
Namespaces | |
| namespace | AMP |
| namespace | AMP::Utilities |
Macros | |
| #define | DEVICE_RESET |
| #define | deviceBind(...) checkCudaErrors( cudaSetDevice( __VA_ARGS__ ) ) |
| #define | deviceFree(...) checkCudaErrors( cudaFree( __VA_ARGS__ ) ) |
| #define | deviceGetCount(...) checkCudaErrors( cudaGetDeviceCount( __VA_ARGS__ ) ) |
| #define | deviceId(...) checkCudaErrors( cudaGetDevice( __VA_ARGS__ ) ) |
| #define | deviceInit(...) checkCudaErrors( cuInit( __VA_ARGS__ ) ) |
| #define | deviceMalloc(...) checkCudaErrors( cudaMalloc( __VA_ARGS__ ) ) |
| #define | deviceMallocManaged(...) checkCudaErrors( cudaMallocManaged( __VA_ARGS__ ) ) |
| #define | deviceMemAttachGlobal cudaMemAttachGlobal |
| #define | deviceMemcpy(...) checkCudaErrors( cudaMemcpy( __VA_ARGS__ ) ) |
| #define | deviceMemcpyDeviceToDevice cudaMemcpyDeviceToDevice |
| #define | deviceMemcpyDeviceToHost cudaMemcpyDeviceToHost |
| #define | deviceMemcpyHostToDevice cudaMemcpyHostToDevice |
| #define | deviceMemPrefetchAsync(...) checkCudaErrors( cudaMemPrefetchAsync( __VA_ARGS__ ) ) |
| #define | deviceMemset(...) checkCudaErrors( cudaMemset( __VA_ARGS__ ) ) |
| #define | deviceSynchronize() checkCudaErrors( cudaDeviceSynchronize() ) |
| #define | EXIT_WAIVED 2 |
| #define | hostDeviceId cudaCpuDeviceId |
| #define | MAX(a, b) ( a > b ? a : b ) |
Functions | |
| int | _ConvertSMVer2Cores (int major, int minor) |
| template<typename T > | |
| void | checkCudaErrors (T result, const StackTrace::source_location &source=SOURCE_LOCATION_CURRENT()) |
| template<typename T > | |
| const char * | cudaGetName (T result) |
| int | ftoi (float value) |
| AMP::Utilities::MemoryType | getCudaMemoryType (const void *ptr) |
| void | getLastDeviceError (const char *errorMessage, const StackTrace::source_location &source=SOURCE_LOCATION_CURRENT()) |
| static void | setKernelDims (size_t n, dim3 &BlockDim, dim3 &GridDim) |
| #define DEVICE_RESET |
Definition at line 48 of file Helper_Cuda.h.
| #define deviceBind | ( | ... | ) | checkCudaErrors( cudaSetDevice( __VA_ARGS__ ) ) |
Definition at line 26 of file Helper_Cuda.h.
| #define deviceFree | ( | ... | ) | checkCudaErrors( cudaFree( __VA_ARGS__ ) ) |
Definition at line 33 of file Helper_Cuda.h.
| #define deviceGetCount | ( | ... | ) | checkCudaErrors( cudaGetDeviceCount( __VA_ARGS__ ) ) |
Definition at line 25 of file Helper_Cuda.h.
| #define deviceId | ( | ... | ) | checkCudaErrors( cudaGetDevice( __VA_ARGS__ ) ) |
Definition at line 27 of file Helper_Cuda.h.
| #define deviceInit | ( | ... | ) | checkCudaErrors( cuInit( __VA_ARGS__ ) ) |
Definition at line 24 of file Helper_Cuda.h.
| #define deviceMalloc | ( | ... | ) | checkCudaErrors( cudaMalloc( __VA_ARGS__ ) ) |
Definition at line 29 of file Helper_Cuda.h.
| #define deviceMallocManaged | ( | ... | ) | checkCudaErrors( cudaMallocManaged( __VA_ARGS__ ) ) |
Definition at line 30 of file Helper_Cuda.h.
| #define deviceMemAttachGlobal cudaMemAttachGlobal |
Definition at line 18 of file Helper_Cuda.h.
| #define deviceMemcpy | ( | ... | ) | checkCudaErrors( cudaMemcpy( __VA_ARGS__ ) ) |
Definition at line 31 of file Helper_Cuda.h.
| #define deviceMemcpyDeviceToDevice cudaMemcpyDeviceToDevice |
Definition at line 22 of file Helper_Cuda.h.
| #define deviceMemcpyDeviceToHost cudaMemcpyDeviceToHost |
Definition at line 21 of file Helper_Cuda.h.
| #define deviceMemcpyHostToDevice cudaMemcpyHostToDevice |
Definition at line 20 of file Helper_Cuda.h.
| #define deviceMemPrefetchAsync | ( | ... | ) | checkCudaErrors( cudaMemPrefetchAsync( __VA_ARGS__ ) ) |
Definition at line 34 of file Helper_Cuda.h.
| #define deviceMemset | ( | ... | ) | checkCudaErrors( cudaMemset( __VA_ARGS__ ) ) |
Definition at line 32 of file Helper_Cuda.h.
| #define deviceSynchronize | ( | ) | checkCudaErrors( cudaDeviceSynchronize() ) |
Definition at line 28 of file Helper_Cuda.h.
| #define EXIT_WAIVED 2 |
Definition at line 38 of file Helper_Cuda.h.
| #define hostDeviceId cudaCpuDeviceId |
Definition at line 16 of file Helper_Cuda.h.
| #define MAX | ( | a, | |
| b | |||
| ) | ( a > b ? a : b ) |
Definition at line 75 of file Helper_Cuda.h.
|
inline |
Definition at line 85 of file Helper_Cuda.h.
| void checkCudaErrors | ( | T | result, |
| const StackTrace::source_location & | source = SOURCE_LOCATION_CURRENT() |
||
| ) |
| const char * cudaGetName | ( | T | result | ) |
|
inline |
Definition at line 79 of file Helper_Cuda.h.
| AMP::Utilities::MemoryType getCudaMemoryType | ( | const void * | ptr | ) |
| void getLastDeviceError | ( | const char * | errorMessage, |
| const StackTrace::source_location & | source = SOURCE_LOCATION_CURRENT() |
||
| ) |
|
inlinestatic |
Definition at line 139 of file Helper_Cuda.h.
|
Advanced Multi-Physics (AMP) Oak Ridge National Laboratory Idaho National Laboratory Los Alamos National Laboratory |
This page automatically produced from the source code by Last updated: Tue Mar 10 2026 13:06:41. Comments on this page |