P4 to Git Change 1753099 by cpaquot@cpaquot-ocl-lc-lnx on 2019/03/07 16:43:54

SWDEV-145570 - [HIP] Change IS_HIP into a dynamic variable set by HIP layer

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/hip/hip_context.cpp#16 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#127 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.cpp#69 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.cpp#18 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#303 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/macros.hpp#11 edit
This commit is contained in:
foreman
2019-03-07 17:24:23 -05:00
parent e51a27e182
commit 598c3f2821
5 changed files with 7 additions and 11 deletions
+1 -1
View File
@@ -1258,7 +1258,7 @@ bool Device::init() {
uint ordinal = 0;
const char* selectDeviceByName = nullptr;
const char* requestedDeviceList = IS_HIP ? ((HIP_VISIBLE_DEVICES[0] != '\0') ?
const char* requestedDeviceList = amd::IS_HIP ? ((HIP_VISIBLE_DEVICES[0] != '\0') ?
HIP_VISIBLE_DEVICES : CUDA_VISIBLE_DEVICES)
: GPU_DEVICE_ORDINAL;
+1 -1
View File
@@ -301,7 +301,7 @@ bool Settings::create(const Pal::DeviceProperties& palProp,
supportDepthsRGB_ = true;
}
if (use64BitPtr_) {
if (IS_HIP || (GPU_ENABLE_LARGE_ALLOCATION && wscaps.workStationBoard)) {
if (amd::IS_HIP || (GPU_ENABLE_LARGE_ALLOCATION && wscaps.workStationBoard)) {
maxAllocSize_ = 64ULL * Gi;
} else {
maxAllocSize_ = 4048 * Mi;
+1
View File
@@ -65,6 +65,7 @@ namespace amd {
#include <crt_externs.h>
#endif // __APPLE__
bool IS_HIP = false;
// static
char* Flag::envstr_;
+4 -2
View File
@@ -12,7 +12,7 @@ debug(int, LOG_LEVEL, 0, \
"The default log level") \
debug(uint, DEBUG_GPU_FLAGS, 0, \
"The debug options for GPU device") \
release(uint, GPU_MAX_COMMAND_QUEUES, IF(IS_HIP, 300, 70), \
release(uint, GPU_MAX_COMMAND_QUEUES, 300, \
"The maximum number of concurrent Virtual GPUs") \
release(size_t, CQ_THREAD_STACK_SIZE, 256*Ki, /* @todo: that much! */ \
"The default command queue thread stack size") \
@@ -131,7 +131,7 @@ release(bool, DISABLE_DEFERRED_ALLOC, false, \
"Disables deferred memory allocation on device") \
release(int, AMD_GPU_FORCE_SINGLE_FP_DENORM, -1, \
"Force denorm for single precision: -1 - don't force, 0 - disable, 1 - enable") \
release(uint, OCL_SET_SVM_SIZE, IF(IS_HIP, 4*16384, 4096), \
release(uint, OCL_SET_SVM_SIZE, 4*16384, \
"set SVM space size for discrete GPU") \
debug(uint, OCL_SYSMEM_REQUIREMENT, 2, \
"Use flag to change the minimum requirement of system memory not to downgrade") \
@@ -184,6 +184,8 @@ release(bool, GPU_ENABLE_WGP_MODE, true, \
namespace amd {
extern bool IS_HIP;
//! \addtogroup Utils
// @{
-7
View File
@@ -107,10 +107,6 @@
#define NOT_LIGHTNING(x) x
#endif /* !WITH_LIGHTNING_COMPILER */
#ifdef BUILD_HIP
#define IS_HIP true
#endif
#ifndef IS_LINUX
#define IS_LINUX false
#endif
@@ -123,9 +119,6 @@
#ifndef IS_LIGHTNING
#define IS_LIGHTNING false
#endif
#ifndef IS_HIP
#define IS_HIP false
#endif
#define IF_LEFT_true(x) x
#define IF_LEFT_false(x)