Commit 490acc03 authored by Antoine Jego's avatar Antoine Jego
Browse files

fix

parent d5eba9f6
......@@ -55,8 +55,6 @@ program fstarpu_example_dgemm
logical :: A_local, B_local, C_local
real(kind=c_double), target :: alpha, beta, zbeta
type(c_ptr) :: cl_mm, cl_mm_args, cl_fill
type(cl_gemm_args), pointer :: cl_args
integer(c_int), pointer :: args_sz
integer(c_int) :: ncpu
integer(c_int) :: ret
integer :: i, j, l, p , q, trial, t
......@@ -225,20 +223,7 @@ program fstarpu_example_dgemm
FSTARPU_SCHED_CTX, c_loc(arg_ctx), &
c_null_ptr /))
else if (codelet_args) then
if (C_local) then
allocate(cl_args)
cl_args%alpha = alpha
cl_args%beta = zbeta
end if
args_sz = storage_size(cl_args)/8
call fstarpu_mpi_task_insert((/ c_loc(comm_world), cl_mm_args, &
FSTARPU_CL_ARGS, c_loc(cl_args), c_loc(args_sz), &
FSTARPU_R, A%blocks(i,l)%h, &
FSTARPU_R, B%blocks(l,j)%h, &
FSTARPU_RW, C%blocks(i,j)%h, &
c_null_ptr /))
! We do not deallocate ... which is weird ... but the task does
! it for us upon destruction
call insert_gemm_task()
else
call fstarpu_mpi_task_insert((/ c_loc(comm_world), cl_mm, &
FSTARPU_VALUE, c_loc(alpha), FSTARPU_SZ_REAL8, &
......@@ -393,6 +378,28 @@ contains
end do
end subroutine fill_matrix
subroutine insert_gemm_task()
implicit none
type(cl_gemm_args), pointer :: cl_args
integer(c_int), pointer :: args_sz
if (C_local) then
allocate(cl_args,args_sz)
cl_args%alpha = alpha
cl_args%beta = zbeta
args_sz = storage_size(cl_args)/8
end if
call fstarpu_mpi_task_insert((/ c_loc(comm_world), cl_mm_args, &
FSTARPU_CL_ARGS, c_loc(cl_args), c_loc(args_sz), &
FSTARPU_R, A%blocks(i,l)%h, &
FSTARPU_R, B%blocks(l,j)%h, &
FSTARPU_RW, C%blocks(i,j)%h, &
c_null_ptr /))
! We do not deallocate ... which is weird ... but the task does
! it for us upon destruction
end subroutine insert_gemm_task
subroutine unregister_matrix(x,mb,nb)
implicit none
integer :: mb, nb
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment