P4 to Git Change 1599472 by gandryey@gera-w8 on 2018/08/29 12:25:34

SWDEV-79445 - OCL generic changes and code clean-up
	- Move FindLocalWorkSize() logic to the abstraction layer
	- Replace the ROCr path with the common FindLocalWorkSize() functionality

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#227 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#314 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/devkernel.cpp#3 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/devkernel.hpp#3 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.cpp#330 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.hpp#132 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.cpp#63 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.hpp#22 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rockernel.cpp#42 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocsettings.cpp#36 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocsettings.hpp#16 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#67 edit
Este commit está contenido en:
foreman
2018-08-29 12:35:08 -04:00
padre 3f02c35aea
commit 5ee211e801
Se han modificado 12 ficheros con 216 adiciones y 408 borrados
+17 -2
Ver fichero
@@ -35,6 +35,7 @@ namespace amd {
class Device;
class KernelSignature;
class NDRange;
struct ProfilingCallback : public amd::HeapObject {
virtual void callback(ulong duration, uint32_t waves) = 0;
@@ -123,7 +124,10 @@ class Kernel : public amd::HeapObject {
};
//! Default constructor
Kernel(const std::string& name) : name_(name), signature_(NULL) {
Kernel(const amd::Device& dev, const std::string& name)
: dev_(dev)
, name_(name)
, signature_(nullptr) {
// Instead of memset(&workGroupInfo_, '\0', sizeof(workGroupInfo_));
// Due to std::string not being able to be memset to 0
workGroupInfo_.size_ = 0;
@@ -193,13 +197,16 @@ class Kernel : public amd::HeapObject {
//! Get profiling callback object
virtual amd::ProfilingCallback* getProfilingCallback(const device::VirtualDevice* vdv) {
return NULL;
return nullptr;
}
virtual uint getWavesPerSH(const device::VirtualDevice* vdv) const {
return 0;
}
//! Returns GPU device object, associated with this kernel
const amd::Device& dev() const { return dev_; }
void setVecTypeHint(const std::string& hint) { workGroupInfo_.compileVecTypeHint_ = hint; }
void setLocalMemSize(size_t size) { workGroupInfo_.localMemSize_ = size; }
@@ -237,6 +244,13 @@ class Kernel : public amd::HeapObject {
//! Return printf info array
const std::vector<PrintfInfo>& printfInfo() const { return printf_; }
//! Finds local workgroup size
void FindLocalWorkSize(
size_t workDim, //!< Work dimension
const amd::NDRange& gblWorkSize, //!< Global work size
amd::NDRange& lclWorkSize //!< Calculated local work size
) const;
protected:
//! Initializes the abstraction layer kernel parameters
#if defined(WITH_LIGHTNING_COMPILER)
@@ -252,6 +266,7 @@ class Kernel : public amd::HeapObject {
//! Initializes HSAIL Printf metadata and info
void InitPrintf(const aclPrintfFmt* aclPrintf);
#endif
const amd::Device& dev_; //!< GPU device object
std::string name_; //!< kernel name
WorkGroupInfo workGroupInfo_; //!< device kernel info structure
amd::KernelSignature* signature_; //!< kernel signature