P4 to Git Change 1702079 by jujiang@JJ-OCL-w8 on 2018/11/02 16:01:11

SWDEV-155310 - Request for OpenCL extension function to set stable pstate

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_context.cpp#60 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_profile_amd.cpp#5 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_profile_amd.h#3 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#324 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#600 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.hpp#170 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#115 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.hpp#35 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#102 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.hpp#32 edit
Cette révision appartient à :
foreman
2018-11-02 16:09:59 -04:00
Parent 4801cb045b
révision 1a7008f29b
7 fichiers modifiés avec 33 ajouts et 1 suppressions
+4
Voir le fichier
@@ -17,6 +17,7 @@
#include "appprofile.hpp"
#include "devprogram.hpp"
#include "devkernel.hpp"
#include "amdocl/cl_profile_amd.h"
#if defined(WITH_LIGHTNING_COMPILER)
#include "caching/cache.hpp"
@@ -1264,6 +1265,9 @@ class Device : public RuntimeObject {
return true;
};
virtual bool SetClockMode(const cl_set_device_clock_mode_input_amd setClockModeInput, cl_set_device_clock_mode_output_amd* pSetClockModeOutput) {
return true;
};
//! Returns TRUE if the device is available for computations
bool isOnline() const { return online_; }
+5
Voir le fichier
@@ -2247,4 +2247,9 @@ cl_int Device::hwDebugManagerInit(amd::Context* context, uintptr_t messageStorag
return status;
}
bool Device::SetClockMode(const cl_set_device_clock_mode_input_amd setClockModeInput, cl_set_device_clock_mode_output_amd* pSetClockModeOutput) {
bool result = true;
return result;
}
} // namespace gpu
+4
Voir le fichier
@@ -111,6 +111,8 @@ class NullDevice : public amd::Device {
}
virtual void svmFree(void* ptr) const { return; }
virtual bool SetClockMode(const cl_set_device_clock_mode_input_amd setClockModeInput, cl_set_device_clock_mode_output_amd* pSetClockModeOutput) { return true; }
protected:
bool usePal() const {
return (calTarget_ == CAL_TARGET_GREENLAND || calTarget_ == CAL_TARGET_RAVEN ||
@@ -410,6 +412,8 @@ class Device : public NullDevice, public CALGSLDevice {
virtual bool validateKernel(const amd::Kernel& kernel, //!< AMD kernel object
const device::VirtualDevice* vdev);
virtual bool SetClockMode(const cl_set_device_clock_mode_input_amd setClockModeInput, cl_set_device_clock_mode_output_amd* pSetClockModeOutput);
//! Retrieves information about free memory on a GPU device
virtual bool globalFreeMemory(size_t* freeMemory) const;
+9 -1
Voir le fichier
@@ -22,7 +22,6 @@
#include "acl.h"
#include "amdocl/cl_common.hpp"
//#include "CL/cl_gl.h"
#ifdef _WIN32
#include <d3d9.h>
@@ -2263,4 +2262,13 @@ cl_int Device::hwDebugManagerInit(amd::Context* context, uintptr_t messageStorag
return status;
}
bool Device::SetClockMode(const cl_set_device_clock_mode_input_amd setClockModeInput, cl_set_device_clock_mode_output_amd* pSetClockModeOutput) {
bool result = false;
Pal::SetClockModeInput setClockMode = {};
Pal::DeviceClockMode palClockMode = static_cast<Pal::DeviceClockMode>(setClockModeInput.clock_mode);
setClockMode.clockMode = palClockMode;
result = (Pal::Result::Success == (iDev()->SetClockMode(setClockMode, reinterpret_cast<Pal::SetClockModeOutput*>(pSetClockModeOutput))))? true : false;
return result;
}
} // namespace pal
+3
Voir le fichier
@@ -112,6 +112,7 @@ class NullDevice : public amd::Device {
void* Alloc(const Util::AllocInfo& allocInfo) { return allocator_.Alloc(allocInfo); }
void Free(const Util::FreeInfo& freeInfo) { allocator_.Free(freeInfo); }
virtual bool SetClockMode(const cl_set_device_clock_mode_input_amd setClockModeInput, cl_set_device_clock_mode_output_amd* pSetClockModeOutput) { return true; }
protected:
static Util::GenericAllocator allocator_; //!< Generic memory allocator in PAL
@@ -348,6 +349,8 @@ class Device : public NullDevice {
virtual bool validateKernel(const amd::Kernel& kernel, //!< AMD kernel object
const device::VirtualDevice* vdev);
virtual bool SetClockMode(const cl_set_device_clock_mode_input_amd setClockModeInput, cl_set_device_clock_mode_output_amd* pSetClockModeOutput);
//! Retrieves information about free memory on a GPU device
virtual bool globalFreeMemory(size_t* freeMemory) const;
+4
Voir le fichier
@@ -1603,5 +1603,9 @@ VirtualGPU* Device::xferQueue() const {
xferQueue_->enableSyncBlit();
return xferQueue_;
}
bool Device::SetClockMode(const cl_set_device_clock_mode_input_amd setClockModeInput, cl_set_device_clock_mode_output_amd* pSetClockModeOutput) {
bool result = true;
return result;
}
}
#endif // WITHOUT_HSA_BACKEND
+4
Voir le fichier
@@ -176,6 +176,8 @@ class NullDevice : public amd::Device {
return false;
}
virtual bool SetClockMode(const cl_set_device_clock_mode_input_amd setClockModeInput, cl_set_device_clock_mode_output_amd* pSetClockModeOutput) { return true; }
protected:
//! Initialize compiler instance and handle
static bool initCompiler(bool isOffline);
@@ -336,6 +338,8 @@ class Device : public NullDevice {
virtual void svmFree(void* ptr) const;
virtual bool SetClockMode(const cl_set_device_clock_mode_input_amd setClockModeInput, cl_set_device_clock_mode_output_amd* pSetClockModeOutput);
//! Returns transfer engine object
const device::BlitManager& xferMgr() const { return xferQueue()->blitMgr(); }