ATLAS Offline Software
Classes | Functions
CaloPrefetch Namespace Reference

This software was developed for the ATLAS project. More...

Classes

class  ArenaHandlePrefetch
 Wrapper for SG::ArenaHandle with pre-fetching. More...
 

Functions

template<typename Iter >
void nextDDE (Iter iter, Iter endIter)
 Prefetch next CaloDDE. More...
 
template<typename Iter >
void nextDDE (Iter iter, Iter endIter, int count)
 Prefetch few next CaloDDEs. More...
 

Detailed Description

This software was developed for the ATLAS project.

If you use all or part of it, please give an appropriate acknowledgment.

Version
$Id$
Author
Andy Salnikov

Function Documentation

◆ nextDDE() [1/2]

template<typename Iter >
void CaloPrefetch::nextDDE ( Iter  iter,
Iter  endIter 
)
inline

Prefetch next CaloDDE.

This prefetch method should be used with the collection of CaloCell pointers. It prefetches CaloCell objects two iterations ahead and CaloDDE object from CaloCell for the next iteration. On input iter must not be equal to endIter (this is not checked).

Definition at line 47 of file CaloPrefetch.h.

48 {
49  if (++iter != endIter) {
50  // Get DDE, cell itself is expected to be in the cache already
51  CxxUtils::prefetchObj((*iter)->caloDDE());
52  if (++iter != endIter) {
53  // prefetch cell two steps ahead
54  CxxUtils::prefetchObj<CaloCell>(*iter);
55  }
56  }
57 }

◆ nextDDE() [2/2]

template<typename Iter >
void CaloPrefetch::nextDDE ( Iter  iter,
Iter  endIter,
int  count 
)
inline

Prefetch few next CaloDDEs.

More generic version of the DDE prefetching mechanism intended for use in tighter loops when pre-fetching one step ahead is not enough. Argument specifies how many DDEs need to be prefetched.

Above specialization for one-iteration prefetch is still useful, this generic method is more complex and may have issues with inlining.

Definition at line 72 of file CaloPrefetch.h.

73 {
74  for (int i = 0; i != count; ++ i) {
75  if (++iter != endIter) {
76  // Get DDE, cell itself is expected to be in the cache already
77  CxxUtils::prefetchObj((*iter)->caloDDE());
78  } else {
79  return;
80  }
81  }
82  for (int i = 0; i != count; ++ i) {
83  if (++iter != endIter) {
84  // prefetch cell two steps ahead
85  CxxUtils::prefetchObj<CaloCell>(*iter);
86  } else {
87  return;
88  }
89  }
90 }
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
lumiFormat.i
int i
Definition: lumiFormat.py:85
CxxUtils::prefetchObj
void prefetchObj(const T *ptr)
Generic prefetch of the object of specific types (sizes).
Definition: prefetch.h:108