P4 to Git Change 1701409 by gandryey@gera-w8 on 2018/11/01 17:43:16
SWDEV-79445 - OCL generic changes and code clean-up - Remove obsolete settings - Simplify some logic when runtime checks dimension override in the dispatch critical path Affected files ... ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_execute.cpp#29 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#233 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#323 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/devkernel.cpp#9 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#599 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.cpp#333 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprogram.cpp#246 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuresource.cpp#246 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpusettings.cpp#361 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpusettings.hpp#103 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.cpp#425 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp#184 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.cpp#60 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.hpp#20 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocsettings.cpp#39 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocsettings.hpp#18 edit ... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#300 edit
Este commit está contenido en:
@@ -119,16 +119,7 @@ void Kernel::FindLocalWorkSize(size_t workDim, const amd::NDRange& gblWorkSize,
|
||||
if (workGroupInfo()->compileSize_[0] == 0) {
|
||||
// Find the default local workgroup size, if it wasn't specified
|
||||
if (lclWorkSize[0] == 0) {
|
||||
bool b1DOverrideSet = !flagIsDefault(GPU_MAX_WORKGROUP_SIZE);
|
||||
bool b2DOverrideSet = !flagIsDefault(GPU_MAX_WORKGROUP_SIZE_2D_X) ||
|
||||
!flagIsDefault(GPU_MAX_WORKGROUP_SIZE_2D_Y);
|
||||
bool b3DOverrideSet = !flagIsDefault(GPU_MAX_WORKGROUP_SIZE_3D_X) ||
|
||||
!flagIsDefault(GPU_MAX_WORKGROUP_SIZE_3D_Y) ||
|
||||
!flagIsDefault(GPU_MAX_WORKGROUP_SIZE_3D_Z);
|
||||
|
||||
bool overrideSet = ((workDim == 1) && b1DOverrideSet) || ((workDim == 2) && b2DOverrideSet) ||
|
||||
((workDim == 3) && b3DOverrideSet);
|
||||
if (!overrideSet) {
|
||||
if ((dev().settings().overrideLclSet & (1 << (workDim - 1))) == 0) {
|
||||
// Find threads per group
|
||||
size_t thrPerGrp = workGroupInfo()->size_;
|
||||
|
||||
@@ -137,8 +128,7 @@ void Kernel::FindLocalWorkSize(size_t workDim, const amd::NDRange& gblWorkSize,
|
||||
// and thread group is a multiple value of wavefronts
|
||||
((thrPerGrp % workGroupInfo()->wavefrontSize_) == 0) &&
|
||||
// and it's 2 or 3-dimensional workload
|
||||
(workDim > 1) && ((dev().settings().partialDispatch_) ||
|
||||
(((gblWorkSize[0] % 16) == 0) && ((gblWorkSize[1] % 16) == 0)))) {
|
||||
(workDim > 1) && (((gblWorkSize[0] % 16) == 0) && ((gblWorkSize[1] % 16) == 0))) {
|
||||
// Use 8x8 workgroup size if kernel has image writes
|
||||
if (flags_.imageWriteEna_ || (thrPerGrp != dev().info().preferredWorkGroupSize_)) {
|
||||
lclWorkSize[0] = 8;
|
||||
@@ -166,12 +156,10 @@ void Kernel::FindLocalWorkSize(size_t workDim, const amd::NDRange& gblWorkSize,
|
||||
// Assuming DWORD access
|
||||
const uint cacheLineMatch = dev().info().globalMemCacheLineSize_ >> 2;
|
||||
|
||||
// Check if partial dispatch is enabled and
|
||||
if (dev().settings().partialDispatch_ &&
|
||||
// we couldn't find optimal workload
|
||||
(((lclWorkSize.product() % workGroupInfo()->wavefrontSize_) != 0) ||
|
||||
// Check if we couldn't find optimal workload
|
||||
if (((lclWorkSize.product() % workGroupInfo()->wavefrontSize_) != 0) ||
|
||||
// or size is too small for the cache line
|
||||
(lclWorkSize[0] < cacheLineMatch))) {
|
||||
(lclWorkSize[0] < cacheLineMatch)) {
|
||||
size_t maxSize = 0;
|
||||
size_t maxDim = 0;
|
||||
for (uint d = 0; d < workDim; ++d) {
|
||||
|
||||
Referencia en una nueva incidencia
Block a user