From 906abbac5daba65d5b1b3610ad3b110a9b9cb7dc Mon Sep 17 00:00:00 2001
From: foreman
Date: Mon, 11 Sep 2017 18:19:56 -0400
Subject: [PATCH] P4 to Git Change 1457559 by lmoriche@lmoriche_opencl_dev2 on
2017/09/11 18:05:30
SWDEV-130808 - Add support of two new queries: CL_DEVICE_PREFERRED_WORK_GROUP_SIZE_AMD, CL_DEVICE_MAX_WORK_GROUP_SIZE_AMD.
- Restore the original behavior when setting GPU_MAX_WORKGROUP_SIZE.
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpusettings.cpp#356 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.cpp#33 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocsettings.cpp#24 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#279 edit
[ROCm/clr commit: c870a3052351f2b743f4be7c5f24c851d9f2beef]
---
projects/clr/rocclr/runtime/device/gpu/gpusettings.cpp | 6 +-----
projects/clr/rocclr/runtime/device/pal/palsettings.cpp | 6 +-----
projects/clr/rocclr/runtime/device/rocm/rocsettings.cpp | 6 +-----
projects/clr/rocclr/runtime/utils/flags.hpp | 2 --
4 files changed, 3 insertions(+), 17 deletions(-)
diff --git a/projects/clr/rocclr/runtime/device/gpu/gpusettings.cpp b/projects/clr/rocclr/runtime/device/gpu/gpusettings.cpp
index d0a331fef8..2887ddb002 100644
--- a/projects/clr/rocclr/runtime/device/gpu/gpusettings.cpp
+++ b/projects/clr/rocclr/runtime/device/gpu/gpusettings.cpp
@@ -428,11 +428,7 @@ bool Settings::create(const CALdeviceattribs& calAttr, bool reportAsOCL12Device,
void Settings::override() {
// Limit reported workgroup size
if (GPU_MAX_WORKGROUP_SIZE != 0) {
- maxWorkGroupSize_ = GPU_MAX_WORKGROUP_SIZE;
- }
-
- if (GPU_PREFERRED_WORKGROUP_SIZE != 0) {
- preferredWorkGroupSize_ = GPU_PREFERRED_WORKGROUP_SIZE;
+ preferredWorkGroupSize_ = GPU_MAX_WORKGROUP_SIZE;
}
// Override blit engine type
diff --git a/projects/clr/rocclr/runtime/device/pal/palsettings.cpp b/projects/clr/rocclr/runtime/device/pal/palsettings.cpp
index 331a05b90f..2fb52673a1 100644
--- a/projects/clr/rocclr/runtime/device/pal/palsettings.cpp
+++ b/projects/clr/rocclr/runtime/device/pal/palsettings.cpp
@@ -428,11 +428,7 @@ bool Settings::create(const Pal::DeviceProperties& palProp,
void Settings::override() {
// Limit reported workgroup size
if (GPU_MAX_WORKGROUP_SIZE != 0) {
- maxWorkGroupSize_ = GPU_MAX_WORKGROUP_SIZE;
- }
-
- if (GPU_PREFERRED_WORKGROUP_SIZE != 0) {
- preferredWorkGroupSize_ = GPU_PREFERRED_WORKGROUP_SIZE;
+ preferredWorkGroupSize_ = GPU_MAX_WORKGROUP_SIZE;
}
// Override blit engine type
diff --git a/projects/clr/rocclr/runtime/device/rocm/rocsettings.cpp b/projects/clr/rocclr/runtime/device/rocm/rocsettings.cpp
index 0000d14215..94e1e4f666 100644
--- a/projects/clr/rocclr/runtime/device/rocm/rocsettings.cpp
+++ b/projects/clr/rocclr/runtime/device/rocm/rocsettings.cpp
@@ -131,11 +131,7 @@ bool Settings::create(bool fullProfile, int gfxipVersion) {
void Settings::override() {
// Limit reported workgroup size
if (GPU_MAX_WORKGROUP_SIZE != 0) {
- maxWorkGroupSize_ = GPU_MAX_WORKGROUP_SIZE;
- }
-
- if (GPU_PREFERRED_WORKGROUP_SIZE != 0) {
- preferredWorkGroupSize_ = GPU_PREFERRED_WORKGROUP_SIZE;
+ preferredWorkGroupSize_ = GPU_MAX_WORKGROUP_SIZE;
}
if (!flagIsDefault(GPU_MAX_COMMAND_QUEUES)) {
diff --git a/projects/clr/rocclr/runtime/utils/flags.hpp b/projects/clr/rocclr/runtime/utils/flags.hpp
index 9d0858ecdb..cb98f0365e 100644
--- a/projects/clr/rocclr/runtime/utils/flags.hpp
+++ b/projects/clr/rocclr/runtime/utils/flags.hpp
@@ -24,8 +24,6 @@ debug(bool, CPU_USE_ALIGNMENT_MAP, false, \
"Use flag to enable alignment mapping for parameters for CPU") \
release(int, GPU_MAX_WORKGROUP_SIZE, 0, \
"Maximum number of workitems in a workgroup for GPU, 0 -use default") \
-release(int, GPU_PREFERRED_WORKGROUP_SIZE, 0, \
- "Preferred number of workitems in a workgroup for GPU, 0 -use default") \
release(int, GPU_MAX_WORKGROUP_SIZE_2D_X, 0, \
"Maximum number of workitems in a 2D workgroup for GPU, x component, 0 -use default") \
release(int, GPU_MAX_WORKGROUP_SIZE_2D_Y, 0, \