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

OpenMP supprt for nested loops #99

Open
HahaLan97 opened this issue Dec 5, 2022 · 0 comments
Open

OpenMP supprt for nested loops #99

HahaLan97 opened this issue Dec 5, 2022 · 0 comments

Comments

@HahaLan97
Copy link

Does Bambu support OpenMP #pragma omp parallel for for nested loops? I created a simple gemm function and tried to synthesis it. But I got an error saying
Starting execution of Frontend::ExtractOmpFor::gemm
error -> To be implemented
The code is as below:

#include <stdio.h>
#include <omp.h>

#define N 4

void kernel(int *a, int *b, int *c, int i, int j, int k) {
    c[i*N+j] += a[i*N+k] * b[k*N+j];
}

__attribute__((noinline))
void kernel_wrapper(int *a, int *b, int *c, int i, int j, int k) {
    kernel(a, b, c, i, j, k);
}

void gemm(int *a, int *b, int *c) {
    int i=0, j=0, k=0;
#pragma omp parallel for
    for (i = 0; i < N; i++) {
        for (j = 0; j < N; j++) {
            for (k = 0; k < N; k++) {
                kernel_wrapper(a, b, c, i, j, k);
            }
        }
    }
}

The command I used is:
bambu -fno-delete-null-pointer-checks -fopenmp --pragma-parse --mem-delay-read=20 --mem-delay-write=20 --channels-type=MEM_ACC_11 --memory-allocation-policy=NO_BRAM --no-iob --num-accelerators=2 --memory-banks-number=4 --channels-number=2 --context_switch=1 --top-fname=gemm main.c

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