9 #ifndef TALVOS_OBJECT_H
10 #define TALVOS_OBJECT_H
38 operator bool()
const {
return Stride != 0; }
85 template <typename T> T
get(uint32_t Element = 0) const;
104 void insert(
const std::vector<uint32_t> &Indices,
const Object &Element);
107 operator bool()
const {
return Data ?
true :
false; }
116 template <
typename T>
void set(T Value, uint32_t Element = 0);
const DescriptorElement * getDescriptorElements() const
Returns the descriptor array element information.
~Object()
Destroy this object.
void setDescriptorElements(const DescriptorElement *DAE)
Set the descriptor array elements for this object.
const uint8_t * getData() const
Returns an immutable pointer to the raw data backing this object.
Structure to describe the memory layout of a matrix.
void store(Memory &Mem, uint64_t Address) const
Store the value of this object to memory at Address.
void set(T Value, uint32_t Element=0)
Set the value of this object to a scalar of type T.
static Object load(const Type *Ty, const Memory &Mem, uint64_t Address)
Create an object of type Ty from the data at Address.
enum talvos::PtrMatrixLayout::@4 Order
Specifies the order of the elements in memory.
const DescriptorElement * DescriptorElements
Descriptor array element information.
uint32_t Stride
The stride in bytes between columns (COL_MAJOR) or rows (ROW_MAJOR).
This class represents an address space in the virtual device.
uint8_t * Data
The raw data backing this object.
Structure used to hold information about an element of a descriptor array.
PtrMatrixLayout MatrixLayout
The memory layout of a matrix that this object points to.
void zero()
Set all of the value bits in this object to zero.
void setMatrixLayout(const PtrMatrixLayout &ML)
Set the matrix layout for this object.
Object()
Create an empty, uninitialized object.
uint8_t * getData()
Returns a mutable pointer to the raw data backing this object.
const Type * getType() const
Returns the type of this object.
Object & operator=(const Object &Src)
Copy-assign to this object, cloning the data from Src.
uint64_t NumBytes
Size of descriptor element.
const PtrMatrixLayout & getMatrixLayout() const
Get the matrix layout for this object.
This class represents a SPIR-V type.
void insert(const std::vector< uint32_t > &Indices, const Object &Element)
Insert the value of Element into a composite object.
This class represents an instruction result.
T get(uint32_t Element=0) const
Get the value of this object as a scalar of type T.
Object extract(const std::vector< uint32_t > &Indices) const
Extract an element from a composite object.
friend std::ostream & operator<<(std::ostream &Stream, const Object &O)
Allow an Object to be inserted into an output stream.
uint64_t Address
Address of descriptor element.
const Type * Ty
The type of this object.