Files
rocm-systems/rocclr/runtime/device/pal/palthreadtrace.hpp
T
foreman c99d679c9e P4 to Git Change 1230521 by gandryey@gera-w8 on 2016/01/22 17:58:08
SWDEV-86035 - Add OCL backend for PAL
	- PAL backend build is disabled by default. "BUILD_PAL_DEVICE = yes" enables the build. You also have to update the client workspace with PAL mapping: //depot/stg/pal/... //<your_opencl_location>/runtime/device/pal/palbe/...

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/build/Makefile.api#130 edit
... //depot/stg/opencl/drivers/opencl/compiler/sclibdefs.opencl#8 edit
... //depot/stg/opencl/drivers/opencl/opencldefs#166 edit
... //depot/stg/opencl/drivers/opencl/openclrules#91 edit
... //depot/stg/opencl/drivers/opencl/runtime/Makefile#21 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#192 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/Makefile#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/build/Makefile#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/build/Makefile.pal#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palappprofile.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palappprofile.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palbinary.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palbinary.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palblit.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palblit.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palcompiler.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palconstbuf.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palconstbuf.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palcounters.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palcounters.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldebugger.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldebugmanager.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldebugmanager.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldefs.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldeviced3d10.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldeviced3d11.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldeviced3d9.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevicegl.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palmemory.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palmemory.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprintf.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprintf.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsched.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palschedcl.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palthreadtrace.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palthreadtrace.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paltimestamp.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paltimestamp.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paltrap.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palwavelimiter.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palwavelimiter.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/runtimedefs#36 edit
... //depot/stg/opencl/drivers/opencl/runtime/top.hpp#23 edit
2016-01-22 18:18:55 -05:00

137 строки
4.8 KiB
C++

//
// Copyright (c) 2015 Advanced Micro Devices, Inc. All rights reserved.
//
#ifndef GPUTHREADTRACE_HPP_
#define GPUTHREADTRACE_HPP_
#include "top.hpp"
#include "device/device.hpp"
#include "device/pal/paldevice.hpp"
#include "palPerfExperiment.h"
#include <vector>
namespace pal {
class VirtualGPU;
class CalThreadTraceReference : public amd::ReferenceCountedObject
{
public:
//! Default constructor
CalThreadTraceReference(
VirtualGPU& gpu, //!< Virtual GPU device object
Pal::IPerfExperiment* gslThreadTrace) //!< GSL query thread trace object
: gpu_(gpu)
, threadTrace_(gslThreadTrace){}
//! Get GSL thread race object
Pal::IPerfExperiment* gslThreadTrace() const { return threadTrace_; }
//! Returns the virtual GPU device
const VirtualGPU& gpu() const { return gpu_; }
protected:
//! Default destructor
~CalThreadTraceReference();
private:
//! Disable copy constructor
CalThreadTraceReference(const CalThreadTraceReference&);
//! Disable operator=
CalThreadTraceReference& operator=(const CalThreadTraceReference&);
VirtualGPU& gpu_; //!< The virtual GPU device object
Pal::IPerfExperiment* threadTrace_; //!< GSL thread trace query object
};
//! ThreadTrace implementation on GPU
class ThreadTrace : public device::ThreadTrace
{
public:
//! Destructor for the GPU ThreadTrace object
virtual ~ThreadTrace();
//! Creates the current object
bool create(
CalThreadTraceReference* calRef //!< Reference ThreadTrace
);
//! Returns the GPU device, associated with the current object
const Device& dev() const { return gpuDevice_; }
//! Returns the virtual GPU device
const VirtualGPU& gpu() const { return gpu_; }
//! Constructor for the GPU ThreadTrace object
ThreadTrace(
Device& device, //!< A GPU device object
VirtualGPU& gpu, //!< Virtual GPU device object
uint amdThreadTraceMemObjsNum)
: gpuDevice_(device)
, gpu_(gpu)
, calRef_(NULL)
, index_(0)
, amdThreadTraceMemObjsNum_(amdThreadTraceMemObjsNum)
{
threadTraceBufferObjs_ = new Pal::ThreadTraceLayout[amdThreadTraceMemObjsNum];
Unimplemented();
for (uint i = 0; i < amdThreadTraceMemObjsNum;++i) {
//threadTraceBufferObjs_[i] = gpu.cs()->createShaderTraceBuffer();
}
}
//! Returns the specific information about the thread trace object
bool info(
uint infoType, //!< The type of returned information
uint* info, //!< The returned information
uint infoSize //!< The size of returned information
) const;
//! Set the ThreadTrace memory buffer size
void setMemBufferSizeTT(uint memBufferSizeTT) { memBufferSizeTT_ = memBufferSizeTT;}
//! Set isNewBufferBinded_ to true/false if new buffer was binded/unbinded respectively
void setNewBufferBinded(bool isNewBufferBinded) { isNewBufferBinded_ = isNewBufferBinded; }
//! Attach Pal::IGpuMemory to the TreadTrace buffer
void attachMemToThreadTraceBuffer();
void setMemObj(size_t memObjSize,std::vector<amd::Memory*> memObj)
{
memObj_ = memObj;
memBufferSizeTT_ = memObjSize;
}
//! Get GSL thread trace object
Pal::IPerfExperiment* gslThreadTrace() const { return threadTrace_; }
//! Get GSL Thread Trace Buffer objects
Pal::ThreadTraceLayout* getThreadTraceBufferObjects() {return threadTraceBufferObjs_;}
private:
//! Disable default copy constructor
ThreadTrace(const ThreadTrace&);
//! Disable default operator=
ThreadTrace& operator=(const ThreadTrace&);
const Device& gpuDevice_; //!< The backend device
VirtualGPU& gpu_; //!< The virtual GPU device object
CalThreadTraceReference* calRef_; //!< Reference ThreadTrace
Pal::ThreadTraceLayout* threadTraceBufferObjs_; //!< The buffer object for Thread Trace recording
uint index_; //!< ThreadTrace index in the CAL container
uint memBufferSizeTT_; //!< ThreadTrace memory buffer size
std::vector<amd::Memory*> memObj_; //!< ThreadTrace memory object
Pal::IPerfExperiment* threadTrace_; //!< GSL thread trace query object
uint amdThreadTraceMemObjsNum_; //!< ThreadTrace memory object`s number (should be equal to the SE number)
bool isNewBufferBinded_; //!< The indicator if new buffer was binded to the ThreadTrace object
bool isBufferOnSubmit_; //!< The indicator if "new buffer on submit" mode is used
};
} // namespace pal
#endif // PALTHREADTRACE_HPP_