[OpenMP] Using SimpleVLA
to handle vla usage in ompt-general.cpp. (#114583)
The `openmp` runtime failed to build on LoP with LLVM18 on LoP due to the addition of `-Wvla-cxx-extension` as ``` llvm-project/openmp/runtime/src/ompt-general.cpp:711:15: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension] 711 | int tmp_ids[ids_size]; | ^~~~~~~~ llvm-project/openmp/runtime/src/ompt-general.cpp:711:15: note: function parameter 'ids_size' with unknown value cannot be used in a constant expression llvm-project/openmp/runtime/src/ompt-general.cpp:704:65: note: declared here 704 | OMPT_API_ROUTINE int ompt_get_place_proc_ids(int place_num, int ids_size, | ^ 1 error generated. ``` This patch is to ignore the checking against this usage.
This commit is contained in:
parent
186dc9a4df
commit
d3d8103d53
@ -10,10 +10,11 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#include "kmp_utils.h"
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* system include files
|
* system include files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -708,7 +709,7 @@ OMPT_API_ROUTINE int ompt_get_place_proc_ids(int place_num, int ids_size,
|
|||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
int i, count;
|
int i, count;
|
||||||
int tmp_ids[ids_size];
|
SimpleVLA<int> tmp_ids(ids_size);
|
||||||
for (int j = 0; j < ids_size; j++)
|
for (int j = 0; j < ids_size; j++)
|
||||||
tmp_ids[j] = 0;
|
tmp_ids[j] = 0;
|
||||||
if (!KMP_AFFINITY_CAPABLE())
|
if (!KMP_AFFINITY_CAPABLE())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user