Merge pull request #19 from rkebichi/rkebichi-patch-kfd-1
Rkebichi patch kfd 1
This commit is contained in:
+5
-469
@@ -1,3 +1,4 @@
|
||||
// automatically generated
|
||||
/*
|
||||
Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved.
|
||||
|
||||
@@ -19,480 +20,15 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef INC_ROCTRACER_KFD_H_
|
||||
#define INC_ROCTRACER_KFD_H_
|
||||
#include <iostream>
|
||||
#include <mutex>
|
||||
|
||||
#include <hsa.h>
|
||||
|
||||
#include "roctracer.h"
|
||||
#include "hsakmt.h"
|
||||
|
||||
namespace roctracer {
|
||||
namespace kfd_support {
|
||||
template <typename T>
|
||||
struct output_streamer {
|
||||
inline static std::ostream& put(std::ostream& out, const T& v) { return out; }
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<bool> {
|
||||
inline static std::ostream& put(std::ostream& out, bool v) { out << std::hex << "<bool " << "0x" << v << std::dec << ">"; return out; }
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<uint8_t> {
|
||||
inline static std::ostream& put(std::ostream& out, uint8_t v) { out << std::hex << "<uint8_t " << "0x" << v << std::dec << ">"; return out; }
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<uint16_t> {
|
||||
inline static std::ostream& put(std::ostream& out, uint16_t v) { out << std::hex << "<uint16_t " << "0x" << v << std::dec << ">"; return out; }
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<uint32_t> {
|
||||
inline static std::ostream& put(std::ostream& out, uint32_t v) { out << std::hex << "<uint32_t " << "0x" << v << std::dec << ">"; return out; }
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<uint64_t> {
|
||||
inline static std::ostream& put(std::ostream& out, uint64_t v) { out << std::hex << "<uint64_t " << "0x" << v << std::dec << ">"; return out; }
|
||||
};
|
||||
|
||||
template<>
|
||||
struct output_streamer<bool*> {
|
||||
inline static std::ostream& put(std::ostream& out, bool* v) { out << std::hex << "<bool " << "0x" << *v << std::dec << ">"; return out; }
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<uint8_t*> {
|
||||
inline static std::ostream& put(std::ostream& out, uint8_t* v) { out << std::hex << "<uint8_t " << "0x" << *v << std::dec << ">"; return out; }
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<uint16_t*> {
|
||||
inline static std::ostream& put(std::ostream& out, uint16_t* v) { out << std::hex << "<uint16_t " << "0x" << *v << std::dec << ">"; return out; }
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<uint32_t*> {
|
||||
inline static std::ostream& put(std::ostream& out, uint32_t* v) { out << std::hex << "<uint32_t " << "0x" << *v << std::dec << ">"; return out; }
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<uint64_t*> {
|
||||
inline static std::ostream& put(std::ostream& out, uint64_t* v) { out << std::hex << "<uint64_t " << "0x" << *v << std::dec << ">"; return out; }
|
||||
};
|
||||
|
||||
template<>
|
||||
struct output_streamer<hsa_queue_t*> {
|
||||
inline static std::ostream& put(std::ostream& out, hsa_queue_t* v) { out << "<queue " << v << ">"; return out; }
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<hsa_queue_t**> {
|
||||
inline static std::ostream& put(std::ostream& out, hsa_queue_t** v) { out << "<queue " << *v << ">"; return out; }
|
||||
};
|
||||
// begin ostream ops for KFD
|
||||
template<>
|
||||
struct output_streamer<HsaVersionInfo&> {
|
||||
inline static std::ostream& put(std::ostream& out, HsaVersionInfo& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.KernelInterfaceMajorVersion);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.KernelInterfaceMinorVersion);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HsaSystemProperties&> {
|
||||
inline static std::ostream& put(std::ostream& out, HsaSystemProperties& v) {
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.NumNodes);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.PlatformOem);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.PlatformId);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.PlatformRev);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HSA_CAPABILITY&> {
|
||||
inline static std::ostream& put(std::ostream& out, HSA_CAPABILITY& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.Value);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.HotPluggable);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.HSAMMUPresent);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.SharedWithGraphics);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.QueueSizePowerOfTwo);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.QueueSize32bit);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.QueueIdleEvent);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.VALimit);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.WatchPointsSupported);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.WatchPointsTotalBits);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.DoorbellType);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.Reserved);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HsaNodeProperties&> {
|
||||
inline static std::ostream& put(std::ostream& out, HsaNodeProperties& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.NumCPUCores);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.NumFComputeCores);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.NumMemoryBanks);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.NumCaches);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.NumIOLinks);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.CComputeIdLo);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.FComputeIdLo);
|
||||
roctracer::kfd_support::output_streamer<HSA_CAPABILITY&>::put(out,v.Capability);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.MaxWavesPerSIMD);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.LDSSizeInKB);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.GDSSizeInKB);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.WaveFrontSize);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.NumShaderBanks);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.NumArrays);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.NumCUPerArray);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.NumSIMDPerCU);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.MaxSlotsScratchCU);
|
||||
roctracer::kfd_support::output_streamer<HSA_ENGINE_ID>::put(out,v.EngineId);
|
||||
roctracer::kfd_support::output_streamer<uint16_t>::put(out,v.VendorId);
|
||||
roctracer::kfd_support::output_streamer<uint16_t>::put(out,v.DeviceId);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.LocationId);
|
||||
roctracer::kfd_support::output_streamer<uint64_t>::put(out,v.LocalMemSize);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.MaxEngineClockMhzFCompute);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.MaxEngineClockMhzCCompute);
|
||||
roctracer::kfd_support::output_streamer<uint16_t>::put(out,v.MarketingName[HSA_PUBLIC_NAME_SIZE]);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HSA_MEMORYPROPERTY&> {
|
||||
inline static std::ostream& put(std::ostream& out, HSA_MEMORYPROPERTY& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.MemoryProperty);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.HotPluggable);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.NonVolatile);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.Reserved);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HsaMemoryProperties&> {
|
||||
inline static std::ostream& put(std::ostream& out, HsaMemoryProperties& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.HeapType);
|
||||
roctracer::kfd_support::output_streamer<uint64_t>::put(out,v.SizeInBytes);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.SizeInBytesLow);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.SizeInBytesHigh);
|
||||
roctracer::kfd_support::output_streamer<HSA_MEMORYPROPERTY>::put(out,v.Flags);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.Width);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.MemoryClockMax);
|
||||
roctracer::kfd_support::output_streamer<uint64_t>::put(out,v.VirtualBaseAddress);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HsaCacheType&> {
|
||||
inline static std::ostream& put(std::ostream& out, HsaCacheType& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.Value);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.Data);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.Instruction);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.CPU);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.HSACU);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.Reserved);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HsaCacheProperties&> {
|
||||
inline static std::ostream& put(std::ostream& out, HsaCacheProperties& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ProcessorIdLow);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.CacheLevel);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.CacheSize);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.CacheLineSize);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.CacheLinesPerTag);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.CacheAssociativity);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.CacheLatency);
|
||||
roctracer::kfd_support::output_streamer<HsaCacheType>::put(out,v.CacheType);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.SiblingMap[HSA_CPU_SIBLINGS]);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HsaCComputeProperties&> {
|
||||
inline static std::ostream& put(std::ostream& out, HsaCComputeProperties& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.SiblingMap[HSA_CPU_SIBLINGS]);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HSA_LINKPROPERTY&> {
|
||||
inline static std::ostream& put(std::ostream& out, HSA_LINKPROPERTY& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.LinkProperty);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.Override);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.NonCoherent);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.NoAtomics32bit);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.NoAtomics64bit);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.Reserved);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HsaIoLinkProperties&> {
|
||||
inline static std::ostream& put(std::ostream& out, HsaIoLinkProperties& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.IoLinkType);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.VersionMajor);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.VersionMinor);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.NodeFrom);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.NodeTo);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.Weight);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.MinimumLatency);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.MaximumLatency);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.MinimumBandwidth);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.MaximumBandwidth);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.RecTransferSize);
|
||||
roctracer::kfd_support::output_streamer<HSA_LINKPROPERTY&>::put(out,v.Flags);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HsaMemFlags&> {
|
||||
inline static std::ostream& put(std::ostream& out, HsaMemFlags& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.NonPaged);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.CachePolicy);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.ReadOnly);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.PageSize);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.HostAccess);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.NoSubstitute);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.GDSMemory);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.Scratch);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.AtomicAccessFull);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.AtomicAccessPartial);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.ExecuteAccess);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.Reserved);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.Value);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HsaQueueResource&> {
|
||||
inline static std::ostream& put(std::ostream& out, HsaQueueResource& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<uint64_t>::put(out,v.QueueId);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,*(v.Queue_DoorBell));
|
||||
roctracer::kfd_support::output_streamer<uint64_t>::put(out,*(v.Queue_DoorBell_aql));
|
||||
roctracer::kfd_support::output_streamer<uint64_t>::put(out,v.QueueDoorBell);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,*(v.Queue_write_ptr));
|
||||
roctracer::kfd_support::output_streamer<uint64_t>::put(out,*(v.Queue_write_ptr_aql));
|
||||
roctracer::kfd_support::output_streamer<uint64_t>::put(out,v.QueueWptrValue);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,*(v.Queue_read_ptr));
|
||||
roctracer::kfd_support::output_streamer<uint64_t>::put(out,*(v.Queue_read_ptr_aql));
|
||||
roctracer::kfd_support::output_streamer<uint64_t>::put(out,v.QueueRptrValue);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HsaQueueReport&> {
|
||||
inline static std::ostream& put(std::ostream& out, HsaQueueReport& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.VMID);
|
||||
out << "<void *" << v.QueueAddress << ">";
|
||||
roctracer::kfd_support::output_streamer<uint64_t>::put(out,v.QueueSize);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HsaDbgWaveMsgAMDGen2&> {
|
||||
inline static std::ostream& put(std::ostream& out, HsaDbgWaveMsgAMDGen2& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out, v.Value);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out, v.Reserved2);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HsaDbgWaveMessageAMD&> {
|
||||
inline static std::ostream& put(std::ostream& out, HsaDbgWaveMessageAMD& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<HsaDbgWaveMsgAMDGen2>::put(out,v.WaveMsgInfoGen2);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HsaDbgWaveMessage&> {
|
||||
inline static std::ostream& put(std::ostream& out, HsaDbgWaveMessage& v)
|
||||
{
|
||||
out << "<void* " << v.MemoryVA << ">";
|
||||
roctracer::kfd_support::output_streamer<HsaDbgWaveMessageAMD>::put(out,v.DbgWaveMsg);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HsaSyncVar&> {
|
||||
inline static std::ostream& put(std::ostream& out, HsaSyncVar& v)
|
||||
{
|
||||
out << "<void * " << v.SyncVar.UserData << ">";
|
||||
roctracer::kfd_support::output_streamer<uint64_t>::put(out,v.SyncVar.UserDataPtrValue);
|
||||
roctracer::kfd_support::output_streamer<uint64_t>::put(out,v.SyncVarSize);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HsaNodeChange&> {
|
||||
inline static std::ostream& put(std::ostream& out, HsaNodeChange& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.Flags);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HsaDeviceStateChange&> {
|
||||
inline static std::ostream& put(std::ostream& out, HsaDeviceStateChange& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.NodeId);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.Device);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.Flags);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HsaAccessAttributeFailure&> {
|
||||
inline static std::ostream& put(std::ostream& out, HsaAccessAttributeFailure& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.NotPresent);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ReadOnly);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.NoExecute);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.GpuAccess);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ECC);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.Reserved);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HsaMemoryAccessFault&> {
|
||||
inline static std::ostream& put(std::ostream& out, HsaMemoryAccessFault& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.NodeId);
|
||||
roctracer::kfd_support::output_streamer<uint64_t>::put(out,v.VirtualAddress);
|
||||
roctracer::kfd_support::output_streamer<HsaAccessAttributeFailure>::put(out,v. Failure);
|
||||
roctracer::kfd_support::output_streamer<int>::put(out,v.Flags);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HsaEventData&> {
|
||||
inline static std::ostream& put(std::ostream& out, HsaEventData& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.EventType);
|
||||
roctracer::kfd_support::output_streamer<HsaSyncVar>::put(out,v.EventData.SyncVar);
|
||||
roctracer::kfd_support::output_streamer<HsaNodeChange>::put(out,v.EventData.NodeChangeState);
|
||||
roctracer::kfd_support::output_streamer<HsaDeviceStateChange>::put(out,v.EventData.DeviceState);
|
||||
roctracer::kfd_support::output_streamer<HsaMemoryAccessFault>::put(out,v.EventData.MemoryAccessFault);
|
||||
roctracer::kfd_support::output_streamer<uint64_t>::put(out,v.HWData1);
|
||||
roctracer::kfd_support::output_streamer<uint64_t>::put(out,v.HWData2);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.HWData3);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HsaEventDescriptor&> {
|
||||
inline static std::ostream& put(std::ostream& out, HsaEventDescriptor& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.EventType);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.NodeId);
|
||||
roctracer::kfd_support::output_streamer<HsaSyncVar>::put(out,v.SyncVar);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HsaEvent&> {
|
||||
inline static std::ostream& put(std::ostream& out, HsaEvent& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.EventId);
|
||||
roctracer::kfd_support::output_streamer<HsaEventData>::put(out,v.EventData);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HsaClockCounters&> {
|
||||
inline static std::ostream& put(std::ostream& out, HsaClockCounters& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<uint64_t>::put(out,v.GPUClockCounter);
|
||||
roctracer::kfd_support::output_streamer<uint64_t>::put(out,v.CPUClockCounter);
|
||||
roctracer::kfd_support::output_streamer<uint64_t>::put(out,v.SystemClockCounter);
|
||||
roctracer::kfd_support::output_streamer<uint64_t>::put(out,v.SystemClockFrequencyHz);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HSA_UUID&> {
|
||||
inline static std::ostream& put(std::ostream& out, HSA_UUID& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.Data1);
|
||||
roctracer::kfd_support::output_streamer<uint16_t>::put(out,v.Data2);
|
||||
roctracer::kfd_support::output_streamer<uint16_t>::put(out,v.Data3);
|
||||
roctracer::kfd_support::output_streamer<uint8_t>::put(out,v.Data4[8]);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HsaCounterFlags&> {
|
||||
inline static std::ostream& put(std::ostream& out, HsaCounterFlags& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.Global);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.Resettable);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.ReadOnly);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.Stream);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.ui32.Reserved);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out, v.Value);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HsaCounter&> {
|
||||
inline static std::ostream& put(std::ostream& out, HsaCounter& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.Type);
|
||||
roctracer::kfd_support::output_streamer<uint64_t>::put(out,v.CounterId);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.CounterSizeInBits);
|
||||
roctracer::kfd_support::output_streamer<uint64_t>::put(out,v.CounterMask);
|
||||
roctracer::kfd_support::output_streamer<HsaCounterFlags>::put(out,v.Flags);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.BlockIndex);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HsaCounterBlockProperties&> {
|
||||
inline static std::ostream& put(std::ostream& out, HsaCounterBlockProperties& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<HSA_UUID>::put(out,v.BlockId);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.NumCounters);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.NumConcurrent);
|
||||
roctracer::kfd_support::output_streamer<HsaCounter>::put(out,v.Counters[1]);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HsaCounterProperties&> {
|
||||
inline static std::ostream& put(std::ostream& out, HsaCounterProperties& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.NumBlocks);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.NumConcurrent);
|
||||
roctracer::kfd_support::output_streamer<HsaCounterBlockProperties>::put(out,v.Blocks[1]);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
template<>
|
||||
struct output_streamer<HsaPmcTraceRoot&> {
|
||||
inline static std::ostream& put(std::ostream& out, HsaPmcTraceRoot& v)
|
||||
{
|
||||
roctracer::kfd_support::output_streamer<uint64_t>::put(out,v.TraceBufferMinSizeBytes);
|
||||
roctracer::kfd_support::output_streamer<uint32_t>::put(out,v.NumberOfPasses);
|
||||
roctracer::kfd_support::output_streamer<uint64_t>::put(out,v.TraceId);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
// end ostream ops for KFD
|
||||
};};
|
||||
|
||||
#include <inc/kfd_prof_str.h>
|
||||
#include "inc/kfd_ostream_ops.h"
|
||||
#include "inc/kfd_prof_str.h"
|
||||
|
||||
#endif // INC_ROCTRACER_KFD_H_
|
||||
|
||||
|
||||
@@ -0,0 +1,184 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import os, sys, re
|
||||
import CppHeaderParser
|
||||
import argparse
|
||||
|
||||
LICENSE = \
|
||||
'/*\n' + \
|
||||
'Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved.\n' + \
|
||||
'\n' + \
|
||||
'Permission is hereby granted, free of charge, to any person obtaining a copy\n' + \
|
||||
'of this software and associated documentation files (the "Software"), to deal\n' + \
|
||||
'in the Software without restriction, including without limitation the rights\n' + \
|
||||
'to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n' + \
|
||||
'copies of the Software, and to permit persons to whom the Software is\n' + \
|
||||
'furnished to do so, subject to the following conditions:\n' + \
|
||||
'\n' + \
|
||||
'The above copyright notice and this permission notice shall be included in\n' + \
|
||||
'all copies or substantial portions of the Software.\n' + \
|
||||
'\n' + \
|
||||
'THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n' + \
|
||||
'IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n' + \
|
||||
'FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n' + \
|
||||
'AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n' + \
|
||||
'LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n' + \
|
||||
'OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n' + \
|
||||
'THE SOFTWARE.\n' + \
|
||||
'*/\n'
|
||||
|
||||
HEADER = \
|
||||
'template <typename T>\n' + \
|
||||
'struct output_streamer {\n' + \
|
||||
' inline static std::ostream& put(std::ostream& out, const T& v) { return out; }\n' + \
|
||||
'};\n' + \
|
||||
'\ntemplate<>\n' + \
|
||||
'struct output_streamer<bool> {\n' + \
|
||||
' inline static std::ostream& put(std::ostream& out, bool v) { out << std::hex << "<bool " << "0x" << v << std::dec << ">"; return out; }\n' + \
|
||||
'};\n' + \
|
||||
'\ntemplate<>\n' + \
|
||||
'struct output_streamer<uint8_t> {\n' + \
|
||||
' inline static std::ostream& put(std::ostream& out, uint8_t v) { out << std::hex << "<uint8_t " << "0x" << v << std::dec << ">"; return out; }\n' + \
|
||||
'};\n' + \
|
||||
'\ntemplate<>\n' + \
|
||||
'struct output_streamer<uint16_t> {\n' + \
|
||||
' inline static std::ostream& put(std::ostream& out, uint16_t v) { out << std::hex << "<uint16_t " << "0x" << v << std::dec << ">"; return out; }\n' + \
|
||||
'};\n' + \
|
||||
'\ntemplate<>\n' + \
|
||||
'struct output_streamer<uint32_t> {\n' + \
|
||||
' inline static std::ostream& put(std::ostream& out, uint32_t v) { out << std::hex << "<uint32_t " << "0x" << v << std::dec << ">"; return out; }\n' + \
|
||||
'};\n' + \
|
||||
'\ntemplate<>\n' + \
|
||||
'struct output_streamer<uint64_t> {\n' + \
|
||||
' inline static std::ostream& put(std::ostream& out, uint64_t v) { out << std::hex << "<uint64_t " << "0x" << v << std::dec << ">"; return out; }\n' + \
|
||||
'};\n' + \
|
||||
'\n' + \
|
||||
'\ntemplate<>\n' + \
|
||||
'struct output_streamer<bool*> {\n' + \
|
||||
' inline static std::ostream& put(std::ostream& out, bool* v) { out << std::hex << "<bool " << "0x" << *v << std::dec << ">"; return out; }\n' + \
|
||||
'};\n' + \
|
||||
'\ntemplate<>\n' + \
|
||||
'struct output_streamer<uint8_t*> {\n' + \
|
||||
' inline static std::ostream& put(std::ostream& out, uint8_t* v) { out << std::hex << "<uint8_t " << "0x" << *v << std::dec << ">"; return out; }\n' + \
|
||||
'};\n' + \
|
||||
'\ntemplate<>\n' + \
|
||||
'struct output_streamer<uint16_t*> {\n' + \
|
||||
' inline static std::ostream& put(std::ostream& out, uint16_t* v) { out << std::hex << "<uint16_t " << "0x" << *v << std::dec << ">"; return out; }\n' + \
|
||||
'};\n' + \
|
||||
'\ntemplate<>\n' + \
|
||||
'struct output_streamer<uint32_t*> {\n' + \
|
||||
' inline static std::ostream& put(std::ostream& out, uint32_t* v) { out << std::hex << "<uint32_t " << "0x" << *v << std::dec << ">"; return out; }\n' + \
|
||||
'};\n' + \
|
||||
'\ntemplate<>\n' + \
|
||||
'struct output_streamer<uint64_t*> {\n' + \
|
||||
' inline static std::ostream& put(std::ostream& out, uint64_t* v) { out << std::hex << "<uint64_t " << "0x" << *v << std::dec << ">"; return out; }\n' + \
|
||||
'};\n' + \
|
||||
'\n'
|
||||
|
||||
structs_done = {}
|
||||
def process_struct(f,c,cppHeader,nname):
|
||||
|
||||
if c not in cppHeader.classes:
|
||||
return
|
||||
if c in structs_done:
|
||||
return
|
||||
|
||||
structs_done[c] = 1;
|
||||
for l in range(len(cppHeader.classes[c]["properties"]["public"])):
|
||||
key = 'name'
|
||||
name = ""
|
||||
if key in cppHeader.classes[c]["properties"]["public"][l]:
|
||||
name = cppHeader.classes[c]["properties"]["public"][l][key]
|
||||
key2 = 'type'
|
||||
mtype = ""
|
||||
if key2 in cppHeader.classes[c]["properties"]["public"][l]:
|
||||
mtype = cppHeader.classes[c]["properties"]["public"][l][key2]
|
||||
key3 = 'array_size'
|
||||
array_size = ""
|
||||
if key3 in cppHeader.classes[c]["properties"]["public"][l]:
|
||||
array_size = cppHeader.classes[c]["properties"]["public"][l][key3]
|
||||
key4 = 'property_of_class'
|
||||
prop = ""
|
||||
if key4 in cppHeader.classes[c]["properties"]["public"][l]:
|
||||
prop = cppHeader.classes[c]["properties"]["public"][l][key4]
|
||||
|
||||
if mtype != "" and "union" not in mtype:
|
||||
if array_size == "":
|
||||
str = " roctracer::kfd_support::output_streamer<"+mtype+">::put(out,v."+name+");\n"
|
||||
else:
|
||||
str = " roctracer::kfd_support::output_streamer<"+mtype+"["+array_size+"]>::put(out,v."+name+");\n"
|
||||
|
||||
if nname != "" and nname not in str:
|
||||
#print("injecting ",nname, "in ", str)
|
||||
str = str.replace("v.","v."+nname+".")
|
||||
if "void" not in mtype:
|
||||
f.write(str)
|
||||
else:
|
||||
nc = prop+"::"
|
||||
process_struct(f,nc,cppHeader,name)
|
||||
nc = prop+"::"+mtype+" "
|
||||
process_struct(f,nc,cppHeader,name)
|
||||
nc = c+"::"
|
||||
process_struct(f,nc,cppHeader,name)
|
||||
|
||||
|
||||
def gen_cppheader(infilepath,outfilepath):
|
||||
try:
|
||||
cppHeader = CppHeaderParser.CppHeader(infilepath)
|
||||
except CppHeaderParser.CppParseError as e:
|
||||
print(e)
|
||||
sys.exit(1)
|
||||
|
||||
f = open(outfilepath,"w+")
|
||||
f.write("// automatically generated\n")
|
||||
f.write(LICENSE)
|
||||
f.write("\n")
|
||||
HEADER_S = \
|
||||
'#ifndef INC_KFD_OSTREAM_OPS_H_\n' + \
|
||||
'#define INC_KFD_OSTREAM_OPS_H_\n' + \
|
||||
'#include <iostream>\n' + \
|
||||
'\n' + \
|
||||
'#include "roctracer.h"\n' + \
|
||||
'#include "hsakmt.h"\n'
|
||||
f.write(HEADER_S)
|
||||
f.write('\n')
|
||||
f.write('namespace roctracer {\n')
|
||||
f.write('namespace kfd_support {\n')
|
||||
f.write('// begin ostream ops for KFD \n')
|
||||
f.write(HEADER)
|
||||
for c in cppHeader.classes:
|
||||
if "union" in c:
|
||||
continue
|
||||
f.write("\ntemplate<>\n")
|
||||
f.write("struct output_streamer<"+c+"&> {\n")
|
||||
f.write(" inline static std::ostream& put(std::ostream& out, "+c+"& v)\n")
|
||||
f.write("{\n")
|
||||
process_struct(f,c,cppHeader,"")
|
||||
f.write(" return out;\n")
|
||||
f.write("}\n")
|
||||
f.write("};\n")
|
||||
|
||||
FOOTER = \
|
||||
'// end ostream ops for KFD \n'
|
||||
FOOTER += '};};\n' + \
|
||||
'\n' + \
|
||||
'#endif // INC_KFD_OSTREAM_OPS_H_\n' + \
|
||||
' \n'
|
||||
FOOTER2 = '\n\n' + \
|
||||
'#endif // INC_BASIC_OSTREAM_OPS_H_\n' + \
|
||||
' \n'
|
||||
f.write(FOOTER)
|
||||
|
||||
f.close()
|
||||
return
|
||||
|
||||
parser = argparse.ArgumentParser(description='genOstreamOps.py: generates ostream operators for all typedefs in provided input file.')
|
||||
requiredNamed = parser.add_argument_group('Required arguments')
|
||||
requiredNamed.add_argument('-in','--in', help='Header file to be parsed', required=True)
|
||||
requiredNamed.add_argument('-out','--out', help='Output file with ostream operators', required=True)
|
||||
|
||||
args = vars(parser.parse_args())
|
||||
|
||||
if __name__ == '__main__':
|
||||
gen_cppheader(args['in'],args['out'])
|
||||
|
||||
+16
-11
@@ -114,22 +114,26 @@ class API_TableParser:
|
||||
record = "";
|
||||
cumulate = 0;
|
||||
self.full_fct = {}
|
||||
rettype = ""
|
||||
prev_line = ""
|
||||
for line in self.inp.readlines():
|
||||
line = self.norm_line(line)
|
||||
line = self.fix_comment_line(line)
|
||||
|
||||
if cumulate == 1: record += " " + line;
|
||||
else: record = line;
|
||||
if self.is_start(line): cumulate = 1; continue;
|
||||
if self.is_start(line): rettype = prev_line.strip(); cumulate = 1; prev_line = line; continue;
|
||||
if self.is_end(line): record = self.remove_ret_line(record); cumulate = 0; active = 1;
|
||||
else: continue;
|
||||
else: prev_line = line; continue;
|
||||
if active != 0:
|
||||
m = self.is_entry(record)
|
||||
if m:
|
||||
mycall_full = "void " + m.group(1) + ' (' + m.group(2) + ')'
|
||||
mycall_full = rettype + " " + m.group(1) + ' (' + m.group(2) + ')'
|
||||
mycall = m.group(1)
|
||||
self.full_fct[mycall] = mycall_full
|
||||
self.array.append(mycall)
|
||||
rettype = "";
|
||||
prev_line = line
|
||||
|
||||
#############################################################
|
||||
# API declaration parser clas
|
||||
@@ -262,7 +266,6 @@ class API_DescrParser:
|
||||
# Return types
|
||||
self.api_rettypes.add(api_data[call]['ret'])
|
||||
|
||||
self.api_rettypes.discard('void')
|
||||
self.api_data = api_data
|
||||
self.ns_calls = ns_calls
|
||||
|
||||
@@ -372,10 +375,12 @@ class API_DescrParser:
|
||||
self.content_h += 'struct kfd_api_data_t {\n'
|
||||
self.content_h += ' uint64_t correlation_id;\n'
|
||||
self.content_h += ' uint32_t phase;\n'
|
||||
self.content_h += ' union {\n'
|
||||
for ret_type in self.api_rettypes:
|
||||
self.content_h += ' ' + ret_type + ' ' + ret_type + '_retval;\n'
|
||||
self.content_h += ' };\n'
|
||||
if len(self.api_rettypes) != 0:
|
||||
self.content_h += ' union {\n'
|
||||
for ret_type in self.api_rettypes:
|
||||
if ret_type != 'void':
|
||||
self.content_h += ' ' + ret_type + ' ' + ret_type + '_retval;\n'
|
||||
self.content_h += ' };\n'
|
||||
self.content_h += ' union {\n'
|
||||
return
|
||||
if call != '-':
|
||||
@@ -521,13 +526,13 @@ class API_DescrParser:
|
||||
self.content_cpp += '}\n\n';
|
||||
|
||||
if call != '-':
|
||||
self.content_cpp += 'PUBLIC_API HSAKMT_STATUS ' + call + '(' + struct['args'] + ') { roctracer::kfd_support::' + call + '_callback('
|
||||
self.content_cpp += 'PUBLIC_API ' + struct['ret'] + " " + call + '(' + struct['args'] + ') { return roctracer::kfd_support::' + call + '_callback('
|
||||
for i in range(0,len(struct['alst'])):
|
||||
if i == (len(struct['alst'])-1):
|
||||
self.content_cpp += struct['alst'][i].replace("[]","")
|
||||
self.content_cpp += struct['alst'][i].replace("[]","")
|
||||
else:
|
||||
self.content_cpp += struct['alst'][i].replace("[]","") + ', '
|
||||
self.content_cpp += '); return HSAKMT_STATUS_SUCCESS;} \n'
|
||||
self.content_cpp += ');} \n'
|
||||
|
||||
#############################################################
|
||||
# main
|
||||
|
||||
@@ -22,6 +22,7 @@ if ( DEFINED KFD_WRAPPER )
|
||||
set ( KFD_LIB_SRC
|
||||
${LIB_DIR}/kfd/kfd_wrapper.cpp
|
||||
)
|
||||
execute_process ( COMMAND sh -xc "${ROOT_DIR}/script/gen_ostream_ops.py -in ${HSA_KMT_INC_PATH}/hsakmttypes.h -out ${ROOT_DIR}/inc/kfd_ostream_ops.h" )
|
||||
add_library ( ${KFD_LIB} SHARED ${KFD_LIB_SRC} )
|
||||
target_include_directories ( ${KFD_LIB} PRIVATE ${LIB_DIR} ${ROOT_DIR} ${ROOT_DIR}/inc ${HSA_RUNTIME_INC_PATH} ${HSA_RUNTIME_HSA_INC_PATH} ${HSA_KMT_INC_PATH} )
|
||||
target_link_libraries( ${KFD_LIB} PRIVATE c stdc++ )
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
ROOT_PATH = ../..
|
||||
LIB_PATH = $(ROOT_PATH)/build
|
||||
ROC_LIBS = -L$(LIB_PATH) -lroctracer64 -lroctx64
|
||||
HSA_KMT_INC_PATH ?= /opt/rocm/include
|
||||
export LD_LIBRARY_PATH=$(LIB_PATH)
|
||||
HIP_VDI ?= 0
|
||||
ITERATIONS ?= 100
|
||||
@@ -24,7 +25,7 @@ EXECUTABLE=./MatrixTranspose
|
||||
|
||||
all: clean $(EXECUTABLE)
|
||||
|
||||
CXXFLAGS =-g -I$(ROOT_PATH) -I$(ROOT_PATH)/inc -DLOCAL_BUILD=1 -DHIP_VDI=${HIP_VDI} -DITERATIONS=$(ITERATIONS)
|
||||
CXXFLAGS =-g -I$(ROOT_PATH) -I$(ROOT_PATH)/inc -I${HSA_KMT_INC_PATH} -DLOCAL_BUILD=1 -DHIP_VDI=${HIP_VDI} -DITERATIONS=$(ITERATIONS)
|
||||
CXX=$(HIPCC)
|
||||
|
||||
$(EXECUTABLE): $(OBJECTS)
|
||||
|
||||
@@ -31,6 +31,9 @@ THE SOFTWARE.
|
||||
// roctx header file
|
||||
#include <inc/roctx.h>
|
||||
|
||||
// kfd header file
|
||||
#include <inc/roctracer_kfd.h>
|
||||
|
||||
#ifndef ITERATIONS
|
||||
# define ITERATIONS 101
|
||||
#endif
|
||||
@@ -203,6 +206,15 @@ void api_callback(
|
||||
fprintf(stdout, "ROCTX: \"%s\"\n", data->args.message);
|
||||
return;
|
||||
}
|
||||
if (domain == ACTIVITY_DOMAIN_KFD_API) {
|
||||
const kfd_api_data_t* data = reinterpret_cast<const kfd_api_data_t*>(callback_data);
|
||||
fprintf(stdout, "KFD: <%s id(%u)\tcorrelation_id(%lu) %s> \n",
|
||||
roctracer_op_string(ACTIVITY_DOMAIN_KFD_API, cid, 0),
|
||||
cid,
|
||||
data->correlation_id,
|
||||
(data->phase == ACTIVITY_API_PHASE_ENTER) ? "on-enter" : "on-exit");
|
||||
return;
|
||||
}
|
||||
|
||||
const hip_api_data_t* data = reinterpret_cast<const hip_api_data_t*>(callback_data);
|
||||
fprintf(stdout, "<%s id(%u)\tcorrelation_id(%lu) %s> ",
|
||||
@@ -263,7 +275,7 @@ void activity_callback(const char* begin, const char* end, void* arg) {
|
||||
record->begin_ns,
|
||||
record->end_ns
|
||||
);
|
||||
if (record->domain == ACTIVITY_DOMAIN_HIP_API) {
|
||||
if (record->domain == ACTIVITY_DOMAIN_HIP_API or record->domain == ACTIVITY_DOMAIN_KFD_API) {
|
||||
fprintf(stdout, " process_id(%u) thread_id(%u)",
|
||||
record->process_id,
|
||||
record->thread_id
|
||||
|
||||
Reference in New Issue
Block a user