Skip to content

Commit

Permalink
Review comments addressed
Browse files Browse the repository at this point in the history
  • Loading branch information
HaseenaSainul committed Oct 3, 2024
1 parent c1058f3 commit 33357a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 deletions.
26 changes: 6 additions & 20 deletions Source/Thunder/PluginHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,25 +298,6 @@ POP_WARNING()
return deviceId;
}

template <typename TYPE>
inline typename std::enable_if<(std::is_same<TYPE, void*>::value), void>::type
PrintMetaData(const uint8_t index, const TYPE& workerId, const uint32_t runs)
{
printf(" Thread%02d|0x%16" PRIxPTR ": %10d", (index), reinterpret_cast<uintptr_t>(workerId), runs);
}

template <typename TYPE>
inline typename std::enable_if<(!std::is_same<TYPE, void*>::value), void>::type
PrintMetaData(const uint8_t index, const TYPE workerId, const uint32_t runs)
{
#ifdef __WINDOWS__
printf(" Thread%02d|0x%16lX: %10d", (index), workerId, runs);
#else
printf(" Thread%02d|0x%16" PRIu64 ": %10d", (index), static_cast<uint64_t>(workerId), runs);
#endif
}


extern "C" {

#ifndef __WINDOWS__
Expand Down Expand Up @@ -908,7 +889,12 @@ POP_WARNING()
printf("Pending: %d\n", static_cast<uint32_t>(metaData.Pending.size()));
printf("Poolruns:\n");
for (uint8_t index = 0; index < metaData.Slots; index++) {
PrintMetaData(index, metaData.Slot[index].WorkerId, metaData.Slot[index].Runs);
#ifdef __WINDOWS__
printf(" Thread%02d|0x%16lX: %10d", (index), metaData.Slot[index].WorkerId, metaData.Slot[index].Runs);
#else
printf(" Thread%02d|0x%16" PRIu64 ": %10d", (index), static_cast<uint64_t>(Metadata::InstanceId(metaData.Slot[index].WorkerId)), metaData.Slot[index].Runs);
#endif

if (metaData.Slot[index].Job.IsSet() == false) {
printf("\n");
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/unit/core/test_workerpool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ namespace Core {
sprintf(id, "%x", static_cast<::Thunder::Core::thread_id>(pthread_self()));
for (uint8_t index = 0; index < _threadsCount + 2; index++) {
char workerId[MaxSize];
sprintf(workerId, "%x", static_cast<::thread_id>(::Thunder::Core::IWorkerPool::Instance().Id(index)));
sprintf(workerId, "%x", static_cast<::Thunder::Core::thread_id>(::Thunder::Core::IWorkerPool::Instance().Id(index)));

if (strcpy(workerId, id)) {
isPoolId = true;
Expand Down

0 comments on commit 33357a8

Please sign in to comment.