FreeTensor
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
freetensor::NativeCodeParam Struct Reference

#include <native_code.h>

Collaboration diagram for freetensor::NativeCodeParam:
Collaboration graph
[legend]

Public Member Functions

bool isInClosure () const
 Accept user input even if there is a closure.
 
 NativeCodeParam (const std::string &name, const std::optional< DataType > &dtype, const AccessType &atype, const std::optional< MemType > &mtype, const Ref< Ref< Array > > &closure, bool updateClosure)
 

Public Attributes

std::string name_
 
std::optional< DataTypedtype_
 
AccessType atype_
 Null if atype_ == Bypass.
 
std::optional< MemTypemtype_
 
Ref< Ref< Array > > closure_
 Null if atype_ == Bypass.
 
bool updateClosure_
 Data bound to this parameter.
 

Detailed Description

Declare a parameter of a NativeCode

A NativeCodeParam contains all information from a FuncParam, plus the type information from the VarDef nodes of the function body (so Driver can run without the function body AST).

A parameter can be safely ignored by the program. In this case, atype_ is set to AccessType::Bypass, while dtype_ and mtype_ is unset. NOTE: Since we allow removing a parameter, please be aware of potential bugs that a newly introduced parameter takes the same name with the removed one. Currently we only introduce new parameters in autograd, with ".grad" and ".tape" suffix in names, so it's OK.

Constructor & Destructor Documentation

◆ NativeCodeParam()

freetensor::NativeCodeParam::NativeCodeParam ( const std::string &  name,
const std::optional< DataType > &  dtype,
const AccessType atype,
const std::optional< MemType > &  mtype,
const Ref< Ref< Array > > &  closure,
bool  updateClosure 
)
inline

Member Function Documentation

◆ isInClosure()

bool freetensor::NativeCodeParam::isInClosure ( ) const
inline

Accept user input even if there is a closure.

Member Data Documentation

◆ atype_

AccessType freetensor::NativeCodeParam::atype_

Null if atype_ == Bypass.

◆ closure_

Ref<Ref<Array> > freetensor::NativeCodeParam::closure_

Null if atype_ == Bypass.

◆ dtype_

std::optional<DataType> freetensor::NativeCodeParam::dtype_

◆ mtype_

std::optional<MemType> freetensor::NativeCodeParam::mtype_

◆ name_

std::string freetensor::NativeCodeParam::name_

◆ updateClosure_

bool freetensor::NativeCodeParam::updateClosure_

Data bound to this parameter.


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