docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
sdfg::analysis::OffloadState Struct Reference

#include <sdfg/analysis/data_transfer_elimination_analysis.h>

Inheritance diagram for sdfg::analysis::OffloadState:
[legend]

Public Member Functions

 OffloadState (DataTransferEliminationCandidateCollector &collector)
void apply_kills_and_changes (ExposedType &exposed) const override
void found_escape (const std::string &container)
void found_full_barrier (ControlFlowNode &node)
void found_offload_node (Block &block, offloading::DataOffloadingNode &offload)
void found_ptr_read (const std::string &container, const data_flow::Memlet *memlet)
void found_ptr_write (const std::string &container, const data_flow::Memlet *memlet)
void found_malloc (Block &block, stdlib::MallocNode &malloc)
void add_h2d_entry (const OffloadHolder &entry)
std::pair< KillingType, OffloadHolder * > find_killing_entry_node (const ExposedOffload &in_flight) const
Public Member Functions inherited from sdfg::analysis::ElementIdMapDataFlowState< ExposedOffload, OffloadHolder >
bool ran_at_least_once () const override
bool update (const ExposedType &incoming) override
 All-in-one for leaf-nodes.
bool update_incoming (const ExposedType &incoming) override
 For non-leaf nodes: update inputs.
bool update_forward_exposed (const ExposedType &forward_exposed) override
 For non-leaf nodes: update outputs.
const ExposedType & forward_exposed () const override
 Get the current state of live elements leaving the node in forward direction.
Public Member Functions inherited from sdfg::analysis::DataFlowState< std::unordered_map< ElementId, ExposedOffload > >
virtual ~DataFlowState ()=default
virtual bool update (const std::unordered_map< ElementId, ExposedOffload > &incoming)=0
 All-in-one for leaf-nodes.
virtual bool update_incoming (const std::unordered_map< ElementId, ExposedOffload > &incoming)=0
 For non-leaf nodes: update inputs.
virtual bool update_forward_exposed (const std::unordered_map< ElementId, ExposedOffload > &forward_exposed)=0
 For non-leaf nodes: update outputs.

Protected Types

enum class  KillingType {
  None , Basic , DeviceReuse , EmptyHostMalloc ,
  DeviceCleanFree , RedundantD2H
}

Protected Attributes

std::unordered_set< std::string > kills_containers_
 These containers are used in a way that makes us lose track of their contents (pointer-leaks & aliasing situations) or accesses it on the host, such that data on device would become out of sync Needs to not include the accesses of offloading nodes, as we want to handle them more intelligently.
std::unordered_map< ElementId, std::unique_ptr< OffloadHolder > > h2d_nodes_
 All H2D offload needs.
std::unordered_map< ElementId, std::unique_ptr< OffloadHolder > > generated_
std::unordered_map< std::string, std::vector< const data_flow::Memlet * > > reads_
bool full_kill_ = false
DataTransferEliminationCandidateCollector & collector_
Protected Attributes inherited from sdfg::analysis::ElementIdMapDataFlowState< ExposedOffload, OffloadHolder >
ExposedType incoming_
ExposedType forward_exposed_
bool ran_

Additional Inherited Members

Public Types inherited from sdfg::analysis::ElementIdMapDataFlowState< ExposedOffload, OffloadHolder >
using ExposedType
Public Types inherited from sdfg::analysis::DataFlowState< std::unordered_map< ElementId, ExposedOffload > >
using ExposedType
Static Public Member Functions inherited from sdfg::analysis::ElementIdMapDataFlowState< ExposedOffload, OffloadHolder >
static ExposedType empty_in ()
static void merge (ExposedType &merge_into, const ExposedType &other, MergeMode mode=MergeMode::CUMULATIVE)

Member Enumeration Documentation

◆ KillingType

enum class sdfg::analysis::OffloadState::KillingType
strongprotected
Enumerator
None 
Basic 
DeviceReuse 
EmptyHostMalloc 
DeviceCleanFree 
RedundantD2H 

Constructor & Destructor Documentation

◆ OffloadState()

sdfg::analysis::OffloadState::OffloadState ( DataTransferEliminationCandidateCollector & collector)

Member Function Documentation

◆ add_h2d_entry()

void sdfg::analysis::OffloadState::add_h2d_entry ( const OffloadHolder & entry)

◆ apply_kills_and_changes()

void sdfg::analysis::OffloadState::apply_kills_and_changes ( ExposedType & exposed) const
overridevirtual

◆ find_killing_entry_node()

std::pair< KillingType, OffloadHolder * > sdfg::analysis::OffloadState::find_killing_entry_node ( const ExposedOffload & in_flight) const

◆ found_escape()

void sdfg::analysis::OffloadState::found_escape ( const std::string & container)

◆ found_full_barrier()

void sdfg::analysis::OffloadState::found_full_barrier ( ControlFlowNode & node)

◆ found_malloc()

void sdfg::analysis::OffloadState::found_malloc ( Block & block,
stdlib::MallocNode & malloc )

◆ found_offload_node()

void sdfg::analysis::OffloadState::found_offload_node ( Block & block,
offloading::DataOffloadingNode & offload )

◆ found_ptr_read()

void sdfg::analysis::OffloadState::found_ptr_read ( const std::string & container,
const data_flow::Memlet * memlet )

◆ found_ptr_write()

void sdfg::analysis::OffloadState::found_ptr_write ( const std::string & container,
const data_flow::Memlet * memlet )

Member Data Documentation

◆ collector_

DataTransferEliminationCandidateCollector& sdfg::analysis::OffloadState::collector_
protected

◆ full_kill_

bool sdfg::analysis::OffloadState::full_kill_ = false
protected

◆ generated_

std::unordered_map<ElementId, std::unique_ptr<OffloadHolder> > sdfg::analysis::OffloadState::generated_
protected

◆ h2d_nodes_

std::unordered_map<ElementId, std::unique_ptr<OffloadHolder> > sdfg::analysis::OffloadState::h2d_nodes_
protected

All H2D offload needs.

They kill whatever they could alias with. If its a direct match (the inverse of an open D2H node), then its a candidate for removal

◆ kills_containers_

std::unordered_set<std::string> sdfg::analysis::OffloadState::kills_containers_
protected

These containers are used in a way that makes us lose track of their contents (pointer-leaks & aliasing situations) or accesses it on the host, such that data on device would become out of sync Needs to not include the accesses of offloading nodes, as we want to handle them more intelligently.

◆ reads_

std::unordered_map<std::string, std::vector<const data_flow::Memlet*> > sdfg::analysis::OffloadState::reads_
protected

The documentation for this struct was generated from the following file: