Interactive Exercises
Practice your HPC optimization skills with hands-on exercises for each module.
Exercise Philosophy
These exercises are designed to:
- Reinforce concepts from the learning modules
- Provide practical experience with optimization techniques
- Build intuition through trial and error
- Test your understanding with self-assessment questions
Exercise Modules
| Module | Difficulty | Focus |
|---|---|---|
| Module 02: Memory | Beginner | Cache optimization |
| Module 04: SIMD | Intermediate | Vectorization |
| Module 05: Concurrency | Advanced | Multithreading |
How to Use These Exercises
Exercise Format
Each exercise includes:
- Objective - What you will learn
- Setup - Files and commands needed
- Tasks - Step-by-step instructions
- Questions - Self-assessment questions
- Hints - Optional guidance (try without first!)
Recommended Approach
mermaid
flowchart LR
A[Read Objective] --> B[Attempt Task]
B --> C{Stuck?}
C -->|Yes| D[Check Hint]
C -->|No| E[Complete Task]
D --> B
E --> F[Answer Questions]
F --> G[Check Solution]- Try first - Attempt the exercise before looking at hints
- Experiment - Modify parameters and observe results
- Measure - Always verify with benchmarks
- Understand - Ask "why does this work?"
Solution Format
Solutions are provided in solutions.md, but we encourage you to:
- Attempt each exercise independently
- Use hints if you get stuck
- Only check solutions after completing the exercise
- Understand why the solution works
Environment Setup
Prerequisites
bash
# Clone the repository
git clone https://github.com/LessUp/cpp-high-performance-guide.git
cd cpp-high-performance-guide
# Build the project
cmake --preset=release
cmake --build build/release
# Run tests to verify setup
ctest --preset=releaseRequired Tools
- Compiler: GCC 11+ or Clang 14+
- CMake: 3.20+
- perf: For profiling exercises (Linux)
- ThreadSanitizer: For concurrency exercises
Progress Tracking
Track your progress through each module:
| Module | Completed | Notes |
|---|---|---|
| 01. CMake | ☐ | |
| 02. Memory | ☐ | |
| 03. Modern C++ | ☐ | |
| 04. SIMD | ☐ | |
| 05. Concurrency | ☐ |
Getting Help
If you're stuck:
- Review the relevant module README
- Check the FAQ
- Look at the Troubleshooting Guide
- Open a Discussion
Next Steps
Choose a module and start practicing:
- New to the project? Start with Module 02: Memory
- Want immediate results? Try the memory exercises above
- Ready for advanced topics? Jump to Module 05: Concurrency