Austin Schuh | 9a24b37 | 2018-01-28 16:12:29 -0800 | [diff] [blame^] | 1 | #include <stdlib.h> |
| 2 | #include <stdio.h> |
| 3 | |
| 4 | #include "../include/blasfeo_common.h" |
| 5 | #include "../include/blasfeo_i_aux_ext_dep.h" |
| 6 | #include "../include/blasfeo_d_aux_ext_dep.h" |
| 7 | #include "../include/blasfeo_v_aux_ext_dep.h" |
| 8 | #include "../include/blasfeo_d_aux.h" |
| 9 | #include "../include/blasfeo_d_kernel.h" |
| 10 | #include "../include/blasfeo_d_blas.h" |
| 11 | |
| 12 | int main() |
| 13 | { |
| 14 | |
| 15 | printf("\ntest assembly\n"); |
| 16 | |
| 17 | int ii; |
| 18 | |
| 19 | int n = 12; |
| 20 | |
| 21 | double *A; d_zeros(&A, n, n); |
| 22 | for(ii=0; ii<n*n; ii++) A[ii] = ii; |
| 23 | d_print_mat(n, n, A, n); |
| 24 | |
| 25 | double *B; d_zeros(&B, n, n); |
| 26 | for(ii=0; ii<n; ii++) B[ii*(n+1)] = 1.0; |
| 27 | d_print_mat(n, n, B, n); |
| 28 | |
| 29 | struct d_strmat sA; |
| 30 | d_allocate_strmat(n, n, &sA); |
| 31 | d_cvt_mat2strmat(n, n, A, n, &sA, 0, 0); |
| 32 | d_print_strmat(n, n, &sA, 0, 0); |
| 33 | |
| 34 | struct d_strmat sB; |
| 35 | d_allocate_strmat(n, n, &sB); |
| 36 | d_cvt_mat2strmat(n, n, B, n, &sB, 0, 0); |
| 37 | d_print_strmat(n, n, &sB, 0, 0); |
| 38 | |
| 39 | struct d_strmat sD; |
| 40 | d_allocate_strmat(n, n, &sD); |
| 41 | |
| 42 | struct d_strmat sC; |
| 43 | d_allocate_strmat(n, n, &sC); |
| 44 | |
| 45 | double alpha = 1.0; |
| 46 | double beta = 0.0; |
| 47 | int ret = kernel_dgemm_nt_4x4_lib4_test(n, &alpha, sB.pA, sA.pA, &beta, sB.pA, sD.pA); |
| 48 | d_print_strmat(n, n, &sD, 0, 0); |
| 49 | // printf("\n%ld %ld\n", (long long) n, ret); |
| 50 | // printf("\n%ld %ld\n", (long long) &alpha, ret); |
| 51 | // printf("\n%ld %ld\n", (long long) sA.pA, ret); |
| 52 | // printf("\n%ld %ld\n", (long long) sB.pA, ret); |
| 53 | // printf("\n%ld %ld\n", (long long) &beta, ret); |
| 54 | // printf("\n%ld %ld\n", (long long) sC.pA, ret); |
| 55 | // printf("\n%ld %ld\n", (long long) sD.pA, ret); |
| 56 | |
| 57 | return 0; |
| 58 | |
| 59 | } |