SWDEV-487988 - Reserve event flag in hip::Event.

Don't create new hip:Function if it is already registered.

Change-Id: I3ecd5d61146659be6ba434717b0f21d3fc04cfc9


[ROCm/clr commit: a6c5c6a95a]
Ta zmiana jest zawarta w:
Jaydeep Patel authored and Jaydeepkumar Patel committed 2024-10-08 05:29:32 -04:00
1 rodzic b31bf885a3
złożenie 566984676e
2 plików zmienionych
+12 -2

Żadne pliki nie pasują do Twojego wyszukiwania

+7 -2
Wyświetl plik
@@ -88,8 +88,13 @@ void __hipRegisterFunction(hip::FatBinaryInfo** modules, const void* hostFunctio
return var ? atoi(var) : 1;
}()};
hipError_t hip_error = hipSuccess;
hip::Function* func = new hip::Function(std::string(deviceName), modules);
hip_error = PlatformState::instance().registerStatFunction(hostFunction, func);
// Compiler might share same hostFunction and hence it's needless to have another
// hip::Function and hip::Function is stored in map with hostFunction as key.
// Creating hip::Function in such case, Leaks it.
if (PlatformState::instance().getStatFuncName(hostFunction) == nullptr) {
hip::Function* func = new hip::Function(std::string(deviceName), modules);
hip_error = PlatformState::instance().registerStatFunction(hostFunction, func);
}
guarantee((hip_error == hipSuccess), "Cannot register Static function, error: %d", hip_error);
if (!enable_deferred_loading) {