Skip to content

Commit

Permalink
add hints for Julia Excercise
Browse files Browse the repository at this point in the history
  • Loading branch information
ostueker committed Jun 28, 2024
1 parent c82ff2d commit 85a2459
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion _episodes/10-exercise-julia-set.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ questions:
objectives:
- "Starting from this CPU version of the Julia Set code, port it to using GPUs using CUDA."
keypoints:
- "FIXME"
# - "FIXME"
---

In the first session of the ACENET Summer School we have been introduced to the
Expand Down Expand Up @@ -97,3 +97,14 @@ int julia(int x, int y){
~~~
{: .language-c }

>## Exercise: convert this code to run GPUs
> 1. Convert the function `julia()` to be able to be compiled for GPUs.
> Hint: this requires adding the `__device__` specifier at the beginning of the function declaration.
> 2. Convert the function `kernel()` into a CUDA kernel by replacing the loops with statements to
> calculate `x` and `y` positions using 2D-grids and -blocks.
> * add an if-clause to ensure that `x` and `y` are within the range of `DIM`.
> 3. Convert the function `main()` to allocate GPU memory, call the GPU-kernel with 2D-grid and -block
> and copy the result array back to host-memory before saving it to a file.
>
> The solution will be added here on July 3rd, 2024.
{: .challenge }

0 comments on commit 85a2459

Please sign in to comment.