Advanced Multi-Physics (AMP)
On-Line Documentation
testGPUAllocators.cu
Go to the documentation of this file.
1#include "AMP/utils/cuda/testGPUAllocators.hpp"
2#include <cuda.h>
3
4
5template<typename T>
6__global__ void operateDataKernel( T *d_A )
7{
8 d_A[threadIdx.x] += 1;
9}
10
11template<typename T>
12__global__ void setDataKernel( T *d_A, T v )
13{
14 d_A[threadIdx.x] = v;
15}
16
17template<typename T>
18void setDataW( T *d_A, T v, size_t n )
19{
20 setDataKernel<T><<<1, n>>>( d_A, v );
21}
22
23template<typename T>
24void opDataW( T *d_A, size_t n )
25{
26 operateDataKernel<T><<<1, n>>>( d_A );
27}
28
29template void opDataW<double>( double *d_A, size_t n );
30template void setDataW<double>( double *d_A, double v, size_t n );
31
32template void opDataW<float>( float *d_A, size_t n );
33template void setDataW<float>( float *d_A, float v, size_t n );



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:41.
Comments on this page