From 77c15fd1db0da05e4aebed949e63a1b9943871de Mon Sep 17 00:00:00 2001 From: CFrauen <70707172+CFrauen@users.noreply.github.com> Date: Fri, 30 Aug 2024 10:10:33 +0300 Subject: [PATCH] Rearranged data transfer slides --- B3/L9/docs/gpu_lecture.md | 68 +++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/B3/L9/docs/gpu_lecture.md b/B3/L9/docs/gpu_lecture.md index d5f3209..722c567 100644 --- a/B3/L9/docs/gpu_lecture.md +++ b/B3/L9/docs/gpu_lecture.md @@ -375,31 +375,6 @@ Accelerator Kernel Timing data ``` - - -# Data clauses - -| Clause | Behavior | -| --- | ------ | -| COPYIN | Check if variables are already present on device; if not create space and copy data to device | -| COPYOUT | Check if variables are already present on device; if not create space and copy resulting data from device | -| COPY | Behaves like both COPYIN and COPYOUT | -| CREATE | Check if variables are already present on device; if not create empty space | -| PRESENT | Assume that variables are already present on device | - - Remark: Scalars are first private by default, they rarely appear in a data clause - -# Update clauses - -Within data regions host and device memory can be updated with the `UPDATE` clause - -
- -| Clause | Behavior | -| --- | ------ | -| UPDATE DEVICE | Copy data from host to device | -| UPDATE SELF
UPDATE HOST | Copy data from device to host | - # Optimization: Device data management
@@ -444,16 +419,6 @@ END PROGRAM # Optimization: Device data management -* Syntax: -
-`!$ACC DATA [data_clause]` -
-`!$ACC END DATA` - -* data_clause: e.g. `CREATE` , `COPYIN` - -# Optimization: Device data management -
``` > NVCOMPILER_ACC_TIME=1 ./p1A @@ -505,6 +470,39 @@ Accelerator Kernel Timing data device time(us): total=28 max=28 min=28 avg=28 ``` +# Optimization: Device data management + +* Syntax: +
+`!$ACC DATA [data_clause]` +
+`!$ACC END DATA` + +* data_clause: e.g. `CREATE` , `COPYIN` + +# Data clauses + +| Clause | Behavior | +| --- | ------ | +| COPYIN | Check if variables are already present on device; if not create space and copy data to device | +| COPYOUT | Check if variables are already present on device; if not create space and copy resulting data from device | +| COPY | Behaves like both COPYIN and COPYOUT | +| CREATE | Check if variables are already present on device; if not create empty space | +| PRESENT | Assume that variables are already present on device | + + Remark: Scalars are first private by default, they rarely appear in a data clause + +# Update clauses + +Within data regions host and device memory can be updated with the `UPDATE` clause + +
+ +| Clause | Behavior | +| --- | ------ | +| UPDATE DEVICE | Copy data from host to device | +| UPDATE SELF
UPDATE HOST | Copy data from device to host | + # Explicit data transfer