From 55eab0bebdcb392388c1de8602f067596d9c6a48 Mon Sep 17 00:00:00 2001 From: foreman Date: Tue, 19 Jul 2016 10:45:55 -0400 Subject: [PATCH] P4 to Git Change 1293023 by wchau@wchau_WIN_OCL_HSA on 2016/07/19 10:24:01 SWDEV-89502 - [OCL] Support AMD DVR Core functionalities - add support for PFPA_DOPP_SUBMISSION & GL_RGB10_A2 format (changes in OCL RT) Affected files ... ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_gl.cpp#51 edit ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_svm.cpp#18 edit ... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl1.2/CL/cl_ext.h#12 edit ... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_ext.h#26 edit ... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.1/CL/cl_ext.h#5 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.cpp#317 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.hpp#125 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.cpp#404 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/kernel.hpp#17 edit --- rocclr/runtime/device/gpu/gpukernel.cpp | 4 ++-- rocclr/runtime/device/gpu/gpukernel.hpp | 3 ++- rocclr/runtime/device/gpu/gpuvirtual.cpp | 4 +++- rocclr/runtime/platform/kernel.hpp | 25 +++++++++++++++++------- 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/rocclr/runtime/device/gpu/gpukernel.cpp b/rocclr/runtime/device/gpu/gpukernel.cpp index 50b5d5c827..2a149e67f7 100644 --- a/rocclr/runtime/device/gpu/gpukernel.cpp +++ b/rocclr/runtime/device/gpu/gpukernel.cpp @@ -1567,7 +1567,7 @@ Kernel::loadParameters( } bool -Kernel::run(VirtualGPU& gpu, GpuEvent* calEvent, bool lastRun, bool lastDoppCmd) const +Kernel::run(VirtualGPU& gpu, GpuEvent* calEvent, bool lastRun, bool lastDoppCmd, bool pfpaDoppCmd) const { const VirtualGPU::CalVirtualDesc* dispatch = gpu.cal(); @@ -1576,7 +1576,7 @@ Kernel::run(VirtualGPU& gpu, GpuEvent* calEvent, bool lastRun, bool lastDoppCmd) gpu.eventBegin(MainEngine); gpu.rs()->Dispatch(gpu.cs(), &dispatch->gridBlock, &dispatch->partialGridBlock, - &dispatch->gridSize, dispatch->localSize, gpu.vmMems(), dispatch->memCount_, lastDoppCmd); + &dispatch->gridSize, dispatch->localSize, gpu.vmMems(), dispatch->memCount_, lastDoppCmd, pfpaDoppCmd); gpu.eventEnd(MainEngine, *calEvent); // Unbind all resources diff --git a/rocclr/runtime/device/gpu/gpukernel.hpp b/rocclr/runtime/device/gpu/gpukernel.hpp index fd383d757a..b865a7a1de 100644 --- a/rocclr/runtime/device/gpu/gpukernel.hpp +++ b/rocclr/runtime/device/gpu/gpukernel.hpp @@ -621,7 +621,8 @@ public: VirtualGPU& gpu, //!< virtual GPU device object GpuEvent* gpuEvent, //!< Pointer to the GPU event bool lastRun, //!< Last run in the split execution - bool lastDoppCmd //!< info for kernel dispatch + bool lastDoppCmd, //!< for last dopp submission kernel dispatch + bool pfpaDoppCmd //!< for PFPA dopp submission kernel dispatch ) const; //! Help function to debug the kernel output diff --git a/rocclr/runtime/device/gpu/gpuvirtual.cpp b/rocclr/runtime/device/gpu/gpuvirtual.cpp index a5a8757b42..1e94a32382 100644 --- a/rocclr/runtime/device/gpu/gpuvirtual.cpp +++ b/rocclr/runtime/device/gpu/gpuvirtual.cpp @@ -1851,6 +1851,7 @@ VirtualGPU::submitKernelInternalHSA( dispatchInfo.kernelInfo = pKernelInfo; dispatchInfo.wavesPerSH = hsaKernel.getWavesPerSH(this); dispatchInfo.lastDoppSubmission = kernel.parameters().getExecNewVcop(); + dispatchInfo.pfpaDoppSubmission = kernel.parameters().getExecPfpaVcop(); GpuEvent gpuEvent; // Run AQL dispatch in HW @@ -2155,7 +2156,8 @@ VirtualGPU::submitKernelInternal( } // Execute the kernel - if (gpuKernel.run(*this, &gpuEvent, lastRun, kernel.parameters().getExecNewVcop())) { + if (gpuKernel.run(*this, &gpuEvent, lastRun, kernel.parameters().getExecNewVcop(), + kernel.parameters().getExecPfpaVcop())) { //! @todo A flush is necessary to make sure // that 2 consecutive runs won't access to the same // private/local memory. CAL has to generate cache flush diff --git a/rocclr/runtime/platform/kernel.hpp b/rocclr/runtime/platform/kernel.hpp index 86293b3135..62916676cc 100644 --- a/rocclr/runtime/platform/kernel.hpp +++ b/rocclr/runtime/platform/kernel.hpp @@ -77,19 +77,25 @@ private: address values_; //!< pointer to the base of the values stack. bool* defined_; //!< pointer to the isDefined flags. - bool validated_; //!< True if all parameters are defined. bool* svmBound_; //!< True at 'i' if parameter 'i' is bound to SVM pointer size_t execInfoOffset_; //!< The offset of execInfo std::vector execSvmPtr_; //!< The non argument svm pointers for kernel FGSStatus svmSystemPointersSupport_; //!< The flag for the status of the kernel // support of fine-grain system sharing. - bool execNewVcop_; //!< special new VCOP for kernel execution + struct + { + uint32_t validated_ : 1; //!< True if all parameters are defined. + uint32_t execNewVcop_ : 1; //!< special new VCOP for kernel execution + uint32_t execPfpaVcop_ : 1; //!< special PFPA VCOP for kernel execution + uint32_t unused : 29; //!< unused + }; + public: //! Construct a new instance of parameters for the given signature. KernelParameters(const KernelSignature& signature) : - signature_(signature), validated_(false), execInfoOffset_(0), svmSystemPointersSupport_(FGS_DEFAULT), - execNewVcop_(false) + signature_(signature), execInfoOffset_(0), svmSystemPointersSupport_(FGS_DEFAULT), + validated_(0), execNewVcop_(0), execPfpaVcop_(0) { values_ = (address) this + alignUp(sizeof(KernelParameters), 16); defined_ = (bool*) (values_ + signature.paramsSize()); @@ -104,7 +110,7 @@ public: { defined_[index] = false; svmBound_[index] = false; - validated_ = false; + validated_ = 0; } //! Set the parameter at the given \a index to the value pointed by \a value // \a svmBound indicates that \a value is a SVM pointer. @@ -170,11 +176,16 @@ public: FGSStatus getSvmSystemPointersSupport() const { return svmSystemPointersSupport_; } //! set the new VCOP in the execInfo container - void setExecNewVcop(const bool newVcop) { execNewVcop_ = newVcop; } + void setExecNewVcop(const bool newVcop) { execNewVcop_ = (newVcop == true); } + + //! set the PFPA VCOP in the execInfo container + void setExecPfpaVcop(const bool pfpaVcop) { execPfpaVcop_ = (pfpaVcop == true); } //! get the new VCOP in the execInfo container - bool getExecNewVcop() const { return execNewVcop_; } + bool getExecNewVcop() const { return (execNewVcop_ == 1); } + //! get the PFPA VCOP in the execInfo container + bool getExecPfpaVcop() const { return (execPfpaVcop_ == 1); } }; /*! \brief Encapsulates a __kernel function and the argument values