1DStencil example

A shared folder with AI prompts and code snippets

From workspace: Nvidia

Team: NVIDIA Developer

Total snippets: 4

Nvidia

1DStencil example

4 snippets

Stencil Answer Key

Completed reference CUDA kernel for 1D stencil operation.

#include <stdio.h> #define RADIUS 3 #define BLOCK_SIZE 256 #define NUM_ELEMENTS (4096*2) // CUDA API error checking macro #define cudaCheck(error) \ if (error != cudaSuccess) { \ printf("Fatal error: %s at %s:%d\n", \ ...

Readme Overview

Brief instructions for editing and compiling CUDA files.

Credit: Mark Harris - NVIDIA Corporation Description: A simple 1D Stencil code useful for teaching students about the benefits and usage of shared memory in a GPU. This example is greatly enhanced when paired with a profiler showing the...

Stencil Exercise Template

Starter CUDA code for 1D stencil implementation using shared memory.

#include <stdio.h> #define RADIUS 3 #define BLOCK_SIZE 256 #define NUM_ELEMENTS (4096*2) // CUDA API error checking macro #define cudaCheck(error) \ if (error != cudaSuccess) { \ printf("Fatal error: %s at %s:%d\n", \ ...

1DStencil example

A CUDA C program which calculates a 1DStencil, making use of shared memory and synchronized threads to achieve better performance.

Nvidia - 1DStencil example - AI Prompts & Code Snippets | Snippets AI