1 #ifndef HALIDE_FUNCTION_PTR_H
2 #define HALIDE_FUNCTION_PTR_H
19 struct FunctionContents;
32 FunctionGroup *
weak =
nullptr;
46 FunctionContents *
get()
const;
86 return get() < other.
get();
Support classes for reference-counting via intrusive shared pointers.
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
A possibly-weak pointer to a Halide function.
void weaken()
Convert from a strong reference to a weak reference.
IntrusivePtr< FunctionGroup > strong
A strong and weak pointer to the group.
FunctionContents * operator->() const
FunctionContents * get() const
Get the opaque FunctionContents object this pointer refers to.
bool operator<(const FunctionPtr &other) const
Pointer comparison, for using FunctionPtrs as keys in maps and sets.
bool defined() const
Check if the reference is defined.
FunctionGroup * group() const
Get a pointer to the group this Function belongs to.
void strengthen()
Convert from a weak reference to a strong reference.
FunctionContents & operator*() const
bool same_as(const FunctionPtr &other) const
Check if two FunctionPtrs refer to the same Function.
int idx
The index of the function within the group.
HALIDE_ALWAYS_INLINE bool defined() const
T * get() const
Access the raw pointer in a variety of ways.