fix a bug when initializing a vector of hipFunction_t (#1949)
This commit is contained in:
+2
-2
@@ -50,7 +50,7 @@ __hipRegisterFatBinary(const void* data)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto modules = new std::vector<hipModule_t>{g_deviceCnt};
|
||||
auto modules = new std::vector<hipModule_t>(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<hipFunction_t> functions{g_deviceCnt};
|
||||
std::vector<hipFunction_t> functions(g_deviceCnt);
|
||||
|
||||
assert(modules && modules->size() >= g_deviceCnt);
|
||||
for (int deviceId = 0; deviceId < g_deviceCnt; ++deviceId) {
|
||||
|
||||
Reference in New Issue
Block a user