Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about HLS parallel computation #22

Open
bai912753404 opened this issue May 5, 2023 · 0 comments
Open

Question about HLS parallel computation #22

bai912753404 opened this issue May 5, 2023 · 0 comments

Comments

@bai912753404
Copy link

`#include "ap_int.h"
#include "test.h"

void test(ap_fixed<18,10> A[10],ap_fixed<18,10> B[10], ap_fixed<18,10> C[10]){

ap_fixed<18,10> temp1[10];
ap_fixed<18,10> temp2[10];
ap_fixed<18,10> temp3[10];

#pragma HLS ARRAY_PARTITION variable=temp1 complete dim=1
#pragma HLS ARRAY_PARTITION variable=temp2 complete dim=1
#pragma HLS ARRAY_PARTITION variable=temp3 complete dim=1

for(int i = 0;i<10;i++)
{

#pragma HLS PIPELINE II=1
temp1[i] = A[i];
temp2[i] = B[i];
}

for(int i = 0;i < 10;i++){

#pragma HLS PIPELINE II=1
#pragma HLS UNROLL
temp3[i] = temp1[i]*temp2[i];
}

for(int i = 0 ;i<10;i++)
{

#pragma HLS PIPELINE II=1
C[i] = temp3[i];
}

}`

I am a novice in HLS and I am trying to implement parallel computation of element-wise multiplication between arrays A and B using the simple code above. I added parallelism by unrolling the loop and using a temporary variable, but I found that this approach still cannot achieve parallel computation of the elements and it is still sequential. I'm not sure what the problem is.
捕获

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant