Tag: Beginner
-
Data Clauses – Create, Present, Delete
Imagine you’re cooking in a kitchen. Sometimes you need temporary bowls for mixing ingredients – you don’t bring them from another room, and you don’t take them back when done. You just need them for the cooking process! That’s exactly what CREATE, PRESENT, and DELETE clauses do for GPU memory. Learn how to allocate device…
-
Data Clauses – Copyin, Copyout, Copy with Fortran Arrays
Think of GPU programming like moving to a new house. You need to pack your stuff (data), move it to the new place (GPU), do your work there, and then decide what to bring back. OpenACC data clauses are like moving instructions! The Three Essential Data Movements COPYIN: “Pack this and take it TO the…
-
Loop Directive with Num_gangs, Num_workers, Vector_length
What You’ll Learn Today Imagine a construction site where you need to organize workers efficiently. You have teams (gangs), workers within each team, and each worker can handle multiple small tasks (vectors). That’s exactly how GPU parallelism works with OpenACC! The Three-Level Parallelism Hierarchy GPUs organize work in three levels, like a well-structured company: Each…
-
Basic Parallel Loop Directive with DO Loops
What You’ll Learn Today Think of the !$acc parallel loop directive as a magic wand that transforms your regular Fortran DO loop into a super-fast parallel loop that runs on hundreds of GPU cores simultaneously! The Power of Parallel Loops Imagine you’re organizing a school library: Sequential Way (Regular DO loop): Parallel Way (OpenACC DO…
-
Understanding Fortran Array Indexing in OpenACC
What You’ll Learn Today Fortran counts differently than some other programming languages, and this matters A LOT when working with OpenACC! It’s like the difference between floor numbers in American buildings (1st floor, 2nd floor) versus British buildings (ground floor, 1st floor). The Big Difference: Starting from 1 Fortran Way (starts from 1): C/Python Way…
