报告PGCC-S-0000- _mp_malloc的内部错误,而没有堆分配

时间:2017-01-05 19:01:40

标签: openacc pgi

当我尝试在OpenACC中编译我的代码时,它会报告:

PGCC-S-0000-Internal compiler error. Call in OpenACC region to support routine - _mp_malloc (/home/lisanhu/mine/ws/C/AccSeqC/as_align.cc: 92)
PGCC-S-0155-Compiler failed to translate accelerator region (see -Minfo messages)  (/home/lisanhu/mine/ws/C/AccSeqC/as_align.cc: 92)
inexact_dfs_iter_search(const char *, long, long, const long *, const long *, long, const char *, const long *, const char *, acc_range *, int):
     92, Generating acc routine seq
         93, Accelerator restriction: unsupported call to support routine '_mp_malloc'

报告的功能定义如下:

int
inexact_dfs_iter_search(const char *query, const array_size q_length, array_size allowed_diffs,
                        const array_size *c, const array_size *o, array_size r_length,
                        const char *ref_bwt, const array_size *rev_o, const char *rev_bwt,
                        Range *res, int num_of_res) {
    array_size d[q_length];
    calculateD(query, q_length, r_length, c, rev_o, rev_bwt, d);
//  for (int i = 0; i < q_length; ++i) {
//      cout << d[i];
//  }
//  cout << endl;
//  cout << strndup(query, q_length) << endl;
    Profile p{q_length - 1, 1, r_length - 1, allowed_diffs};
    int prof_size = 9 * q_length + 1;
    Profile profs[prof_size];
    Stack<Profile> profiles(profs, prof_size);
    profiles.push(p);

    Heap<Range> results(res, num_of_res);
    while (!profiles.empty() && !results.full()) {
        if (profiles.full()) {
            return 1;
        }
//      p = profiles.peek();
        p = profiles.pop();
        inex_dfs_process_profile(query, p, c, o, ref_bwt, d, profiles, results);
    }
    return 0;
}

第92行是第5行(它是函数定义的一部分,很奇怪)

如果有人可以帮助我,我会非常感激。

1 个答案:

答案 0 :(得分:1)

我找到了原因。对于--packages,它实际上调用_mp_malloc来在堆栈上分配内存。我试图将q_length替换为常量,它工作正常。 (虽然这是一个临时的调整,但我终于找出了理由)