pygments-ecl / tests / examplefiles /

#include <stdio.h>

// __device__ function
__device__ void func()
    short* array0 = (short*)array;
    float* array1 = (float*)&array0[127];

/* __global__ function */
__global__ static void reduction(const float* __restrict__ input, float *output, clock_t *timer)
    // __shared__ float shared[2 * blockDim.x];
    extern __shared__ float shared[];

    const int tid = threadIdx.x;
    const int bid = blockIdx.x;
    if (threadIdx.x == 0) {

    // Perform reduction to find minimum.
    for (int d = blockDim.x; d > 0; d /= 2)

int main(int argc, char **argv)
    dim3 dimBlock(8, 8, 1);

    timedReduction<<<dimBlock, 256, 256, 0>>>(dinput, doutput, dtimer);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.