25 #ifndef TVM_TARGET_SE_SCOPE_H_ 26 #define TVM_TARGET_SE_SCOPE_H_ 32 #include <unordered_set> 207 memory_scope.
empty();
215 return target.
defined() && virtual_device_id != -1 && !memory_scope.
empty();
226 ICHECK(virtual_device_id != -1);
235 .describe(
"The type of the virtual device.")
238 .describe(
"The device id of the virtual device.")
241 .describe(
"The target describing how to compile for the virtual device.")
244 .describe(
"The area of memory w.r.t. the virtual device where data is stored.")
273 static SEScope FullyUnconstrained();
280 ICHECK_GT(device_type, 0);
292 return ForDeviceType(device.device_type, device.device_id);
297 return SEScope(device.device_type, device.device_id, std::move(target));
303 return SEScope(device.device_type, device.device_id, std::move(target),
304 std::move(memory_scope));
344 std::unordered_set<SEScope, StructuralHash, StructuralEqual> cache_;
349 #endif // TVM_TARGET_SE_SCOPE_H_ MemoryScope memory_scope
The scope of memory w.r.t. the virtual device which holds data.
Definition: se_scope.h:199
static SEScope ForDeviceType(int device_type, int virtual_device_id=-1)
Definition: se_scope.h:283
Performance counters for profiling via the PAPI library.
Definition: analyzer.h:36
static SEScope ForDeviceType(DLDeviceType device_type, int virtual_device_id=-1)
Returns the SEScope for device_type and (if not -1) virtual_device_id. The target and memory scope wi...
Definition: se_scope.h:279
bool IsFullyConstrained() const
Returns true if scope is fully constrained, ie target, device id and memory scope are all specified...
Definition: se_scope.h:214
friend class SEScope
Definition: se_scope.h:248
TVM_DECLARE_ATTRS(SEScopeNode, "SEScope")
Definition: se_scope.h:233
Target target
The Target describing how to compile for the virtual device.
Definition: se_scope.h:192
static SEScope ForDeviceTargetAndMemoryScope(const Device &device, Target target, MemoryScope memory_scope)
Returns the SEScope for device, target and memory_scope.
Definition: se_scope.h:301
bool defined() const
Definition: object.h:537
Describes at compile time where data is to be stored down to the device and memory scope level...
Definition: se_scope.h:161
#define TVM_ATTR_FIELD(FieldName)
Declare an attribute field.
Definition: attrs.h:76
Reference to string objects.
Definition: string.h:129
DLDeviceType device_type() const
Definition: se_scope.h:175
A cache of SEScopes. This can be used:
Definition: se_scope.h:333
DLDevice Device
Definition: ndarray.h:43
static SEScope ForDeviceAndTarget(const Device &device, Target target)
Returns the SEScope for device and target.
Definition: se_scope.h:296
bool IsFullyUnconstrained() const
Returns true if scope is fully unconstrained, ie no target/device type, device id or memory scope is ...
Definition: se_scope.h:205
static SEScope ForDevice(const Device &device)
Returns the SEScope for device.
Definition: se_scope.h:291
Managed reference class to TargetNode.
Definition: target.h:132
int device_type_int
The DLDeviceType (represtented as an int) of the virtual device. If target is known then this will be...
Definition: se_scope.h:173
Base class of all object reference.
Definition: object.h:504
The base class of the all the Use "curiously recurring template pattern".
Definition: attrs.h:793
Managed reference class to SEScopeNode.
Definition: se_scope.h:256
Compilation target object.
Optional container that to represent to a Nullable variant of T.
Definition: optional.h:51
static SEScope ForDeviceType(const Integer &device_type, int virtual_device_id=-1)
Definition: se_scope.h:286
int virtual_device_id
The device identifier for the virtual device. This must be resolved to a physical device identifier e...
Definition: se_scope.h:183
bool empty() const
Retun if the string is empty.
Definition: string.h:239
#define TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(TypeName, ParentType, ObjectName)
Definition: object.h:721
Device ToDevice() const
Returns the (virtual) Device implied by this SEScope. Both the device_type and virtual_device_must be...
Definition: se_scope.h:224
constexpr DLDeviceType kInvalidDeviceType
Definition: ndarray.h:51
Container of constant int that adds more constructors.
Definition: expr.h:356