rogue
Loading...
Searching...
No Matches
Variable.h
Go to the documentation of this file.
1
17#ifndef __ROGUE_INTERFACES_MEMORY_VARIABLE_H__
18#define __ROGUE_INTERFACES_MEMORY_VARIABLE_H__
19#include "rogue/Directives.h"
20
21#include <inttypes.h>
22#include <stdint.h>
23
24#include <memory>
25#include <string>
26#include <thread>
27#include <vector>
28
30
31#ifndef NO_PYTHON
32 #include <boost/python.hpp>
33#endif
34
35namespace rogue {
36namespace interfaces {
37namespace memory {
38
39class Block;
40class Variable;
41
43typedef std::shared_ptr<rogue::interfaces::memory::Variable> VariablePtr;
44
62class Variable {
63 friend class Block;
64
65 protected:
66 // Associated block
68
69 // Name
70 std::string name_;
71
72 // Path
73 std::string path_;
74
75 // Model
76 uint32_t modelId_;
77
78 // Byte reverse flag
80
81 // Bit reverse flag
83
84 // Total number of used bits for this value, used for standard non list variables
85 uint32_t bitTotal_;
86
87 // Fast copy base array
88 uint32_t* fastByte_;
89
90 // Total bytes (rounded up) for this value, based upon bitTotal_
91 uint32_t byteSize_;
92
93 // Variable coverage bytes, regardless of if bits are used
94 uint32_t varBytes_;
95
96 // Variable offset, in bytes
97 uint64_t offset_;
98
99 // Array of bit offsets
100 std::vector<uint32_t> bitOffset_;
101
102 // Array of bit sizes
103 std::vector<uint32_t> bitSize_;
104
105 // Min value for range checking
106 double minValue_;
107
108 // Max value for range checking
109 double maxValue_;
110
111 // Bulk Enable Flag
113
114 // Enable update calls
116
117 // Variable mode
118 std::string mode_;
119
120 // Overlap Enable Flag
122
123 // Verify flag
125
126 // Low byte value
127 uint32_t* lowTranByte_;
128
129 // High byte value
130 uint32_t* highTranByte_;
131
132 // Poiner to custom data
134
135 // Bin Point
136 uint32_t binPoint_;
137
138 // Stale flag
139 bool stale_;
140
141 // Stale start address
143
144 // Stale stop address
146
147 // Number of values
148 uint32_t numValues_;
149
150 // Bits per value
151 uint32_t valueBits_;
152
153 // Bytes per value
154 uint32_t valueBytes_;
155
156 // Stride per value
157 uint32_t valueStride_;
158
159 // Retry count
160 uint32_t retryCount_;
161
162#ifndef NO_PYTHON
164 // Python
166
167 // Set pointer function
168 void (rogue::interfaces::memory::Block::*setFuncPy_)(boost::python::object&,
169 rogue::interfaces::memory::Variable*,
170 int32_t index);
171
172 // Get pointer function
173 boost::python::object (rogue::interfaces::memory::Block::*getFuncPy_)(rogue::interfaces::memory::Variable*,
174 int32_t index);
175#endif
176
178 // C++ Byte Array
180
182 rogue::interfaces::memory::Variable*,
183 int32_t index);
184
186 rogue::interfaces::memory::Variable*,
187 int32_t index);
188
190 // C++ Uint
192
194 rogue::interfaces::memory::Variable*,
195 int32_t index);
196
197 uint64_t (rogue::interfaces::memory::Block::*getUInt_)(rogue::interfaces::memory::Variable*, int32_t index);
198
200 // C++ int
202
204 rogue::interfaces::memory::Variable*,
205 int32_t index);
206
207 int64_t (rogue::interfaces::memory::Block::*getInt_)(rogue::interfaces::memory::Variable*, int32_t index);
208
210 // C++ bool
212
214 rogue::interfaces::memory::Variable*,
215 int32_t index);
216
217 bool (rogue::interfaces::memory::Block::*getBool_)(rogue::interfaces::memory::Variable*, int32_t index);
218
220 // C++ String
222
223 void (rogue::interfaces::memory::Block::*setString_)(const std::string&,
224 rogue::interfaces::memory::Variable*,
225 int32_t index);
226
227 std::string (rogue::interfaces::memory::Block::*getString_)(rogue::interfaces::memory::Variable*, int32_t index);
228
230 // C++ Float
232
234 rogue::interfaces::memory::Variable*,
235 int32_t index);
236
237 float (rogue::interfaces::memory::Block::*getFloat_)(rogue::interfaces::memory::Variable*, int32_t index);
238
240 // C++ double
242
244 rogue::interfaces::memory::Variable*,
245 int32_t index);
246
247 double (rogue::interfaces::memory::Block::*getDouble_)(rogue::interfaces::memory::Variable*, int32_t index);
248
250 // C++ Float16 (half-precision)
252
254 rogue::interfaces::memory::Variable*,
255 int32_t index);
256
257 float (rogue::interfaces::memory::Block::*getFloat16_)(rogue::interfaces::memory::Variable*, int32_t index);
258
260 // C++ Float8 (E4M3)
262
264 rogue::interfaces::memory::Variable*,
265 int32_t index);
266
267 float (rogue::interfaces::memory::Block::*getFloat8_)(rogue::interfaces::memory::Variable*, int32_t index);
268
270 // C++ BFloat16 (Brain Float 16)
272
274 rogue::interfaces::memory::Variable*,
275 int32_t index);
276
277 float (rogue::interfaces::memory::Block::*getBFloat16_)(rogue::interfaces::memory::Variable*, int32_t index);
278
280 // C++ TensorFloat32 (NVIDIA TF32)
282
284 rogue::interfaces::memory::Variable*,
285 int32_t index);
286
287 float (rogue::interfaces::memory::Block::*getTensorFloat32_)(rogue::interfaces::memory::Variable*, int32_t index);
288
290 // C++ Float6 (E3M2)
292
294 rogue::interfaces::memory::Variable*,
295 int32_t index);
296
297 float (rogue::interfaces::memory::Block::*getFloat6_)(rogue::interfaces::memory::Variable*, int32_t index);
298
300 // C++ Float4 (E2M1)
302
304 rogue::interfaces::memory::Variable*,
305 int32_t index);
306
307 float (rogue::interfaces::memory::Block::*getFloat4_)(rogue::interfaces::memory::Variable*, int32_t index);
308
310 // C++ fixed point
312
314 rogue::interfaces::memory::Variable*,
315 int32_t index);
316
317 double (rogue::interfaces::memory::Block::*getFixed_)(rogue::interfaces::memory::Variable*, int32_t index);
318
319 public:
351 std::string mode,
352 double minimum,
353 double maximum,
354 uint64_t offset,
355 std::vector<uint32_t> bitOffset,
356 std::vector<uint32_t> bitSize,
357 bool overlapEn,
358 bool verify,
359 bool bulkOpEn,
360 bool updateNotify,
361 uint32_t modelId,
362 bool byteReverse,
363 bool bitReverse,
364 uint32_t binPoint,
365 uint32_t numValues,
366 uint32_t valueBits,
367 uint32_t valueStride,
368 uint32_t retryCount);
369
371 static void setup_python();
372
401 Variable(std::string name,
402 std::string mode,
403 double minimum,
404 double maximum,
405 uint64_t offset,
406 std::vector<uint32_t> bitOffset,
407 std::vector<uint32_t> bitSize,
408 bool overlapEn,
409 bool verify,
410 bool bulkOpEn,
411 bool updateNotify,
412 uint32_t modelId,
413 bool byteReverse,
414 bool bitReverse,
415 uint32_t binPoint,
416 uint32_t numValues,
417 uint32_t valueBits,
418 uint32_t valueStride,
419 uint32_t retryCount);
420
422 virtual ~Variable();
423
436 void shiftOffsetDown(uint32_t shift, uint32_t minSize);
437
447 void updatePath(std::string path);
448
459 uint32_t modelId() const {
460 return modelId_;
461 }
462
464 uint32_t bitTotal() const {
465 return bitTotal_;
466 }
467
469 uint32_t byteSize() const {
470 return byteSize_;
471 }
472
474 const std::string& name() const {
475 return name_;
476 }
477
487 const std::string& mode() const {
488 return mode_;
489 }
490
492 const std::string& path() const {
493 return path_;
494 }
495
497 double minimum();
498
500 double maximum();
501
503 uint32_t varBytes();
504
506 uint64_t offset();
507
509 bool verifyEn();
510
512 bool overlapEn();
513
515 bool bulkOpEn();
516
518 uint32_t numValues() {
519 return numValues_;
520 }
521
523 uint32_t valueBits() {
524 return valueBits_;
525 }
526
528 uint32_t valueBytes() {
529 return valueBytes_;
530 }
531
533 uint32_t valueStride() {
534 return valueStride_;
535 }
536
538 uint32_t retryCount() {
539 return retryCount_;
540 }
541
543 virtual void queueUpdate();
544
552 void rateTest();
553
555 void setLogLevel(uint32_t level);
556
558 std::string getDumpValue(bool read);
559
567 void read();
568
570 // C++ Byte Array
572
583 void setByteArray(uint8_t* value, int32_t index = -1);
584
595 void getByteArray(uint8_t* value, int32_t index = -1);
596
598 // C++ Uint
600
611 void setUInt(uint64_t& value, int32_t index = -1);
612
619 void setValue(uint64_t value, int32_t index = -1) {
620 setUInt(value, index);
621 }
622
633 uint64_t getUInt(int32_t index = -1);
634
641 void getValue(uint64_t& valueRet, int32_t index = -1) {
642 valueRet = getUInt(index);
643 }
644
646 // C++ int
648
659 void setInt(int64_t& value, int32_t index = -1);
660
667 void setValue(int64_t value, int32_t index = -1) {
668 setInt(value, index);
669 }
670
681 int64_t getInt(int32_t index = -1);
682
689 void getValue(int64_t& valueRet, int32_t index = -1) {
690 valueRet = getInt(index);
691 }
692
694 // C++ bool
696
707 void setBool(bool& value, int32_t index = -1);
708
715 void setValue(bool value, int32_t index = -1) {
716 setBool(value, index);
717 }
718
729 bool getBool(int32_t index = -1);
730
737 void getValue(bool& valueRet, int32_t index = -1) {
738 valueRet = getBool(index);
739 }
740
742 // C++ String
744
755 void setString(const std::string& value, int32_t index = -1);
756
763 void setValue(const std::string& value, int32_t index = -1) {
764 setString(value, index);
765 }
766
777 std::string getString(int32_t index = -1);
778
785 void getString(std::string& retString, int32_t index = -1) {
786 getValue(retString, index);
787 }
788
795 void getValue(std::string& valueRet, int32_t index = -1);
796
798 // C++ Float
800
811 void setFloat(float& value, int32_t index = -1);
812
819 void setValue(float value, int32_t index = -1) {
820 setFloat(value, index);
821 }
822
833 float getFloat(int32_t index = -1);
834
841 void getValue(float& valueRet, int32_t index = -1) {
842 valueRet = getFloat(index);
843 }
844
846 // C++ Float16 (half-precision)
848
860 void setFloat16(float& value, int32_t index = -1);
861
872 float getFloat16(int32_t index = -1);
873
875 // C++ Float8 (E4M3)
877
889 void setFloat8(float& value, int32_t index = -1);
890
901 float getFloat8(int32_t index = -1);
902
904 // C++ BFloat16 (Brain Float 16)
906
918 void setBFloat16(float& value, int32_t index = -1);
919
930 float getBFloat16(int32_t index = -1);
931
933 // C++ TensorFloat32 (NVIDIA TF32)
935
947 void setTensorFloat32(float& value, int32_t index = -1);
948
959 float getTensorFloat32(int32_t index = -1);
960
962 // C++ Float6 (E3M2)
964
976 void setFloat6(float& value, int32_t index = -1);
977
988 float getFloat6(int32_t index = -1);
989
991 // C++ Float4 (E2M1)
993
1000 void setFloat4(float& value, int32_t index = -1);
1001
1008 float getFloat4(int32_t index = -1);
1009
1011 // C++ double
1013
1024 void setDouble(double& value, int32_t index = -1);
1025
1032 void setValue(double value, int32_t index = -1) {
1033 setDouble(value, index);
1034 }
1035
1046 double getDouble(int32_t index = -1);
1047
1054 void getValue(double& valueRet, int32_t index = -1) {
1055 valueRet = getDouble(index);
1056 }
1057
1059 // C++ fixed point
1061
1073 void setFixed(double& value, int32_t index = -1);
1074
1085 double getFixed(int32_t index = -1);
1086};
1087
1088#ifndef NO_PYTHON
1089
1099 public boost::python::wrapper<rogue::interfaces::memory::Variable> {
1100 boost::python::object model_;
1101
1102 public:
1120 VariableWrap(std::string name,
1121 std::string mode,
1122 boost::python::object minimum,
1123 boost::python::object maximum,
1124 uint64_t offset,
1125 boost::python::object bitOffset,
1126 boost::python::object bitSize,
1127 bool overlapEn,
1128 bool verify,
1129 bool bulkOpEn,
1130 bool updateNotify,
1131 boost::python::object model,
1132 boost::python::object listData,
1133 uint32_t retryCount);
1134
1139 void updateOffset(boost::python::object& bitOffset);
1140
1152 void set(boost::python::object& value, int32_t index);
1153
1165 boost::python::object get(int32_t index);
1166
1172 boost::python::object toBytes(boost::python::object& value);
1173
1179 boost::python::object fromBytes(boost::python::object& value);
1180
1187 void defQueueUpdate();
1188
1195 void queueUpdate();
1196
1201 boost::python::object bitOffset();
1202
1207 boost::python::object bitSize();
1208};
1209
1210typedef std::shared_ptr<rogue::interfaces::memory::VariableWrap> VariableWrapPtr;
1211
1212#endif
1213
1214} // namespace memory
1215} // namespace interfaces
1216} // namespace rogue
1217
1218#endif
Memory interface block device.
Definition Block.h:96
Internal Boost.Python wrapper for rogue::interfaces::memory::Variable. Enables Python subclasses to o...
Definition Variable.h:1099
boost::python::object get(int32_t index)
Gets value from RemoteVariable.
Definition Variable.cpp:714
boost::python::object fromBytes(boost::python::object &value)
Converts a byte representation to a Python value object.
Definition Variable.cpp:728
void defQueueUpdate()
Calls the base-class queueUpdate() implementation.
Definition Variable.cpp:732
void queueUpdate()
Dispatches queue update callback.
Definition Variable.cpp:737
boost::python::object bitOffset()
Returns bit-offset configuration.
Definition Variable.cpp:750
boost::python::object bitSize()
Returns bit-size configuration.
Definition Variable.cpp:754
void updateOffset(boost::python::object &bitOffset)
Updates bit-offset definition from Python.
void set(boost::python::object &value, int32_t index)
Sets value from RemoteVariable.
Definition Variable.cpp:708
boost::python::object toBytes(boost::python::object &value)
Converts a Python value object to a byte representation.
Definition Variable.cpp:723
Memory variable descriptor and typed accessor facade.
Definition Variable.h:62
void(rogue::interfaces::memory::Block::* setByteArray_)(const uint8_t *, rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:181
virtual ~Variable()
Destroys the variable instance.
Definition Variable.cpp:562
float getFloat8(int32_t index=-1)
Gets 8-bit E4M3 float value.
float getFloat6(int32_t index=-1)
Gets 6-bit E3M2 float value.
void getValue(bool &valueRet, int32_t index=-1)
Gets boolean value into output reference.
Definition Variable.h:737
boost::python::object(rogue::interfaces::memory::Block::* getFuncPy_)(rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:173
void setLogLevel(uint32_t level)
Sets logging level for variable's block.
Definition Variable.cpp:799
void(rogue::interfaces::memory::Block::* getByteArray_)(uint8_t *, rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:185
void(rogue::interfaces::memory::Block::* setFloat4_)(const float &, rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:303
static rogue::interfaces::memory::VariablePtr create(std::string name, std::string mode, double minimum, double maximum, uint64_t offset, std::vector< uint32_t > bitOffset, std::vector< uint32_t > bitSize, bool overlapEn, bool verify, bool bulkOpEn, bool updateNotify, uint32_t modelId, bool byteReverse, bool bitReverse, uint32_t binPoint, uint32_t numValues, uint32_t valueBits, uint32_t valueStride, uint32_t retryCount)
Creates a memory variable descriptor.
Definition Variable.cpp:47
void(rogue::interfaces::memory::Block::* setFloat8_)(const float &, rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:263
int64_t(rogue::interfaces::memory::Block::* getInt_)(rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:207
double getDouble(int32_t index=-1)
Gets double value.
void setValue(float value, int32_t index=-1)
Convenience alias for setFloat.
Definition Variable.h:819
uint32_t retryCount()
Returns retry count.
Definition Variable.h:538
uint64_t offset()
Returns variable byte offset.
Definition Variable.cpp:649
void setValue(int64_t value, int32_t index=-1)
Convenience alias for setInt.
Definition Variable.h:667
void getValue(float &valueRet, int32_t index=-1)
Gets float value into output reference.
Definition Variable.h:841
void setTensorFloat32(float &value, int32_t index=-1)
Sets TensorFloat32 value.
void getValue(int64_t &valueRet, int32_t index=-1)
Gets signed integer value into output reference.
Definition Variable.h:689
uint32_t modelId() const
Returns model ID of the variable.
Definition Variable.h:459
bool getBool(int32_t index=-1)
Gets boolean value.
Definition Variable.cpp:966
float getFloat16(int32_t index=-1)
Gets half-precision float value.
float getFloat(int32_t index=-1)
Gets float value.
void setFloat6(float &value, int32_t index=-1)
Sets 6-bit E3M2 float value.
float(rogue::interfaces::memory::Block::* getTensorFloat32_)(rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:287
void setFixed(double &value, int32_t index=-1)
Sets fixed-point value.
double(rogue::interfaces::memory::Block::* getDouble_)(rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:247
const std::string & mode() const
Returns variable mode string.
Definition Variable.h:487
void(rogue::interfaces::memory::Block::* setFloat6_)(const float &, rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:293
void setFloat4(float &value, int32_t index=-1)
Set a C++ float value into the variable using Float4 (E2M1) conversion.
float(rogue::interfaces::memory::Block::* getBFloat16_)(rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:277
uint32_t bitTotal() const
Returns total number of bits for this value.
Definition Variable.h:464
virtual void queueUpdate()
Executes queue update callback (unused in C++).
Definition Variable.cpp:760
void(rogue::interfaces::memory::Block::* setFuncPy_)(boost::python::object &, rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:168
bool verifyEn()
Returns verify-enable flag.
Definition Variable.cpp:654
uint32_t varBytes()
Returns variable range in bytes.
Definition Variable.cpp:644
float(rogue::interfaces::memory::Block::* getFloat8_)(rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:267
void getValue(double &valueRet, int32_t index=-1)
Gets double value into output reference.
Definition Variable.h:1054
float(rogue::interfaces::memory::Block::* getFloat16_)(rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:257
bool bulkOpEn()
Returns bulk-operation enable flag.
Definition Variable.cpp:664
void(rogue::interfaces::memory::Block::* setDouble_)(const double &, rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:243
rogue::interfaces::memory::Block * block_
Definition Variable.h:67
void read()
Performs a read operation for this variable.
Definition Variable.cpp:803
float(rogue::interfaces::memory::Block::* getFloat_)(rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:237
void(rogue::interfaces::memory::Block::* setBFloat16_)(const float &, rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:273
void(rogue::interfaces::memory::Block::* setUInt_)(const uint64_t &, rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:193
uint64_t getUInt(int32_t index=-1)
Gets unsigned integer value.
Definition Variable.cpp:926
void setFloat(float &value, int32_t index=-1)
Sets float value.
void(rogue::interfaces::memory::Block::* setFloat16_)(const float &, rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:253
void(rogue::interfaces::memory::Block::* setFloat_)(const float &, rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:233
void(rogue::interfaces::memory::Block::* setInt_)(const int64_t &, rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:203
double maximum()
Returns maximum value.
Definition Variable.cpp:639
int64_t getInt(int32_t index=-1)
Gets signed integer value.
Definition Variable.cpp:946
float getTensorFloat32(int32_t index=-1)
Gets TensorFloat32 value.
double getFixed(int32_t index=-1)
Gets fixed-point value.
std::string(rogue::interfaces::memory::Block::* getString_)(rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:227
double minimum()
Returns minimum value.
Definition Variable.cpp:634
bool(rogue::interfaces::memory::Block::* getBool_)(rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:217
void setInt(int64_t &value, int32_t index=-1)
Sets signed integer value.
Definition Variable.cpp:938
float getFloat4(int32_t index=-1)
Get the variable's value as a C++ float using Float4 (E2M1) conversion.
bool overlapEn()
Returns overlap-enable flag.
Definition Variable.cpp:659
void setByteArray(uint8_t *value, int32_t index=-1)
Sets value from a raw byte array.
Definition Variable.cpp:898
void setBFloat16(float &value, int32_t index=-1)
Sets BFloat16 value.
std::vector< uint32_t > bitSize_
Definition Variable.h:103
void(rogue::interfaces::memory::Block::* setFixed_)(const double &, rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:313
void setDouble(double &value, int32_t index=-1)
Sets double value.
uint32_t valueBits()
Returns number of bits per value.
Definition Variable.h:523
std::string getString(int32_t index=-1)
Gets string value.
Definition Variable.cpp:986
void(rogue::interfaces::memory::Block::* setString_)(const std::string &, rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:223
uint32_t byteSize() const
Returns total bytes (rounded up) for this value.
Definition Variable.h:469
void setString(const std::string &value, int32_t index=-1)
Sets string value.
Definition Variable.cpp:978
void updatePath(std::string path)
Updates the hierarchical path string for this variable.
Definition Variable.cpp:629
void setUInt(uint64_t &value, int32_t index=-1)
Sets an unsigned integer value.
Definition Variable.cpp:918
void setBool(bool &value, int32_t index=-1)
Sets boolean value.
Definition Variable.cpp:958
void setValue(const std::string &value, int32_t index=-1)
Convenience alias for setString.
Definition Variable.h:763
float(rogue::interfaces::memory::Block::* getFloat6_)(rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:297
uint32_t numValues()
Returns number of values.
Definition Variable.h:518
std::string getDumpValue(bool read)
Returns string representation of value using default converters.
Definition Variable.cpp:808
void getString(std::string &retString, int32_t index=-1)
Gets string value into output reference.
Definition Variable.h:785
void setValue(double value, int32_t index=-1)
Convenience alias for setDouble.
Definition Variable.h:1032
void(rogue::interfaces::memory::Block::* setTensorFloat32_)(const float &, rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:283
const std::string & path() const
Returns variable path.
Definition Variable.h:492
void getValue(uint64_t &valueRet, int32_t index=-1)
Gets unsigned integer value into output reference.
Definition Variable.h:641
void(rogue::interfaces::memory::Block::* setBool_)(const bool &, rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:213
double(rogue::interfaces::memory::Block::* getFixed_)(rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:317
void setFloat16(float &value, int32_t index=-1)
Sets half-precision float value.
void rateTest()
Runs a local throughput benchmark for variable get/set operations.
Definition Variable.cpp:762
float getBFloat16(int32_t index=-1)
Gets BFloat16 value.
static void setup_python()
Registers Python bindings for this class.
Definition Variable.cpp:89
uint32_t valueStride()
Returns byte stride per value.
Definition Variable.h:533
float(rogue::interfaces::memory::Block::* getFloat4_)(rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:307
void shiftOffsetDown(uint32_t shift, uint32_t minSize)
Shifts variable offset and packed bit fields downward.
Definition Variable.cpp:569
const std::string & name() const
Returns variable name.
Definition Variable.h:474
uint32_t valueBytes()
Returns number of bytes per value.
Definition Variable.h:528
std::vector< uint32_t > bitOffset_
Definition Variable.h:100
void setValue(bool value, int32_t index=-1)
Convenience alias for setBool.
Definition Variable.h:715
uint64_t(rogue::interfaces::memory::Block::* getUInt_)(rogue::interfaces::memory::Variable *, int32_t index)
Definition Variable.h:197
void setFloat8(float &value, int32_t index=-1)
Sets 8-bit E4M3 float value.
void setValue(uint64_t value, int32_t index=-1)
Convenience alias for setUInt.
Definition Variable.h:619
void getByteArray(uint8_t *value, int32_t index=-1)
Gets value into a raw byte array.
Definition Variable.cpp:906
std::shared_ptr< rogue::interfaces::memory::VariableWrap > VariableWrapPtr
Definition Variable.h:1210
std::shared_ptr< rogue::interfaces::memory::Variable > VariablePtr
Definition Variable.h:43