main.cpp 476 Bytes
Newer Older
lengxl's avatar
lxl  
lengxl committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "test.hpp"

#include "common.h"

int main()
{
    float *A = (float *) malloc(N * sizeof(float)); 
    float *B = (float *) malloc(N * sizeof(float)); 
    float *C = (float *) malloc(N * sizeof(float)); 
    for (int i = 0; i < N; i++) {
        A[i] = 1; 
        B[i] = 1; 
        C[i] = 0; 
    }
    C = compute(A, B, C);
    for (int i = 0; i < N; i++) { 
        std::cout << C[i] << std::endl; 
    }
    free(A); 
    free(B); 
    free(C); 
    return 0;
}