27bc59ab60
SWDEV-86035 - Add PAL backend to OpenCL - Fix more strict compilation rules in C++11 Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/build/Makefile.pal#4 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palcounters.hpp#7 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#23 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevicegl.cpp#2 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.cpp#12 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.hpp#5 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palthreadtrace.hpp#4 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.hpp#11 edit
121 строка
3.7 KiB
C++
121 строка
3.7 KiB
C++
//
|
|
// Copyright (c) 2015 Advanced Micro Devices, Inc. All rights reserved.
|
|
//
|
|
#pragma once
|
|
|
|
#include "top.hpp"
|
|
#include "device/device.hpp"
|
|
#include "device/pal/paldevice.hpp"
|
|
#include "palPerfExperiment.h"
|
|
|
|
#include <vector>
|
|
namespace pal {
|
|
|
|
class VirtualGPU;
|
|
|
|
class PalThreadTraceReference : public amd::ReferenceCountedObject
|
|
{
|
|
public:
|
|
static PalThreadTraceReference* Create(VirtualGPU& gpu);
|
|
|
|
//! Default constructor
|
|
PalThreadTraceReference(
|
|
VirtualGPU& gpu //!< Virtual GPU device object
|
|
)
|
|
: gpu_(gpu)
|
|
, perfExp_(nullptr)
|
|
, layout_(nullptr)
|
|
, memory_(nullptr)
|
|
{}
|
|
|
|
//! Get PAL thread race object
|
|
Pal::IPerfExperiment* iPerf() const { return perfExp_; }
|
|
|
|
//! Returns the virtual GPU device
|
|
const VirtualGPU& gpu() const { return gpu_; }
|
|
|
|
//! Prepare for execution
|
|
bool finalize();
|
|
|
|
//! Copy ThreadTrace capture to User Buffer
|
|
void copyToUserBuffer(Memory* dstMem, uint seIndex);
|
|
|
|
protected:
|
|
//! Default destructor
|
|
~PalThreadTraceReference();
|
|
|
|
private:
|
|
//! Disable copy constructor
|
|
PalThreadTraceReference(const PalThreadTraceReference&);
|
|
|
|
//! Disable operator=
|
|
PalThreadTraceReference& operator=(const PalThreadTraceReference&);
|
|
|
|
VirtualGPU& gpu_; //!< The virtual GPU device object
|
|
Pal::IPerfExperiment* perfExp_; //!< PAL performance experiment object
|
|
Pal::ThreadTraceLayout* layout_; //!< Layout of the result
|
|
Memory* memory_; //!< Memory bound to PerfExperiment
|
|
};
|
|
|
|
//! ThreadTrace implementation on GPU
|
|
class ThreadTrace : public device::ThreadTrace
|
|
{
|
|
public:
|
|
|
|
//! Constructor for the GPU ThreadTrace object
|
|
ThreadTrace(
|
|
Device& device, //!< A GPU device object
|
|
PalThreadTraceReference* palRef, //!< Reference ThreadTrace
|
|
const std::vector<amd::Memory*>& memObjs, //!< ThreadTrace memory objects
|
|
uint numSe //!< Number of Shader Engines
|
|
)
|
|
: gpuDevice_(device)
|
|
, palRef_(palRef)
|
|
, numSe_(numSe)
|
|
, memObj_(memObjs)
|
|
{}
|
|
|
|
//! Destructor for the GPU ThreadTrace object
|
|
virtual ~ThreadTrace();
|
|
|
|
//! Creates the current object4
|
|
bool create();
|
|
|
|
// Populate ThreadTrace memory with PerfExperiment memory
|
|
void populateUserMemory();
|
|
|
|
//! 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 isNewBufferBinded_ to true/false if new buffer was binded/unbinded respectively
|
|
void setNewBufferBinded(bool isNewBufferBinded) {}
|
|
|
|
//! 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 palRef_->gpu(); }
|
|
|
|
//! Get PAL thread trace object
|
|
Pal::IPerfExperiment* iPerf() const { return palRef_->iPerf(); }
|
|
|
|
private:
|
|
//! Disable default copy constructor
|
|
ThreadTrace(const ThreadTrace&);
|
|
|
|
//! Disable default operator=
|
|
ThreadTrace& operator=(const ThreadTrace&);
|
|
|
|
const Device& gpuDevice_; //!< The backend device
|
|
PalThreadTraceReference* palRef_; //!< Reference ThreadTrace
|
|
uint numSe_; //!< Number of Shader Engines
|
|
std::vector<amd::Memory*> memObj_; //!< ThreadTrace memory objects
|
|
};
|
|
|
|
} // namespace pal
|
|
|