mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 22:12:59 +08:00
Change return code for APIs with no support in windows
Related-To: LOCI-3863 Signed-off-by: Kulkarni, Ashwin Kumar <ashwin.kumar.kulkarni@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
d8e4b324ad
commit
c93b084a4b
@@ -85,6 +85,12 @@ ze_result_t KmdSysManager::requestSingle(KmdSysman::RequestProperty &inputReques
|
||||
return ZE_RESULT_ERROR_INVALID_SIZE;
|
||||
}
|
||||
|
||||
if ((outputResponse.returnCode == KmdSysman::ReturnCodes::DomainServiceNotSupported) ||
|
||||
(outputResponse.returnCode == KmdSysman::ReturnCodes::GetNotSupported) ||
|
||||
(outputResponse.returnCode == KmdSysman::ReturnCodes::SetNotSupported)) {
|
||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
||||
}
|
||||
|
||||
return (outputResponse.returnCode == KmdSysman::KmdSysmanSuccess) ? ZE_RESULT_SUCCESS : ZE_RESULT_ERROR_NOT_AVAILABLE;
|
||||
} else if (status == STATUS_DEVICE_REMOVED) {
|
||||
return ZE_RESULT_ERROR_DEVICE_LOST;
|
||||
|
||||
@@ -84,7 +84,14 @@ ze_result_t KmdSysManager::requestSingle(KmdSysman::RequestProperty &inputReques
|
||||
return ZE_RESULT_ERROR_INVALID_SIZE;
|
||||
}
|
||||
|
||||
if ((outputResponse.returnCode == KmdSysman::ReturnCodes::DomainServiceNotSupported) ||
|
||||
(outputResponse.returnCode == KmdSysman::ReturnCodes::GetNotSupported) ||
|
||||
(outputResponse.returnCode == KmdSysman::ReturnCodes::SetNotSupported)) {
|
||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
||||
}
|
||||
|
||||
return (outputResponse.returnCode == KmdSysman::KmdSysmanSuccess) ? ZE_RESULT_SUCCESS : ZE_RESULT_ERROR_NOT_AVAILABLE;
|
||||
|
||||
} else if (status == STATUS_DEVICE_REMOVED) {
|
||||
return ZE_RESULT_ERROR_DEVICE_LOST;
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ struct Mock<FrequencyKmdSysManager> : public FrequencyKmdSysManager {
|
||||
pResponse->outDataSize = 2 * sizeof(uint32_t);
|
||||
} else if (domain == KmdSysman::GeneralDomainsType::GeneralDomainHBM) {
|
||||
pResponse->outDataSize = 0;
|
||||
pResponse->outReturnCode = KmdSysman::KmdSysmanFail;
|
||||
pResponse->outReturnCode = KmdSysman::ReturnCodes::DomainServiceNotSupported;
|
||||
}
|
||||
} break;
|
||||
case KmdSysman::Requests::Frequency::CurrentRequestedFrequency: {
|
||||
@@ -297,12 +297,17 @@ struct Mock<FrequencyKmdSysManager> : public FrequencyKmdSysManager {
|
||||
}
|
||||
switch (pRequest->inRequestId) {
|
||||
case KmdSysman::Requests::Frequency::CurrentFrequencyRange: {
|
||||
uint32_t *pMinFreq = reinterpret_cast<uint32_t *>(pBuffer);
|
||||
uint32_t *pMaxFreq = reinterpret_cast<uint32_t *>(pBuffer + sizeof(uint32_t));
|
||||
mockMinFrequencyRange = *pMinFreq;
|
||||
mockMaxFrequencyRange = *pMaxFreq;
|
||||
pResponse->outDataSize = 0;
|
||||
pResponse->outReturnCode = KmdSysman::KmdSysmanSuccess;
|
||||
if (domain == KmdSysman::GeneralDomainsType::GeneralDomainDGPU) {
|
||||
uint32_t *pMinFreq = reinterpret_cast<uint32_t *>(pBuffer);
|
||||
uint32_t *pMaxFreq = reinterpret_cast<uint32_t *>(pBuffer + sizeof(uint32_t));
|
||||
mockMinFrequencyRange = *pMinFreq;
|
||||
mockMaxFrequencyRange = *pMaxFreq;
|
||||
pResponse->outDataSize = 0;
|
||||
pResponse->outReturnCode = KmdSysman::KmdSysmanSuccess;
|
||||
} else if (domain == KmdSysman::GeneralDomainsType::GeneralDomainHBM) {
|
||||
pResponse->outDataSize = 0;
|
||||
pResponse->outReturnCode = KmdSysman::ReturnCodes::DomainServiceNotSupported;
|
||||
}
|
||||
} break;
|
||||
case KmdSysman::Requests::Frequency::CurrentFixedMode: {
|
||||
uint32_t *pValue = reinterpret_cast<uint32_t *>(pBuffer);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2022 Intel Corporation
|
||||
* Copyright (C) 2020-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -234,13 +234,28 @@ TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFreq
|
||||
EXPECT_DOUBLE_EQ(pKmdSysManager->mockMinFrequencyRange, limits.min);
|
||||
EXPECT_DOUBLE_EQ(pKmdSysManager->mockMaxFrequencyRange, limits.max);
|
||||
} else if (domainIndex == ZES_FREQ_DOMAIN_MEMORY) {
|
||||
EXPECT_EQ(ZE_RESULT_ERROR_NOT_AVAILABLE, zesFrequencyGetRange(handle, &limits));
|
||||
EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, zesFrequencyGetRange(handle, &limits));
|
||||
}
|
||||
|
||||
domainIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingFrequencyGetRangeAndSetRangeThenUnsupportedErrorIsReturnedForMemoryDomain) {
|
||||
auto handles = get_frequency_handles(frequencyHandleComponentCount);
|
||||
uint32_t domainIndex = 0;
|
||||
for (auto handle : handles) {
|
||||
zes_freq_range_t limits;
|
||||
if (domainIndex == ZES_FREQ_DOMAIN_MEMORY) {
|
||||
EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, zesFrequencyGetRange(handle, &limits));
|
||||
limits.min = pKmdSysManager->mockResolvedFrequency[ZES_FREQ_DOMAIN_MEMORY];
|
||||
limits.max = pKmdSysManager->mockResolvedFrequency[ZES_FREQ_DOMAIN_MEMORY];
|
||||
EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, zesFrequencySetRange(handle, &limits));
|
||||
}
|
||||
domainIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(SysmanDeviceFrequencyFixture, GivenValidFrequencyHandleWhenCallingzesFrequencySetRangeThenVerifyzesFrequencySetRangeTest1CallSucceeds) {
|
||||
auto handles = get_frequency_handles(frequencyHandleComponentCount);
|
||||
uint32_t domainIndex = 0;
|
||||
|
||||
Reference in New Issue
Block a user