Halide 19.0.0
Halide compiler and libraries
|
A possibly-weak pointer to a Halide function. More...
#include <FunctionPtr.h>
Public Member Functions | |
FunctionGroup * | group () const |
Get a pointer to the group this Function belongs to. | |
FunctionContents * | get () const |
Get the opaque FunctionContents object this pointer refers to. | |
FunctionContents & | operator* () const |
FunctionContents * | operator-> () const |
void | weaken () |
Convert from a strong reference to a weak reference. | |
void | strengthen () |
Convert from a weak reference to a strong reference. | |
bool | defined () const |
Check if the reference is defined. | |
bool | same_as (const FunctionPtr &other) const |
Check if two FunctionPtrs refer to the same Function. | |
bool | operator< (const FunctionPtr &other) const |
Pointer comparison, for using FunctionPtrs as keys in maps and sets. | |
Public Attributes | |
IntrusivePtr< FunctionGroup > | strong |
A strong and weak pointer to the group. | |
FunctionGroup * | weak = nullptr |
int | idx = 0 |
The index of the function within the group. | |
A possibly-weak pointer to a Halide function.
Take care to follow the rules mentioned above. Preserves weakness/strength on copy.
Note that Function objects are always strong pointers to Halide functions.
Definition at line 27 of file FunctionPtr.h.
|
inline |
Get a pointer to the group this Function belongs to.
Definition at line 39 of file FunctionPtr.h.
References Halide::Internal::IntrusivePtr< T >::get(), strong, and weak.
Referenced by same_as(), strengthen(), and weaken().
FunctionContents * Halide::Internal::FunctionPtr::get | ( | ) | const |
Get the opaque FunctionContents object this pointer refers to.
Wrap it in a Function to do anything interesting with it.
Referenced by operator*(), operator->(), and operator<().
|
inline |
Definition at line 48 of file FunctionPtr.h.
References get().
|
inline |
Definition at line 52 of file FunctionPtr.h.
References get().
|
inline |
|
inline |
|
inline |
Check if the reference is defined.
Definition at line 74 of file FunctionPtr.h.
References Halide::Internal::IntrusivePtr< T >::defined(), strong, and weak.
Referenced by Halide::Internal::Function::Compare::operator()().
|
inline |
Check if two FunctionPtrs refer to the same Function.
Definition at line 79 of file FunctionPtr.h.
Referenced by Halide::Internal::Function::same_as().
|
inline |
Pointer comparison, for using FunctionPtrs as keys in maps and sets.
Definition at line 85 of file FunctionPtr.h.
References get().
IntrusivePtr<FunctionGroup> Halide::Internal::FunctionPtr::strong |
A strong and weak pointer to the group.
Only one of these should be non-zero.
Definition at line 31 of file FunctionPtr.h.
Referenced by defined(), group(), strengthen(), and weaken().
FunctionGroup* Halide::Internal::FunctionPtr::weak = nullptr |
Definition at line 32 of file FunctionPtr.h.
Referenced by Halide::SimdOpCheckTest::check_one(), defined(), group(), strengthen(), and weaken().
int Halide::Internal::FunctionPtr::idx = 0 |
The index of the function within the group.
Definition at line 36 of file FunctionPtr.h.
Referenced by same_as().