ferrandi/PandA-bambu

OpenMP supprt for nested loops

HahaLan97 opened this issue · 0 comments

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