|
FreeTensor
|
#include <native_code.h>

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< DataType > | dtype_ |
| AccessType | atype_ |
| Null if atype_ == Bypass. | |
| std::optional< MemType > | mtype_ |
| Ref< Ref< Array > > | closure_ |
| Null if atype_ == Bypass. | |
| bool | updateClosure_ |
| Data bound to this parameter. | |
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.
|
inline |
|
inline |
Accept user input even if there is a closure.
| AccessType freetensor::NativeCodeParam::atype_ |
Null if atype_ == Bypass.
| std::optional<DataType> freetensor::NativeCodeParam::dtype_ |
| std::optional<MemType> freetensor::NativeCodeParam::mtype_ |
| std::string freetensor::NativeCodeParam::name_ |
| bool freetensor::NativeCodeParam::updateClosure_ |
Data bound to this parameter.