From 7c8b8d24ef7cc0f0c69db3ee9c785804ee9317b0 Mon Sep 17 00:00:00 2001 From: zhaozhangjian <38252887+zhaozhangjian@users.noreply.github.com> Date: Tue, 17 Mar 2020 16:35:07 +0800 Subject: [PATCH] fix a bug when initializing a vector of hipFunction_t (#1949) --- src/hip_clang.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hip_clang.cpp b/src/hip_clang.cpp index f17d2673c7..4c8ae07134 100644 --- a/src/hip_clang.cpp +++ b/src/hip_clang.cpp @@ -50,7 +50,7 @@ __hipRegisterFatBinary(const void* data) return nullptr; } - auto modules = new std::vector{g_deviceCnt}; + auto modules = new std::vector(g_deviceCnt); if (!modules) { return nullptr; } @@ -133,7 +133,7 @@ extern "C" void __hipRegisterFunction( int* wSize) { HIP_INIT_API(NONE, modules, hostFunction, deviceFunction, deviceName); - std::vector functions{g_deviceCnt}; + std::vector functions(g_deviceCnt); assert(modules && modules->size() >= g_deviceCnt); for (int deviceId = 0; deviceId < g_deviceCnt; ++deviceId) {