Skip to content

Change 1179493 #128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: amd-staging
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions hipamd/src/hip_platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,14 @@ void __hipRegisterTexture(
}

void __hipUnregisterFatBinary(hip::FatBinaryInfo** modules) {
// By calling hipDeviceSynchronize ensure that all HSA signal handlers
// complete before removeFatBinary
static std::once_flag unregister_device_sync;
std::call_once(unregister_device_sync, hipDeviceSynchronize);
std::call_once(unregister_device_sync, [](){
for (auto& hipDevice : g_devices) {
// By synchronizing devices ensure that all HSA signal handlers
// complete before removeFatBinary
hipDevice->SyncAllStreams(true);
}
});
hipError_t err = PlatformState::instance().removeFatBinary(modules);
guarantee((err == hipSuccess), "Cannot Unregister Fat Binary, error:%d", err);
}
Expand Down
5 changes: 1 addition & 4 deletions rocclr/thread/semaphore.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace amd {
class Thread;

//! \brief Counting semaphore
class alignas(64) Semaphore : public HeapObject {
class Semaphore : public HeapObject {
private:
std::atomic_int state_; //!< This semaphore's value.

Expand All @@ -67,9 +67,6 @@ class alignas(64) Semaphore : public HeapObject {
void reset() { state_.store(0, std::memory_order_release); }
};

static_assert(sizeof(Semaphore) == 64 ,
"unexpected total size of Semaphore");

/*! @}
* @}
*/
Expand Down