dbcsr_mm_accdrv Module

Fourth layer of the dbcsr matrix-matrix multiplication. It hides the differences between performing calculations on the accelerator device or on the CPU. Modification history: - 2010-02-23 Moved from dbcsr_operations - 2011-11 Moved parameter-stack processing routines to dbcsr_mm_methods. - 2013-01 extensive refactoring (Ole Schuett) - 2014-04 generalized into acc-framework (Ole Schuett)



Variables

Type Visibility Attributes Name Initial
character(len=*), private, parameter :: moduleN = 'dbcsr_mm_accdrv'
logical, private, parameter :: careful_mod = .FALSE.
type(thread_private_type), private, SAVE, DIMENSION(:), ALLOCATABLE, TARGET :: all_thread_privates
type(acc_stream_type), private, SAVE, DIMENSION(:), POINTER :: thread_streams => Null()

Derived Types

type, public ::  dbcsr_mm_accdrv_type

Components

Type Visibility Attributes Name Initial
type(dbcsr_work_type), private, POINTER :: product_wm => Null()
type(dbcsr_data_obj), private :: c_buffer
logical, private :: c_area_copy = .TRUE.
logical, private :: keep_product_data = .TRUE.
logical, private :: do_gpu_c_redux = .FALSE.
integer, private :: nlayers = 1

type, private ::  stack_buffer_type

Components

Type Visibility Attributes Name Initial
type(acc_devmem_type), public :: devmem
integer, public, DIMENSION(:, :), POINTER :: hostmem => Null()
type(acc_event_type), public :: ready
type(acc_event_type), public :: calculated
type(acc_stream_type), public :: stream

type, private ::  thread_private_type

Components

Type Visibility Attributes Name Initial
type(stack_buffer_type), public, DIMENSION(:), POINTER :: stack_buffers => Null()
type(dbcsr_memtype_type), public :: memtype_cbuffer
integer(kind=int_4), public, DIMENSION(64) :: padding

Subroutines

public subroutine dbcsr_mm_accdrv_lib_init()

Initialize the library

Arguments

None

public subroutine dbcsr_mm_accdrv_lib_finalize()

Finalize the library

Arguments

None

public subroutine dbcsr_mm_accdrv_init(this, product_wm, nlayers, keep_product_data)

Initializes a multiplication cycle for new set of C-blocks.

Arguments

Type IntentOptional Attributes Name
type(dbcsr_mm_accdrv_type), intent(inout) :: this
type(dbcsr_work_type), POINTER :: product_wm
integer, optional :: nlayers
logical, intent(in) :: keep_product_data

private subroutine setup_streams()

Helper routine used by dbcsr_mm_accdrv_init()

Arguments

None

private subroutine deallocate_streams()

Helper routine used by setup_streams() and dbcsr_mm_accdrv_lib_finalize()

Arguments

None

private subroutine stream_array_force_size(streams, basename, n, events, priority)

Helper routine

Arguments

Type IntentOptional Attributes Name
type(acc_stream_type), DIMENSION(:), POINTER :: streams
character(len=*), intent(in) :: basename
integer, intent(in) :: n
type(acc_event_type), optional, DIMENSION(:), POINTER :: events
integer, intent(in), optional :: priority

private subroutine setup_stackbuffers()

Helper routine used by dbcsr_mm_accdrv_init()

Arguments

None

private subroutine deallocate_stackbuffers()

Helper routine used by setup_stackbuffers() and dbcsr_mm_accdrv_lib_finalize()

Arguments

None

public subroutine dbcsr_mm_accdrv_dev2host_init(this)

Finalizes a multiplication cycle for a set of C-blocks.

Arguments

Type IntentOptional Attributes Name
type(dbcsr_mm_accdrv_type), intent(inout) :: this

public subroutine dbcsr_mm_accdrv_finalize(this)

Finalizes a multiplication cycle for a set of C-blocks.

Arguments

Type IntentOptional Attributes Name
type(dbcsr_mm_accdrv_type), intent(inout) :: this

private subroutine stack_sort(params_in, params_out, stack_size)

Sort stack entries with respect to the c_id.

Arguments

Type IntentOptional Attributes Name
integer, intent(in), DIMENSION(dbcsr_ps_width, stack_size) :: params_in
integer, intent(out), DIMENSION(dbcsr_ps_acc_width, stack_size) :: params_out
integer, intent(in) :: stack_size

private subroutine stack_binning(params_in, params_out, stack_size)

Roughly order stacks with a cheaper Binning-scheme by Peter Messmer

Arguments

Type IntentOptional Attributes Name
integer, intent(in), DIMENSION(dbcsr_ps_width, stack_size) :: params_in
integer, intent(out), DIMENSION(dbcsr_ps_acc_width, stack_size) :: params_out
integer, intent(in) :: stack_size

public subroutine dbcsr_mm_accdrv_barrier()

Arguments

None

public subroutine dbcsr_mm_accdrv_process(this, left, right, params, stack_size, stack_descr, success)

Processes a given stack using accelerator

Arguments

Type IntentOptional Attributes Name
type(dbcsr_mm_accdrv_type), intent(inout) :: this
type(dbcsr_type), intent(in) :: left
type(dbcsr_type), intent(in) :: right
integer, intent(inout), DIMENSION(dbcsr_ps_width, stack_size) :: params
integer, intent(in) :: stack_size
type(stack_descriptor_type), intent(in) :: stack_descr
logical, intent(out) :: success