mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Add debug flag to control fine grain SVM reporting.
Change-Id: Ia5c8b8798951d87aa81799ac3a3f456d10e1aceb Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:

committed by
sys_ocldev

parent
5be85293d6
commit
71950fa7cc
@ -404,9 +404,16 @@ void ClDevice::initializeCaps() {
|
||||
|
||||
deviceInfo.linkerAvailable = true;
|
||||
deviceInfo.svmCapabilities = hwInfo.capabilityTable.ftrSvm * CL_DEVICE_SVM_COARSE_GRAIN_BUFFER;
|
||||
deviceInfo.svmCapabilities |= static_cast<cl_device_svm_capabilities>(
|
||||
hwInfo.capabilityTable.ftrSvm * hwInfo.capabilityTable.ftrSupportsCoherency *
|
||||
(CL_DEVICE_SVM_FINE_GRAIN_BUFFER | CL_DEVICE_SVM_ATOMICS));
|
||||
if (hwInfo.capabilityTable.ftrSvm) {
|
||||
auto reportFineGrained = hwInfo.capabilityTable.ftrSvm * hwInfo.capabilityTable.ftrSupportsCoherency;
|
||||
if (DebugManager.flags.ForceFineGrainedSVMSupport.get() != -1) {
|
||||
reportFineGrained = !!DebugManager.flags.ForceFineGrainedSVMSupport.get();
|
||||
}
|
||||
if (reportFineGrained) {
|
||||
deviceInfo.svmCapabilities |= static_cast<cl_device_svm_capabilities>(CL_DEVICE_SVM_FINE_GRAIN_BUFFER | CL_DEVICE_SVM_ATOMICS);
|
||||
}
|
||||
}
|
||||
|
||||
deviceInfo.preemptionSupported = false;
|
||||
deviceInfo.maxGlobalVariableSize = 64 * 1024;
|
||||
deviceInfo.globalVariablePreferredTotalSize = static_cast<size_t>(sharedDeviceInfo.maxMemAllocSize);
|
||||
|
@ -108,6 +108,56 @@ TEST_F(clGetDeviceInfoTests, givenOpenCLDeviceWhenAskedForSupportedSvmTypeCorrec
|
||||
EXPECT_EQ(svmCaps, expectedCaps);
|
||||
}
|
||||
|
||||
TEST(clGetDeviceFineGrainedTests, givenDebugFlagForFineGrainedOverrideWhenItIsUsedWithZeroThenNoFineGrainSupport) {
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.ForceFineGrainedSVMSupport.set(0);
|
||||
cl_device_svm_capabilities svmCaps;
|
||||
|
||||
auto hwInfo = *platformDevices[0];
|
||||
|
||||
auto pDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo, 0));
|
||||
|
||||
auto retVal = clGetDeviceInfo(
|
||||
pDevice.get(),
|
||||
CL_DEVICE_SVM_CAPABILITIES,
|
||||
sizeof(cl_device_svm_capabilities),
|
||||
&svmCaps,
|
||||
nullptr);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
cl_device_svm_capabilities expectedCaps = 0;
|
||||
if (hwInfo.capabilityTable.ftrSvm != 0) {
|
||||
expectedCaps = CL_DEVICE_SVM_COARSE_GRAIN_BUFFER;
|
||||
}
|
||||
EXPECT_EQ(svmCaps, expectedCaps);
|
||||
}
|
||||
|
||||
TEST(clGetDeviceFineGrainedTests, givenDebugFlagForFineGrainedOverrideWhenItIsUsedWithOneThenThereIsFineGrainSupport) {
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.ForceFineGrainedSVMSupport.set(1);
|
||||
cl_device_svm_capabilities svmCaps;
|
||||
|
||||
auto hwInfo = *platformDevices[0];
|
||||
|
||||
auto pDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo, 0));
|
||||
|
||||
auto retVal = clGetDeviceInfo(
|
||||
pDevice.get(),
|
||||
CL_DEVICE_SVM_CAPABILITIES,
|
||||
sizeof(cl_device_svm_capabilities),
|
||||
&svmCaps,
|
||||
nullptr);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
cl_device_svm_capabilities expectedCaps = 0;
|
||||
if (hwInfo.capabilityTable.ftrSvm != 0) {
|
||||
expectedCaps = CL_DEVICE_SVM_COARSE_GRAIN_BUFFER | CL_DEVICE_SVM_FINE_GRAIN_BUFFER | CL_DEVICE_SVM_ATOMICS;
|
||||
}
|
||||
EXPECT_EQ(svmCaps, expectedCaps);
|
||||
}
|
||||
|
||||
TEST_F(clGetDeviceInfoTests, givenNeoDeviceWhenAskedForDriverVersionThenNeoIsReturned) {
|
||||
cl_device_info paramName = 0;
|
||||
size_t paramSize = 0;
|
||||
|
@ -137,4 +137,5 @@ DirectSubmissionDisableCpuCacheFlush = -1
|
||||
WddmResidencyLogger = 0
|
||||
DirectSubmissionEnableDebugBuffer = 0
|
||||
DirectSubmissionDisableCacheFlush = 0
|
||||
DirectSubmissionDisableMonitorFence = 0
|
||||
DirectSubmissionDisableMonitorFence = 0
|
||||
ForceFineGrainedSVMSupport = -1
|
@ -142,6 +142,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, RenderCompressedImagesEnabled, -1, "-1: default,
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, RenderCompressedBuffersEnabled, -1, "-1: default, 0: disabled, 1: enabled")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, EnableSharedSystemUsmSupport, -1, "-1: default, 0: shared system memory disabled, 1: shared system memory enabled")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, EnablePassInlineData, -1, "-1: default, 0: Do not allow to pass inline data 1: Enable passing of inline data")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, ForceFineGrainedSVMSupport, -1, "-1: default, 0: Do not report Fine Grained SVM capabilties 1: Report SVM Fine Grained capabilities if device supports SVM")
|
||||
|
||||
/*DRIVER TOGGLES*/
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, ForceOCLVersion, 0, "Force specific OpenCL API version")
|
||||
|
Reference in New Issue
Block a user