From 8c227e448120aa16ed23f82f4db41338305b822f Mon Sep 17 00:00:00 2001 From: compilersutra Date: Sat, 5 Sep 2026 09:41:59 +0530 Subject: [PATCH] docs: add GPU Platforms tracks (Android, CUDA, ROCm, Mac, Vulkan) Scaffold platform-based GPU tutorials with an Android phone learning path, and fix the /docs/Project redirect collision. --- docs/gpu/index.mdx | 6 ++ docs/gpu/platforms/android/index.md | 49 ++++++++++++ .../android/learn-parallel-on-phone.md | 75 +++++++++++++++++++ docs/gpu/platforms/cuda.md | 35 +++++++++ docs/gpu/platforms/index.md | 71 ++++++++++++++++++ docs/gpu/platforms/mac.md | 31 ++++++++ docs/gpu/platforms/other.md | 28 +++++++ docs/gpu/platforms/rocm.md | 35 +++++++++ docs/gpu/platforms/vulkan.md | 36 +++++++++ docusaurus.config.js | 5 +- sidebars/tutorials.js | 31 ++++++++ 11 files changed, 400 insertions(+), 2 deletions(-) create mode 100644 docs/gpu/platforms/android/index.md create mode 100644 docs/gpu/platforms/android/learn-parallel-on-phone.md create mode 100644 docs/gpu/platforms/cuda.md create mode 100644 docs/gpu/platforms/index.md create mode 100644 docs/gpu/platforms/mac.md create mode 100644 docs/gpu/platforms/other.md create mode 100644 docs/gpu/platforms/rocm.md create mode 100644 docs/gpu/platforms/vulkan.md diff --git a/docs/gpu/index.mdx b/docs/gpu/index.mdx index f536cfd9..56363952 100644 --- a/docs/gpu/index.mdx +++ b/docs/gpu/index.mdx @@ -38,6 +38,11 @@ import AdBanner from '@site/src/components/AdBanner'; This section connects parallel hardware, GPU execution models, OpenCL, and compiler-side performance reasoning.
+
+

Platforms

+

Android, CUDA, ROCm, Mac, Vulkan — pick the stack for your hardware.

+ Open platforms +

GPU Compilers Track

Use the guided GPU compiler path instead of jumping between pages.

