41 integer :: dblock_size
42 integer :: zblock_size
66 integer,
intent(in) :: data_size
67 integer,
intent(in) :: line_size
69 cache%size = data_size
70 cache%line_size = line_size
85 type(
cache_t),
intent(in) :: l1_cache
86 type(
cache_t),
intent(in) :: l2_cache
88 integer,
parameter :: cpu_default_states_per_block = 4
93 this%dblock_size = this%l1%size / (cpu_default_states_per_block *
sizeof_real64)
94 this%dblock_size = this%dblock_size - mod(this%dblock_size, this%l1%line_size) - 2*this%l1%line_size
96 this%zblock_size = this%l1%size / (cpu_default_states_per_block *
sizeof_complex64)
97 this%zblock_size = this%zblock_size - mod(this%zblock_size, this%l1%line_size) - 2*this%l1%line_size
subroutine hardware_init(this, l1_cache, l2_cache)
Initialise hardware object.
type(hardware_t), public cpu_hardware
Global instance of CPU hardware specification.
integer, parameter, public sizeof_real64
Number of bytes to store a variable of type real(real64)
type(cache_t), public default_l2
type(cache_t) function cache_t_init(data_size, line_size)
Initialise cache object.
integer, parameter, public sizeof_complex64
Number of bytes to store a variable of type complex(real64)
type(cache_t), public default_l1
Defaults covers common chip specification for (l1, l2) cache.
Block-size optimisation for L1 cache size.