Commit bfc633de authored by Antoine Jego's avatar Antoine Jego
Browse files

fixed fotran alpha/beta type ; added and commented time measurements on...

fixed fotran alpha/beta type ; added and commented time measurements on codelets (debug purpose only)
parent 5fa3f8fd
......@@ -22,12 +22,14 @@ recursive subroutine cl_cpu_gemm (buffers, cl_args) bind(C)
implicit none
type(c_ptr), value, intent(in) :: buffers, cl_args ! cl_args is unused
real, target :: alpha, beta
real(kind=c_double), target :: alpha, beta
real(kind=c_double),pointer :: A(:,:), B(:,:), C(:,:)
integer :: ld_A,nx_A,ny_A
integer :: ld_B,nx_B,ny_B
integer :: ld_C,nx_C,ny_C
integer :: i,j,k
integer :: te, ts, tr
real :: tf, gflops
call fstarpu_unpack_arg( cl_args, (/ c_loc(alpha), c_loc(beta) /))
......@@ -46,8 +48,13 @@ recursive subroutine cl_cpu_gemm (buffers, cl_args) bind(C)
call c_f_pointer(fstarpu_matrix_get_ptr(buffers, 0), A, shape=[ld_A,ny_A])
call c_f_pointer(fstarpu_matrix_get_ptr(buffers, 1), B, shape=[ld_B,ny_B])
call c_f_pointer(fstarpu_matrix_get_ptr(buffers, 2), C, shape=[ld_C,ny_C])
call system_clock(ts)
call dgemm('n','n',nx_C,ny_C,nx_B, alpha, A(1,1), ld_A, B(1,1), ld_B, &
beta, C(1,1), ld_C)
call system_clock(te,tr)
!tf = max(real(te-ts)/real(tr),1e-20)
!gflops = 2.0*nx_C*ny_C*nx_B/(tf*10**9)
!write(*,*) "gemm_task", gflops, "Gflop/s", alpha, beta
return
end subroutine cl_cpu_gemm
......
......@@ -272,9 +272,13 @@ static void cpu_gemm(void *handles[], void *args)
}
// if (verbose) printf("gemm_task\n");
// printf("DATA %d | ld A %d B %d C %d | alpha %f beta %f \n", datatype, ld_A, ld_B, ld_C, clargs->alpha, clargs->beta);
double start = starpu_timing_now();
cblas_dgemm( CblasColMajor, CblasNoTrans, CblasNoTrans, // 2
n_row_C, n_col_C, n_col_A, clargs->alpha, block_A, ld_A, block_B, // 9
ld_B, clargs->beta, block_C, ld_C ); // 13
double stop = starpu_timing_now();
double timing = stop - start;
//printf("gemm_task %f Gflop/s\n", 2.0*n_row_C*n_col_C*n_col_A/(timing*1000));
}
int iseed[4] = { 1,1,1,1 };
......@@ -574,7 +578,7 @@ int main(int argc, char *argv[])
if (verbose) print_matrix(C,"Cinit");
if (verbose) print_matrix(Cwork,"Cwork");
}
starpu_data_display_memory_stats();
// starpu_data_display_memory_stats();
barrier_ret = starpu_mpi_barrier(MPI_COMM_WORLD);
start = starpu_timing_now();
......
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