1# GPU Development 2 3Runtime selection of libCEED backends allows users to use CPU backends for easier debugging. 4Code that produces correct results with CPU backends will produce correct results on GPU backends, provided that JiT and memory access assumptions of the libCEED API are respected. 5 6## JiT Compilation 7 8The filepath to the user source code is passed in {c:func}`CeedQFunctionCreateInterior` as the `source` argument. 9This filepath should typically be an absolute path to ensure the JiT compilation can locate the source file. 10The filepath may also be relative to a root directory set with {c:func}`CeedAddJitSourceRoot`. 11The {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`. 12 13The entire contents of this file and all locally included files (`#include "foo.h"`) are used during JiT compilation for GPU backends. 14Installed 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>`. 15These 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 17All source files must be at the provided filepath at runtime for JiT to function. 18 19## Memory Access 20 21GPU backends require stricter adherence to memory access assumptions, but CPU backends may occasionally report correct results despite violations of memory access assumptions. 22The `/cpu/self/memcheck` backends explicitly verify read-only and write-only memory access assumptions. 23 24