GPU Challenges — Test Your CUDA & Python GPU Skills

GPU Challenges

Solve GPU programming challenges in CUDA C++ or Python (PyTorch).

Challenge Details

Constant Memory Lookup Table

hard

Use CUDA constant memory as a read-only lookup table so all threads can reuse cached sine values without recomputing sin() inside the kernel.

Your Goal
  • Convert each input angle into a valid table index.
  • Read from __constant__ memory instead of recomputing the sine value.
  • Store the looked-up sine result into the output array.
Focus Areas
  • Constant memory usage
  • Lookup-table based computation
  • Read-only data shared across threads
What Success Looks Like
  • Printed sine values should closely match the CPU reference values.
  • Angles should map into the 0..359 lookup-table range safely.
  • The kernel should preserve the one-thread-per-output pattern.
constant-memory.cuPractice Mode
Terminal Output
Select a challenge and write your solution, then run it.
Need more credits? Upgrade your plan →