You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/sphinx/source/gpu.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,12 @@ Code that produces correct results with CPU backends will produce correct result
7
7
8
8
The filepath to the user source code is passed in {c:func}`CeedQFunctionCreateInterior` as the `source` argument.
9
9
This filepath should typically be an absolute path to ensure the JiT compilation can locate the source file.
10
-
The filepath may also be relative to a root directory set with {c:func}`CeedAddJitSourceRoot`.
11
-
The {c:macro}`CEED_QFUNCTION` macro automatically creates a string with the absolute path stored in the variable `user_loc`for a {c:type}`CeedQFunctionUser` called `user`.
10
+
The filepath may also be a relative path with respect to a root directory set with {c:func}`CeedAddJitSourceRoot`.
11
+
The {c:macro}`CEED_QFUNCTION` macro automatically creates a string with the absolute path, for example a {c:type}`CeedQFunctionUser` called `user` would have this string stored in the variable `user_loc`.
12
12
13
-
The entire contents of this file and all locally included files (`#include "foo.h"`) are used during JiT compilation for GPU backends.
14
-
Installed headers (`#include <bar.h>`) are omitted in the source code passed to JiT, but the compilation environment may supply common headers such as `<math.h>`.
13
+
The entire contents of this source file and all included files are used during JiT compilation for GPU backends.
14
+
Include statements for system headers that are required for CPU compilation but are not available in GPU compilation environments should be guarded with `#ifdef CEED_RUNNING_JIT_PASS`.
15
+
Any function definitions in these system headers must still be available in the GPU compilation environments, such as the contents of `<math.h>`.
15
16
These source file must only contain syntax constructs supported by C99 and all targeted backends (i.e. CUDA for `/gpu/cuda`, OpenCL/SYCL for `/gpu/sycl`, etc.).
16
17
17
18
All source files must be at the provided filepath at runtime for JiT to function.
@@ -20,10 +21,10 @@ All source files must be at the provided filepath at runtime for JiT to function
20
21
21
22
GPU backends require stricter adherence to memory access assumptions, but CPU backends may occasionally report correct results despite violations of memory access assumptions.
22
23
Both `CeedVector` and `CeedQFunctionContext` have read-only and read-write accessors, and `CeedVector` allow write-only access.
23
-
Read-only access of `CeedVector` and `CeedQFunctionContext` memory spaces must be respected for proper GPU behavior.
24
+
Read-only access of `CeedVector` and `CeedQFunctionContext` memory spaces must be respected for to ensure proper GPU behavior.
24
25
Write-only access of `CeedVector` memory spaces asserts that all data in the `CeedVector` is invalid until overwritten.
25
26
26
-
`CeedQFunction` assume that all input arrays are read-only and all output arrays are write-only and the {c:type}`CeedQFunctionUser` must adhere to these assumptions, only reading data in the input arrays and fully overwriting the output arrays.
27
+
`CeedQFunction` assume that all input arrays are read-only and all output arrays are write-only and the {c:type}`CeedQFunctionUser` must adhere to these assumptions, only reading data in the input arrays and fully overwriting all entries in the output arrays.
27
28
Additionally, {c:type}`CeedQFunctionUser` have read-write access for `CeedQFunctionContext` data, unless {c:func}`CeedQFunctionSetContextWritable` was used to indicate that read-only access is sufficient.
28
29
29
30
The `/cpu/self/memcheck` backends explicitly verify read-only and write-only memory access assumptions.
0 commit comments