TBCI Numerical high perf. C++ Library  2.8.0
Macros
cost.h File Reference

Preprocessor macros for estimating the "cost" of operations. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define COST_UNIT_LOAD   2
 There are several basic operations which are assigned a relative cost: (a good choice is to use twice the no. More...
 
#define COST_UNIT_STORE   COST_UNIT_LOAD
 
#define COST_NU_LOAD   6
 
#define COST_NU_STORE   (COST_NU_LOAD-2)
 
#define COST_MEMSET   (COST_UNIT_STORE/2)
 
#define COST_MEMCPY   ((COST_UNIT_LOAD+COST_UNIT_STORE)/2)
 
#define COST_ADD   2
 
#define COST_SUB   COST_ADD
 
#define COST_MULT   4
 
#define COST_DIV   (COST_MULT+2)
 
#define COST_CALL   4
 
#define COST_LOOP   2
 
#define COST_BRANCH   6
 
#define COST_SCHEDULE   10000
 

Detailed Description

Preprocessor macros for estimating the "cost" of operations.

Definition in file cost.h.

Macro Definition Documentation

#define COST_ADD   2

Definition at line 64 of file cost.h.

#define COST_BRANCH   6

Definition at line 88 of file cost.h.

#define COST_CALL   4

Definition at line 80 of file cost.h.

#define COST_DIV   (COST_MULT+2)

Definition at line 76 of file cost.h.

#define COST_LOOP   2

Definition at line 84 of file cost.h.

#define COST_MEMCPY   ((COST_UNIT_LOAD+COST_UNIT_STORE)/2)

Definition at line 60 of file cost.h.

#define COST_MEMSET   (COST_UNIT_STORE/2)

Definition at line 56 of file cost.h.

#define COST_MULT   4

Definition at line 72 of file cost.h.

#define COST_NU_LOAD   6

Definition at line 48 of file cost.h.

#define COST_NU_STORE   (COST_NU_LOAD-2)

Definition at line 52 of file cost.h.

#define COST_SCHEDULE   10000

Definition at line 92 of file cost.h.

#define COST_SUB   COST_ADD

Definition at line 68 of file cost.h.

#define COST_UNIT_LOAD   2

There are several basic operations which are assigned a relative cost: (a good choice is to use twice the no.

of avg. CPU cycles)

COST_UNIT_LOAD: Cost of a load op in a unit stride COST_UNIT_STORE: Cost of a store op in a unit stride COST_NU_LOAD: Cost of a load op in a non-unit stride COST_NU_STORE: Cost of a store op in a non-unit stride COST_MEMSET: Cost of a memset per element COST_MEMCPY: Cost of a memcpy per element COST_ADD: Cost of an addition op COST_SUB: Cost of a subtraction op COST_MULT: Cost of a multiplication op COST_DIV: Cost of a division op COST_CALL: Cost of a (non-inlined) library call (incl. return) COST_LOOP: Cost of a loop or easily predictable branch COST_BRANCH: Cost of a hard to predict branch COST_SCHEDULE: Cost of signalling another thread and have it scheduled by the OS

Estimating the cost of certain operation can be useful to have the compiler decide which function to pick, if there are several alternatives.

Definition at line 40 of file cost.h.

#define COST_UNIT_STORE   COST_UNIT_LOAD

Definition at line 44 of file cost.h.