Helper routine used by dbcsr_mm_accdrv_init()
SUBROUTINE setup_stackbuffers() !! Helper routine used by dbcsr_mm_accdrv_init() INTEGER :: i, ithread, & my_thread_buffers TYPE(thread_private_type), POINTER :: thread_privates ithread = 0 !$ ithread = OMP_GET_THREAD_NUM() thread_privates => all_thread_privates(ithread) my_thread_buffers = dbcsr_cfg%accdrv_thread_buffers%val IF (ASSOCIATED(thread_privates%stack_buffers)) THEN IF (SIZE(thread_privates%stack_buffers) /= my_thread_buffers) & CALL deallocate_stackbuffers() END IF IF (.NOT. ASSOCIATED(thread_privates%stack_buffers)) THEN ALLOCATE (thread_privates%stack_buffers(my_thread_buffers)) DO i = 1, my_thread_buffers CALL acc_devmem_allocate_bytes(thread_privates%stack_buffers(i)%devmem, & int_4_size*dbcsr_ps_acc_width*dbcsr_cfg%mm_stack_size%val) thread_privates%stack_buffers(i)%stream = thread_streams(ithread + 1) CALL acc_hostmem_allocate(thread_privates%stack_buffers(i)%hostmem, & dbcsr_ps_acc_width, dbcsr_cfg%mm_stack_size%val, thread_privates%stack_buffers(i)%stream) CALL acc_event_create(thread_privates%stack_buffers(i)%ready) CALL acc_event_create(thread_privates%stack_buffers(i)%calculated) END DO END IF END SUBROUTINE setup_stackbuffers