@@ -59,6 +64,7 @@ This section connects parallel hardware, GPU execution models, OpenCL, and compi ## Core Articles +- [GPU Platforms](/docs/gpu/platforms/) — Android · CUDA · ROCm · Mac · Vulkan - [GPU Introduction](/docs/The_Graphic_Rendering_Pipeline) - [What Is GPU?](/docs/gpu/what_is_gpu) - [CPU vs GPU](/docs/gpu/CPU_Vs_GPU) diff --git a/docs/gpu/platforms/android/index.md b/docs/gpu/platforms/android/index.md new file mode 100644 index 00000000..9c3b5abd --- /dev/null +++ b/docs/gpu/platforms/android/index.md @@ -0,0 +1,49 @@ +--- +title: Android GPU Track +description: Learn parallel / GPGPU programming on Android phone GPUs (Adreno, Mali) with OpenCL detection and Vulkan compute. +keywords: + - Android GPU programming + - phone GPU parallel programming + - Adreno OpenCL + - Mali GPU compute + - Vulkan compute Android + - learn GPGPU on smartphone +--- + +import Link from '@docusaurus/Link'; +import AdBanner from '@site/src/components/AdBanner'; + +# Android GPU Track + +Use the GPU in your phone to learn **data-parallel** programming: kernels, work-items, workgroups, memory traffic, and honest timing — without a desktop GPU. + + + +## Start here + +1. [Learn parallel programming on your phone GPU](/docs/gpu/platforms/android/learn-parallel-on-phone) — full learning path +2. [Detect OpenCL on Android](/docs/gpu/opencl/basic/detecting_opencl_gpu_on_android) — first on-device check +3. [OpenCL for Android hub](/docs/gpu/opencl/openclforandroid) + +## Stack reality on phones + +| API | Role on Android | +|-----|-----------------| +| **Vulkan compute** | Most portable long-term path | +| **OpenCL** | Available on many Adreno/Mali devices via vendor `libOpenCL.so` — detect first | +| **CUDA** | Not on phones | + +## Coming next on this track + +- First OpenCL kernel on Android (vector add) +- Vulkan compute hello-dispatch APK +- Measuring GPU time (warmup, median, thermal) +- Adreno vs Mali beginner checklist + +## External references + +- [Vulkan: Compute on Android](https://docs.vulkan.org/tutorial/latest/Advanced_Vulkan_Compute/12_Mobile_and_Embedded_Compute/02_android_compute.html) +- [Android: RenderScript → Vulkan](https://developer.android.com/guide/topics/renderscript/migrate/migrate-vulkan) +- [Arm OpenCL programming guide (PDF)](https://developer.arm.com/-/media/developer/Graphics%20and%20Multimedia/Developer%20Guides%20-%20PDFs/Arm%20Guide%20to%20OpenCL%20Programming.pdf) + +Back to [GPU Platforms](/docs/gpu/platforms/). diff --git a/docs/gpu/platforms/android/learn-parallel-on-phone.md b/docs/gpu/platforms/android/learn-parallel-on-phone.md new file mode 100644 index 00000000..5339c42e --- /dev/null +++ b/docs/gpu/platforms/android/learn-parallel-on-phone.md @@ -0,0 +1,75 @@ +--- +title: Learn Parallel Programming on Your Phone GPU +description: Step-by-step path to learn data-parallel programming using an Android phone GPU — fundamentals, OpenCL detection, Vulkan compute, and mobile caveats. +keywords: + - learn parallel programming on phone + - Android phone GPU tutorial + - mobile GPGPU learning path + - OpenCL Android beginner + - Vulkan compute phone +--- + +import AdBanner from '@site/src/components/AdBanner'; + +# Learn Parallel Programming on Your Phone GPU + +You do not need a desktop NVIDIA card to start. Android phones (Adreno / Mali) can run the same **data-parallel** ideas as CUDA courses: kernels, workgroups, memory, speedup — on hardware you already own. + +This is a **path**, not a full course dump. + + + +## Path (in order) + +### 1. Fundamentals + +1. [What is Parallel Computing?](/docs/parallel-computing/fundamentals/what-is-parallel-computing) +2. [Program, Process, Thread, Core](/docs/parallel-computing/fundamentals/program-process-thread-core) +3. [Amdahl's and Gustafson's Laws](/docs/parallel-computing/fundamentals/amdahls-and-gustafsons-law) +4. [Measuring Parallel Performance](/docs/parallel-computing/fundamentals/measuring-parallel-performance) + +### 2. GPU mental model + +1. [What is a GPU?](/docs/gpu/what_is_gpu) +2. [What is OpenCL?](/docs/gpu/opencl/basic/what_is_opencl) + +| Concept | On a phone GPU | +|--------|----------------| +| Work-item | One kernel invocation | +| Workgroup | Threads that can share local memory | +| Global memory | Device DRAM (power + latency cost) | +| Kernel | Code every work-item runs | + +### 3. On-device: detect OpenCL + +- [Detecting OpenCL GPU on Android](/docs/gpu/opencl/basic/detecting_opencl_gpu_on_android) + +Some phones expose OpenCL; some do not. Detect before writing kernels. + +### 4. Portable practice: Vulkan compute + +| Resource | Why | +|----------|-----| +| [Vulkan Advanced Compute](https://docs.vulkan.org/tutorial/latest/Advanced_Vulkan_Compute/introduction.html) | Parallelism + memory model | +| [Compute on Android](https://docs.vulkan.org/tutorial/latest/Advanced_Vulkan_Compute/12_Mobile_and_Embedded_Compute/02_android_compute.html) | Phone limits + power | +| [Android Vulkan chapter](https://docs.vulkan.org/tutorial/latest/14_Android.html) | App bring-up | + +**First exercises:** vector add → reduction → blur/histogram → timed runs (median, not one lucky sample). + +### 5. Mobile habits + +- Thermal throttling is real — short kernels, report median +- Query device limits; do not assume desktop sizes +- Mark truly constant SSBO params `readonly` when applicable + +## Weekly plan + +| Week | Goal | +|------|------| +| 1 | Fundamentals + GPU mental model | +| 2 | NDK/ADB + OpenCL detection | +| 3 | First kernel (OpenCL or Vulkan) | +| 4 | One real kernel + honest timing | +| 5 | CPU vs GPU on the same phone | + +Part of the [Android GPU Track](/docs/gpu/platforms/android) · [All platforms](/docs/gpu/platforms/) diff --git a/docs/gpu/platforms/cuda.md b/docs/gpu/platforms/cuda.md new file mode 100644 index 00000000..cf61d1b7 --- /dev/null +++ b/docs/gpu/platforms/cuda.md @@ -0,0 +1,35 @@ +--- +title: CUDA Track (NVIDIA) +description: CompilerSutra CUDA / NVIDIA GPU programming track — setup, kernels, memory, and profiling roadmap. +keywords: + - CUDA tutorial + - NVIDIA GPU programming + - learn CUDA + - CUDA vs OpenCL +--- + +import AdBanner from '@site/src/components/AdBanner'; + +# CUDA Track (NVIDIA) + +Desktop and datacenter path for **NVIDIA GPUs**. Best when you have a GeForce / RTX / datacenter card. + + + +## Status + +Track scaffold — articles will land here. Meanwhile: + +- Related OpenCL-on-NVIDIA notes: [OpenCL NVIDIA hub](/docs/gpu/opencl/nvidia) +- Shared concepts: [What is a GPU?](/docs/gpu/what_is_gpu) · [Parallel Computing](/docs/parallel-computing/) + +## Planned modules + +1. Install CUDA toolkit + verify `nvidia-smi` +2. First kernel (vector add) +3. Grid / block / thread and occupancy +4. Global / shared / constant memory +5. Profiling with Nsight (`nsys` / `ncu`) +6. Common pitfalls (divergency, uncoalesced loads) + +Back to [GPU Platforms](/docs/gpu/platforms/). diff --git a/docs/gpu/platforms/index.md b/docs/gpu/platforms/index.md new file mode 100644 index 00000000..9af54beb --- /dev/null +++ b/docs/gpu/platforms/index.md @@ -0,0 +1,71 @@ +--- +title: GPU Platforms +description: Pick your GPU stack — Android phone GPUs, CUDA, ROCm, Mac/Metal, Vulkan, and more. CompilerSutra GPU tutorial tracks by platform. +slug: /gpu/platforms/ +keywords: + - GPU platforms + - CUDA tutorial + - ROCm tutorial + - Android GPU programming + - Mac Metal GPU + - Vulkan compute + - learn GPU programming by platform +--- + +import Link from '@docusaurus/Link'; +import AdBanner from '@site/src/components/AdBanner'; + +# GPU Platforms + +Same parallel ideas (kernels, workgroups, memory) — different stacks per machine. +Pick the track that matches **the hardware you have**, then follow that path. + + + +## Tracks + +
+
+

