GpuDiscard¶
Forgets what pending kernel launches write into variables the host frees.
声明¶
语法¶
GpuDiscard(expr* vars)
参数¶
Argument |
描述 |
|---|---|
|
the variables, arrays or derived-type values. |
返回值¶
无。
描述¶
A GpuKernelLaunch does not wait for its kernel, and
the device keeps what the kernel writes until a GpuSync
copies it back. GpuDiscard comes before the host frees the storage of
vars – at the end of the block they are locals of, or before they are
deallocated – while a launch that writes them may be pending: the values
are not needed, so instead of waiting for them the runtime forgets them, and
copies nothing back into storage that no longer exists.
The gpu_launch_sync pass places it; see
GPU offloading.
示例¶
(GpuDiscard
:vars [
(Var
:v (SymbolRef 2 "a")
)
]
)