Octopus
hardware_oct_m Module Reference

Data Types

interface  cache_t
 Cache. More...
 
type  hardware_t
 Block-size optimisation for L1 cache size. More...
 

Functions/Subroutines

type(cache_t) function cache_t_init (data_size, line_size)
 Initialise cache object. More...
 
subroutine hardware_init (this, l1_cache, l2_cache)
 Initialise hardware object. More...
 

Variables

integer, parameter, public sizeof_real64 = 8
 Number of bytes to store a variable of type real(real64) More...
 
integer, parameter, public sizeof_complex64 = 16
 Number of bytes to store a variable of type complex(real64) More...
 
type(hardware_t), public cpu_hardware
 Global instance of CPU hardware specification. More...
 
type(cache_t), public default_l1
 Defaults covers common chip specification for (l1, l2) cache. More...
 
type(cache_t), public default_l2
 

Function/Subroutine Documentation

◆ cache_t_init()

type(cache_t) function hardware_oct_m::cache_t_init ( integer, intent(in)  data_size,
integer, intent(in)  line_size 
)
private

Initialise cache object.

Returns
Cache instance
Parameters
[in]data_sizeCache data size in B
[in]line_sizeLine size in B

Definition at line 70 of file hardware.F90.

◆ hardware_init()

subroutine hardware_oct_m::hardware_init ( class(hardware_t), intent(inout)  this,
type(cache_t), intent(in)  l1_cache,
type(cache_t), intent(in)  l2_cache 
)
private

Initialise hardware object.

The block size is defined such that:

  1. Initially ensure that each block fits into the l1 cache.
  2. The block_size should be a multiple of the cache line: block_size - mod( ) ensures any remainder is subtracted, such that (block_size / line_size) returns an integer
  3. Minus 2 lines to avoid powers of 2
    Parameters
    [in]l1_cachel1 cache
    [in]l2_cachel2 cache

Definition at line 89 of file hardware.F90.

Variable Documentation

◆ sizeof_real64

integer, parameter, public hardware_oct_m::sizeof_real64 = 8

Number of bytes to store a variable of type real(real64)

Definition at line 55 of file hardware.F90.

◆ sizeof_complex64

integer, parameter, public hardware_oct_m::sizeof_complex64 = 16

Number of bytes to store a variable of type complex(real64)

Definition at line 58 of file hardware.F90.

◆ cpu_hardware

type(hardware_t), public hardware_oct_m::cpu_hardware

Global instance of CPU hardware specification.

Definition at line 61 of file hardware.F90.

◆ default_l1

type(cache_t), public hardware_oct_m::default_l1

Defaults covers common chip specification for (l1, l2) cache.

Definition at line 64 of file hardware.F90.

◆ default_l2

type(cache_t), public hardware_oct_m::default_l2

Definition at line 65 of file hardware.F90.