|
ATLAS Offline Software
|
Go to the documentation of this file.
31 TempInterface (
size_t size) : m_size (
size) {}
34 virtual size_t size_v()
const {
return m_size; }
35 virtual size_t capacity_v()
const {
return m_size; }
72 if( nremaining == 0) {
86 dyn_auxids = iio->getDynamicAuxIDs();
87 sel_auxids = iio->getSelectedAuxIDs();
92 copy.resize (nremaining);
97 if(auxid == SG::null_auxid)
continue;
101 if (
r.isLinked (auxid))
continue;
111 if (dyn_auxids.
test(auxid) || !new_auxids.
test(auxid)) {
113 if (
info->vetoed(auxid))
continue;
119 if (dyn_auxids.
test(auxid) && !sel_auxids.
test(auxid)) {
131 const std::type_info* typ = iio->getIOType (auxid);
132 if (strstr (typ->name(),
"PackedContainer") !=
nullptr) {
149 const size_t eltSize{
r.getEltSize(auxid) };
150 const std::string
typeName{
r.getTypeName(auxid) };
151 const unsigned int nmantissa{
info !=
nullptr ?
info->compression(auxid) : 0 };
154 void* dst =
copy.getData (auxid, nremaining, nremaining);
158 if (linked_auxid != null_auxid) {
161 size_t sz =
v->size();
162 copy.getData (linked_auxid, 0,
sz);
166 TempInterface srciface (orig.
size());
167 srciface.setStore (&orig);
168 TempInterface dstiface (
copy.size());
169 dstiface.setStore (&
copy);
172 if (nremaining ==
size) {
174 r.copyForOutput (auxid, dstiface, 0, srciface, 0,
size);
178 for (std::size_t isrc = 0, idst = 0; isrc <
size; ++isrc) {
179 if (!dec || !dec->
thinned(isrc)) {
180 r.copyForOutput (auxid, dstiface, idst, srciface, isrc, 1);
201 const std::size_t idst,
203 const std::size_t eltSize,
205 const unsigned int nmantissa)
210 static const unsigned int NMANTISSA_MAX = 23;
211 if (nmantissa == 0 || nmantissa >= NMANTISSA_MAX)
return;
214 static const std::vector<CxxUtils::FloatCompressor> compressors = [] {
215 std::vector<CxxUtils::FloatCompressor>
result;
216 result.reserve(NMANTISSA_MAX);
217 for (std::size_t
idx = 0;
idx < NMANTISSA_MAX; ++
idx)
223 char* eltPtr =
reinterpret_cast<char*
>(dst) + idst*eltSize;
228 float*
f =
reinterpret_cast<float*
> (eltPtr);
229 for (
size_t i = 0;
i <
n;
i++) {
230 *
f = compressors[nmantissa].reduceFloatPrecision(*
f);
233 }
else if (
typeName ==
"std::vector<float>"){
234 for (
size_t i = 0;
i <
n;
i++) {
235 std::vector<float> &
vals = *(
reinterpret_cast<std::vector<float>*
>(eltPtr));
237 val = compressors[nmantissa].reduceFloatPrecision(
val);
void copyAuxStoreThinned(const SG::IConstAuxStore &orig, SG::IAuxStore ©, const SG::ThinningInfo *info)
Helper to copy an aux store while applying thinning.
virtual const void * getData(SG::auxid_t auxid) const =0
Return the data vector for one aux data item.
void lossyFloatCompress(void *dst, const std::size_t dst_index, const std::size_t n, const std::size_t eltSize, const std::string &typeName, const unsigned int nmantissa)
Helper method to apply lossy float compression.
static AuxTypeRegistry & instance()
Return the singleton registry instance.
void copyAuxStoreThinned NO_SANITIZE_UNDEFINED(const SG::IConstAuxStore &orig, SG::IAuxStore ©, const SG::ThinningInfo *info)
Helper to copy an aux store while applying thinning.
Hold thinning decisions for one container.
bool thinned(size_t ndx) const
Return true if element ndx should be thinned.
Hold thinning decisions for one container.
size_t thinnedSize() const
Return the size of the container being thinned after thinning.
virtual size_t size() const =0
Return the number of elements in the store.
Interface providing I/O for a generic auxiliary store.
Handle mappings between names and auxid_t.
void setStore(SG::IAuxStore *store)
Set the store associated with this object.
bool isSigned() const
Are elements being written as signed numbers?
uint8_t nmantissa() const
The number of bits used for the mantissa portion of a float-point representation, excluding a sign bi...
Hold thinning/slimming information for a given object.
size_t auxid_t
Identifier for a particular aux data item.
Helper to copy an aux store while applying thinning.
bool isFloat() const
Are elements being written as floating-point numbers?
Interface providing I/O for a generic auxiliary store.
uint8_t nbits() const
The number of bits used to store each element.
Hold information about an option setting request.
virtual const IAuxTypeVector * linkedVector(SG::auxid_t) const
Return interface for a linked variable.
Interface for non-const operations on an auxiliary store.
Container to hold aux data to be stored in a packed form.
Abstract interface for manipulating vectors of arbitrary types.
Handle mappings between names and auxid_t.
Interface for non-const operations on an auxiliary store.
A set of aux data identifiers.
bool rounding() const
Should floats be rounded during writing?
Helper to disable undefined behavior sanitizer for a function.
Manage lookup of vectors of auxiliary data.
Interface for const operations on an auxiliary store.
Interface for const operations on an auxiliary store.
virtual const SG::auxid_set_t & getAuxIDs() const =0
Return a set of identifiers for existing data items in this store.
virtual size_t capacity_v() const =0
Return the capacity of the container.
virtual size_t size_v() const =0
Return the size of the container.
float scale() const
Return the scale for floating-point numbers.
Describe how the contents of a PackedContainer are to be saved.
bool test(bit_t bit) const
Test to see if a bit is set.