|
docc 0.8.3 (0d44999b)
C++ API Reference
|
Promotes function pointer arguments to device-resident storage. More...
#include <sdfg/passes/offloading/device_resident_arg_promotion_pass.h>
Public Member Functions | |
| DeviceResidentArgPromotionPass (bool is_rocm) | |
| ~DeviceResidentArgPromotionPass () override=default | |
| bool | run_pass (builder::StructuredSDFGBuilder &builder, analysis::AnalysisManager &analysis_manager) override |
| std::string | name () override |
| Public Member Functions inherited from sdfg::passes::Pass | |
| Pass ()=default | |
| Pass (const Options &options) | |
| virtual | ~Pass ()=default |
| virtual std::vector< OptionSpec > | options () |
| bool | run (builder::SDFGBuilder &builder, bool create_report=false) |
| bool | run (builder::StructuredSDFGBuilder &builder, analysis::AnalysisManager &analysis_manager, bool create_report=false) |
| virtual bool | run_pass (builder::SDFGBuilder &builder) |
| virtual void | invalidates (analysis::AnalysisManager &analysis_manager, bool applied) |
Additional Inherited Members | |
| Protected Member Functions inherited from sdfg::passes::Pass | |
| template<class T> | |
| T | option (const OptionKey< T > &key, T fallback=T{}) const |
Promotes function pointer arguments to device-resident storage.
After offloading, the canonical pattern for every pointer argument is host_arg –(H2D + malloc)--> dev_buf –kernel--> host_arg (+ D2H + free).
When every pointer argument is used exclusively by boundary offloading nodes (i.e. no host-side tasklet ever touches it), the whole program can run with device-resident arguments: the caller passes device pointers and the boundary copies degrade to device-to-device copies (handled automatically by the offloading dispatchers, which derive the memcpy kind from the storage tags).
This pass flips the storage of all pointer arguments to device storage and records arg_residency = "device" / device_backend in the SDFG metadata so the runtime knows to pass device pointers. The decision is whole-program and conservative: if any argument is touched by host code, nothing is promoted and the program keeps its original (all-host) behavior.
|
explicit |
|
overridedefault |
|
inlineoverridevirtual |
Implements sdfg::passes::Pass.
|
overridevirtual |
Reimplemented from sdfg::passes::Pass.