Skip to content

Commit a7ac0dd

Browse files
committed
[NFC][OpenMP] Use SimpleVLA to replace variable length arrays in C++
1 parent fa9ee4a commit a7ac0dd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

openmp/runtime/src/kmp_csupport.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "kmp_itt.h"
1919
#include "kmp_lock.h"
2020
#include "kmp_stats.h"
21+
#include "kmp_utils.h"
2122
#include "ompt-specific.h"
2223

2324
#define MAX_MESSAGE 512
@@ -4233,7 +4234,7 @@ void __kmpc_doacross_wait(ident_t *loc, int gtid, const kmp_int64 *vec) {
42334234
up = pr_buf->th_doacross_info[3];
42344235
st = pr_buf->th_doacross_info[4];
42354236
#if OMPT_SUPPORT && OMPT_OPTIONAL
4236-
ompt_dependence_t deps[num_dims];
4237+
SimpleVLA<ompt_dependence_t> deps(num_dims);
42374238
#endif
42384239
if (st == 1) { // most common case
42394240
if (vec[0] < lo || vec[0] > up) {
@@ -4345,7 +4346,7 @@ void __kmpc_doacross_post(ident_t *loc, int gtid, const kmp_int64 *vec) {
43454346
lo = pr_buf->th_doacross_info[2];
43464347
st = pr_buf->th_doacross_info[4];
43474348
#if OMPT_SUPPORT && OMPT_OPTIONAL
4348-
ompt_dependence_t deps[num_dims];
4349+
SimpleVLA<ompt_dependence_t> deps(num_dims);
43494350
#endif
43504351
if (st == 1) { // most common case
43514352
iter_number = vec[0] - lo;

0 commit comments

Comments
 (0)