#include "cutil_math.h" #include "vector_types.h" #include "../shared.h" surface outputSurface; #include "program.h" extern "C" __global__ void testFunction() { // get x and y for pixel const int x = threadIdx.x + blockIdx.x * blockDim.x; const int y = threadIdx.y + blockIdx.y * blockDim.y; if ((x >= SCRWIDTH) || (y >= SCRHEIGHT)) return; float r = (float)x / SCRWIDTH, g = (float)y / SCRHEIGHT; surf2Dwrite( make_float4( r, g, 0, 1 ), outputSurface, x * sizeof( float4 ), y, cudaBoundaryModeClamp ); }