Android

+

Phone GPUs (Adreno / Mali). OpenCL detect + Vulkan compute.

+ Open Android track +
+
+

CUDA (NVIDIA)

+

Desktop / datacenter NVIDIA GPUs. Classic GPGPU path.

+ Open CUDA track +
+
+

ROCm (AMD)

+

AMD GPUs with HIP / ROCm tooling and OpenCL on AMDGPU.

+ Open ROCm track +
+
+

Mac

+

Apple Silicon — Metal, and what still works for OpenCL/Vulkan.

+ Open Mac track +
+
+

Vulkan

+

Cross-vendor compute (desktop + Android). SPIR-V pipelines.

+ Open Vulkan track +
+
+

Other

+

Intel / oneAPI, SYCL, and stacks we add next.

+ Open other platforms +
+
+ +## Shared foundations (all platforms) + +- [What is a GPU?](/docs/gpu/what_is_gpu) +- [CPU vs GPU](/docs/gpu/CPU_Vs_GPU) +- [Intro to Parallel Programming](/docs/gpu/Parallel_Programming/Intro_to_Parallel_Programming) +- [Parallel Computing curriculum](/docs/parallel-computing/) +- [GPU Programming TOC](/docs/gpu/gpu_programming/gpu_programming_toc) + +## Related OpenCL hubs (already on site) + +- [OpenCL Master](/docs/gpu/opencl/opencl) +- [AMDGPU](/docs/gpu/opencl/amdgpu) · [AMD CPU](/docs/gpu/opencl/amdcpu) · [NVIDIA](/docs/gpu/opencl/nvidia) · [Android](/docs/gpu/opencl/openclforandroid) diff --git a/docs/gpu/platforms/mac.md b/docs/gpu/platforms/mac.md new file mode 100644 index 00000000..79dc47dc --- /dev/null +++ b/docs/gpu/platforms/mac.md @@ -0,0 +1,31 @@ +--- +title: Mac GPU Track +description: GPU programming on Apple Silicon — Metal compute, and what still works for OpenCL and Vulkan on Mac. +keywords: + - Mac GPU programming + - Apple Silicon Metal + - Metal compute tutorial + - OpenCL on Mac +--- + +import AdBanner from '@site/src/components/AdBanner'; + +# Mac GPU Track + +Apple Silicon path. Primary API today: **Metal** (compute + graphics). OpenCL is deprecated on Apple platforms; plan Metal-first. + + + +## Status + +Track scaffold — Metal compute articles coming. + +## Planned modules + +1. Xcode / Metal setup on Apple Silicon +2. First compute kernel (MPS / Metal Shading Language) +3. Buffers, textures, threadgroups +4. Timing and Instruments +5. Portability notes (Metal vs Vulkan vs CUDA) + +Back to [GPU Platforms](/docs/gpu/platforms/). diff --git a/docs/gpu/platforms/other.md b/docs/gpu/platforms/other.md new file mode 100644 index 00000000..651be87c --- /dev/null +++ b/docs/gpu/platforms/other.md @@ -0,0 +1,28 @@ +--- +title: Other GPU Platforms +description: Intel / oneAPI, SYCL, and other GPU stacks on the CompilerSutra roadmap. +keywords: + - oneAPI GPU + - SYCL tutorial + - Intel GPU programming +--- + +import AdBanner from '@site/src/components/AdBanner'; + +# Other GPU Platforms + +Stacks we will expand next. + + + +## Planned + +| Platform | Focus | +|----------|--------| +| **Intel / oneAPI** | Level Zero, SYCL, OpenCL on Intel GPUs | +| **SYCL** | Single-source C++ across vendors | +| **iOS** | Metal (ties to [Mac track](/docs/gpu/platforms/mac)) | + +Have a stack you want first? Say which hardware you use. + +Back to [GPU Platforms](/docs/gpu/platforms/). diff --git a/docs/gpu/platforms/rocm.md b/docs/gpu/platforms/rocm.md new file mode 100644 index 00000000..18b19c49 --- /dev/null +++ b/docs/gpu/platforms/rocm.md @@ -0,0 +1,35 @@ +--- +title: ROCm Track (AMD) +description: CompilerSutra ROCm / AMDGPU track — HIP, ROCm tools, and OpenCL on AMD GPUs. +keywords: + - ROCm tutorial + - AMD GPU programming + - HIP tutorial + - OpenCL AMDGPU +--- + +import AdBanner from '@site/src/components/AdBanner'; + +# ROCm Track (AMD) + +AMD GPU path: **ROCm**, **HIP**, and OpenCL on **AMDGPU**. + + + +## Status + +Track scaffold. Existing OpenCL-on-AMD content: + +- [AMDGPU OpenCL Master](/docs/gpu/opencl/amdgpu) +- [Getting started with OpenCL on AMDGPU](/docs/gpu/opencl/basic/getting_started_with_opencl_on_amdgpu) +- [Setting up OpenCL](/docs/gpu/opencl/basic/setting_up_opencl) + +## Planned modules + +1. ROCm install + `rocminfo` +2. HIP hello world (and CUDA→HIP notes) +3. OpenCL on AMDGPU validation +4. Profiling with `rocprof` +5. Memory and wavefront basics on RDNA/CDNA + +Back to [GPU Platforms](/docs/gpu/platforms/). diff --git a/docs/gpu/platforms/vulkan.md b/docs/gpu/platforms/vulkan.md new file mode 100644 index 00000000..c646eccf --- /dev/null +++ b/docs/gpu/platforms/vulkan.md @@ -0,0 +1,36 @@ +--- +title: Vulkan Compute Track +description: Cross-vendor GPU compute with Vulkan and SPIR-V — desktop and Android. +keywords: + - Vulkan compute tutorial + - SPIR-V compute + - GPGPU Vulkan + - Vulkan Android compute +--- + +import AdBanner from '@site/src/components/AdBanner'; + +# Vulkan Compute Track + +Cross-vendor compute API. Same mental model on **desktop and Android**. + + + +## Status + +Track scaffold. Strong external start: + +- [Vulkan Advanced Compute](https://docs.vulkan.org/tutorial/latest/Advanced_Vulkan_Compute/introduction.html) +- [Compute on Android](https://docs.vulkan.org/tutorial/latest/Advanced_Vulkan_Compute/12_Mobile_and_Embedded_Compute/02_android_compute.html) + +Phone-oriented path: [Android track](/docs/gpu/platforms/android) + +## Planned modules + +1. Instance / device / queue for compute +2. SPIR-V from GLSL (or Slang) +3. Descriptor sets + `vkCmdDispatch` +4. Barriers and readback +5. Subgroups and mobile limits + +Back to [GPU Platforms](/docs/gpu/platforms/). diff --git a/docusaurus.config.js b/docusaurus.config.js index f1c250c0..815b4822 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -49,9 +49,10 @@ const config = { '@docusaurus/plugin-client-redirects', { redirects: [ + // Old capital-P URL used in footers/side links → projects catalogue { - to: '/docs/project/cpp-project-ideas', - from: ['/docs/project/Project', '/docs/project/Project/'], + to: '/docs/project/', + from: '/docs/Project', }, { to: '/docs/c++/advanced/', from: ['/docs/c++/advance/', '/docs/c++/advance/index', '/docs/c++/advance/intro'] }, { diff --git a/sidebars/tutorials.js b/sidebars/tutorials.js index 750589bc..544fee02 100644 --- a/sidebars/tutorials.js +++ b/sidebars/tutorials.js @@ -214,6 +214,37 @@ const tutorials = { 'gpu/what_is_gpu', ], }, + { + type: 'category', + label: 'Platforms', + collapsed: false, + link: { + type: 'doc', + id: 'gpu/platforms/index', + }, + items: [ + 'gpu/platforms/index', + { + type: 'category', + label: 'Android', + collapsed: false, + link: { + type: 'doc', + id: 'gpu/platforms/android/index', + }, + items: [ + 'gpu/platforms/android/index', + 'gpu/platforms/android/learn-parallel-on-phone', + 'gpu/opencl/basic/detecting_opencl_gpu_on_android', + ], + }, + 'gpu/platforms/cuda', + 'gpu/platforms/rocm', + 'gpu/platforms/mac', + 'gpu/platforms/vulkan', + 'gpu/platforms/other', + ], + }, ], llvmTutorialSidebar: [