From 96259a9f225291629dfdd2800ff5298ac45030ec Mon Sep 17 00:00:00 2001 From: Robin Voetter Date: Wed, 14 Aug 2024 14:34:08 +0200 Subject: [PATCH] fix warning in hipfft multi gpu example --- Libraries/hipFFT/multi_gpu/main.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Libraries/hipFFT/multi_gpu/main.cpp b/Libraries/hipFFT/multi_gpu/main.cpp index 10342d2e..ca327fd8 100644 --- a/Libraries/hipFFT/multi_gpu/main.cpp +++ b/Libraries/hipFFT/multi_gpu/main.cpp @@ -70,9 +70,7 @@ int main(int argc, char* argv[]) std::uniform_real_distribution distribution{}; std::generate(input.begin(), input.end(), - [&]() { - return data_t{distribution(generator), distribution(generator)}; - }); + [&]() { return data_t{distribution(generator), distribution(generator)}; }); std::cout << "Input:\n" << std::setprecision(3); print_nd_data(input, length, 16); @@ -88,8 +86,9 @@ int main(int argc, char* argv[]) HIPFFT_CHECK(hipfftXtSetGPUs(plan, devices.size(), devices.data())); // 5. Make the 2D FFT plan. - size_t workSize[devices.size()]; - HIPFFT_CHECK(hipfftMakePlan2d(plan, length[0], length[1], hipfftType::HIPFFT_Z2Z, workSize)); + std::vector work_size(devices.size()); + HIPFFT_CHECK( + hipfftMakePlan2d(plan, length[0], length[1], hipfftType::HIPFFT_Z2Z, work_size.data())); // 6. Allocate memory on device. hipLibXtDesc* input_desc;