GPU Workshop Sample Code
 All Data Structures Namespaces Files Functions Variables Macros Pages
Functions | Variables
deviceQualifier.cu File Reference

This sample demonstrates the __device__ qualifier. More...

#include "../include/mycuda.h"

Go to the source code of this file.

Functions

__device__ float XplusY_dev (float x, float y)
 Device function (called by kernel). More...
 
__global__ void XplusY ()
 CUDA Kernel. Uses global device variables x_d, y_d, and z_d. More...
 
int main ()
 

Variables

const int n =8192
 Size of device vectors (needed for static allocations). More...
 
__device__ float x_d [n]
 Static allocation of global device variable. More...
 
__device__ float y_d [n]
 Static allocation of global device variable. More...
 
__device__ float z_d [n]
 Static allocation of global device variable. More...
 

Detailed Description

This sample demonstrates the __device__ qualifier.

Notes

Definition in file deviceQualifier.cu.

Function Documentation

int main ( void  )

Definition at line 37 of file deviceQualifier.cu.

__global__ void XplusY ( )

CUDA Kernel. Uses global device variables x_d, y_d, and z_d.

Definition at line 27 of file deviceQualifier.cu.

__device__ float XplusY_dev ( float  x,
float  y 
)

Device function (called by kernel).

Definition at line 20 of file deviceQualifier.cu.

Variable Documentation

const int n =8192

Size of device vectors (needed for static allocations).

Definition at line 11 of file deviceQualifier.cu.

__device__ float x_d[n]

Static allocation of global device variable.

Definition at line 13 of file deviceQualifier.cu.

__device__ float y_d[n]

Static allocation of global device variable.

Definition at line 14 of file deviceQualifier.cu.

__device__ float z_d[n]

Static allocation of global device variable.

Definition at line 15 of file deviceQualifier.cu.