A shared folder with AI prompts and code snippets
From workspace: Nvidia
Team: NVIDIA Developer
Total snippets: 4
4 snippets
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", \ ...
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...
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", \ ...
A CUDA C program which calculates a 1DStencil, making use of shared memory and synchronized threads to achieve better performance.