From 3240afb7e13650adeff23a66305c8ebbb17fc50f Mon Sep 17 00:00:00 2001 From: Ioannis Assiouras Date: Tue, 7 Nov 2023 15:43:39 +0000 Subject: [PATCH] SWDEV-431291 - Convert variable length arrays to vectors. In test hipGraphPerf.cc. Using variable length arrays can raise an error if -Wvla-cxx-extension is enabled. Change-Id: I66542885b115c53b90348dba1964ffd1b0f3bd9a [ROCm/hip-tests commit: 5546c951b8e708ed23e60814405aa18bc2233851] --- projects/hip-tests/catch/unit/graph/hipGraphPerf.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/projects/hip-tests/catch/unit/graph/hipGraphPerf.cc b/projects/hip-tests/catch/unit/graph/hipGraphPerf.cc index b4508eee26..5f37495a25 100644 --- a/projects/hip-tests/catch/unit/graph/hipGraphPerf.cc +++ b/projects/hip-tests/catch/unit/graph/hipGraphPerf.cc @@ -57,7 +57,7 @@ static bool verifyVectorSquare(int *A_h, int* C_h, size_t size) { static void checkGraphContinousKernelCall(const unsigned int kNumNode) { unsigned blocks = HipTest::setNumBlocks(blocksPerCU, threadsPerBlock, N); hipGraphNode_t memCpy1, memCpy2, memCpy3; - hipGraphNode_t kNode[kNumNode]; + std::vector kNode(kNumNode); hipGraph_t graph; hipGraphExec_t graphExec; @@ -114,7 +114,7 @@ static void checkGraphContinousKernelCallIn2Blocks( const unsigned int kNumNode1, const unsigned int kNumNode2) { unsigned blocks = HipTest::setNumBlocks(blocksPerCU, threadsPerBlock, N); hipGraphNode_t memCpy1, memCpy2, memCpy3, memCpy4; - hipGraphNode_t kNode1[kNumNode1], kNode2[kNumNode2]; + std::vector kNode1(kNumNode1), kNode2(kNumNode2); hipGraph_t graph; hipGraphExec_t graphExec; @@ -191,8 +191,8 @@ static void checkGraphContinousKernelCallIn2Blocks( static void checkGraphMemcpyKernelMixCall(const unsigned int kNumIter) { unsigned blocks = HipTest::setNumBlocks(blocksPerCU, threadsPerBlock, N); constexpr int kNumNode = 3; - hipGraphNode_t node[kNumIter * kNumNode]; - hipGraphNode_t kNode[kNumIter]; + std::vector node(kNumIter * kNumNode); + std::vector kNode(kNumIter); hipGraph_t graph; hipGraphExec_t graphExec; @@ -249,8 +249,8 @@ static void checkGraphMemcpyKernelMixCall(const unsigned int kNumIter) { static void checkGraphMemcpyMemsetKernelMixCall(const unsigned int kNumIter) { unsigned blocks = HipTest::setNumBlocks(blocksPerCU, threadsPerBlock, N); constexpr int kNumNode = 3; - hipGraphNode_t node[kNumIter * kNumNode]; - hipGraphNode_t kNode[kNumIter]; + std::vector node(kNumIter * kNumNode); + std::vector kNode(kNumIter); hipGraph_t graph; hipGraphExec_t graphExec; int pitch_M = 0;