mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Add info about supported thread arbitration policies
Signed-off-by: Katarzyna Cencelewska <katarzyna.cencelewska@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
6a4c263bd6
commit
3d13a9d855
@ -8,6 +8,8 @@
|
||||
#include "shared/source/device/device.h"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
|
||||
#include "opencl/source/helpers/cl_hw_helper.h"
|
||||
|
||||
#include "cl_api_tests.h"
|
||||
|
||||
#include <cstring>
|
||||
@ -273,6 +275,49 @@ TEST_F(clGetDeviceInfoTests, GivenClDeviceIlVersionParamWhenGettingDeviceInfoThe
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
EXPECT_STREQ("SPIR-V_1.2 ", paramValue.get());
|
||||
}
|
||||
using matcherAtMostGen12lp = IsAtMostGfxCore<IGFX_GEN12LP_CORE>;
|
||||
HWTEST2_F(clGetDeviceInfoTests, givenClDeviceSupportedThreadArbitrationPolicyIntelWhenCallClGetDeviceInfoThenProperArrayIsReturned, matcherAtMostGen12lp) {
|
||||
cl_device_info paramName = 0;
|
||||
cl_uint paramValue[3];
|
||||
size_t paramSize = sizeof(paramValue);
|
||||
size_t paramRetSize = 0;
|
||||
|
||||
paramName = CL_DEVICE_SUPPORTED_THREAD_ARBITRATION_POLICY_INTEL;
|
||||
cl_uint expectedRetValue[] = {CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_OLDEST_FIRST_INTEL, CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_ROUND_ROBIN_INTEL, CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_AFTER_DEPENDENCY_ROUND_ROBIN_INTEL};
|
||||
|
||||
retVal = clGetDeviceInfo(
|
||||
testedClDevice,
|
||||
paramName,
|
||||
paramSize,
|
||||
paramValue,
|
||||
¶mRetSize);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
EXPECT_EQ(sizeof(expectedRetValue), paramRetSize);
|
||||
EXPECT_TRUE(memcmp(expectedRetValue, paramValue, sizeof(expectedRetValue)) == 0);
|
||||
}
|
||||
|
||||
HWTEST_F(clGetDeviceInfoTests, givenClDeviceSupportedThreadArbitrationPolicyIntelWhenThreadArbitrationPolicyChangeNotSupportedAndCallClGetDeviceInfoThenParamRetSizeIsZero) {
|
||||
auto &hwHelper = NEO::ClHwHelper::get(defaultHwInfo->platform.eRenderCoreFamily);
|
||||
if (hwHelper.isSupportedKernelThreadArbitrationPolicy()) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
cl_device_info paramName = 0;
|
||||
cl_uint paramValue[3];
|
||||
size_t paramSize = sizeof(paramValue);
|
||||
size_t paramRetSize = 0;
|
||||
|
||||
paramName = CL_DEVICE_SUPPORTED_THREAD_ARBITRATION_POLICY_INTEL;
|
||||
|
||||
retVal = clGetDeviceInfo(
|
||||
testedClDevice,
|
||||
paramName,
|
||||
paramSize,
|
||||
paramValue,
|
||||
¶mRetSize);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
EXPECT_EQ(0u, paramRetSize);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
struct GetDeviceInfoP : public ApiFixture<>,
|
||||
|
@ -5,6 +5,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencl/source/helpers/cl_hw_helper.h"
|
||||
#include "opencl/test/unit_test/command_stream/thread_arbitration_policy_helper.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_kernel.h"
|
||||
#include "test.h"
|
||||
@ -66,6 +67,10 @@ TEST_F(clSetKernelExecInfoTests, GivenNullKernelWhenSettingAdditionalKernelInfoT
|
||||
}
|
||||
|
||||
TEST_F(clSetKernelExecInfoTests, GivenDeviceNotSupportingSvmWhenSettingKernelExecInfoThenErrorIsReturnedOnSvmRelatedParams) {
|
||||
auto &hwHelper = NEO::ClHwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily);
|
||||
if (!hwHelper.isSupportedKernelThreadArbitrationPolicy()) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
auto hwInfo = executionEnvironment->rootDeviceEnvironments[ApiFixture::testedRootDeviceIndex]->getMutableHardwareInfo();
|
||||
VariableBackup<bool> ftrSvm{&hwInfo->capabilityTable.ftrSvm, false};
|
||||
|
||||
@ -298,6 +303,10 @@ TEST_F(clSetKernelExecInfoTests, givenNonExistingParamNameWithValuesWhenSettingA
|
||||
}
|
||||
|
||||
HWTEST_F(clSetKernelExecInfoTests, givenKernelExecInfoThreadArbitrationPolicyWhenSettingAdditionalKernelInfoThenSuccessIsReturned) {
|
||||
auto &hwHelper = NEO::ClHwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily);
|
||||
if (!hwHelper.isSupportedKernelThreadArbitrationPolicy()) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
uint32_t newThreadArbitrationPolicy = CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_ROUND_ROBIN_INTEL;
|
||||
size_t ptrSizeInBytes = sizeof(uint32_t *);
|
||||
|
||||
@ -312,7 +321,28 @@ HWTEST_F(clSetKernelExecInfoTests, givenKernelExecInfoThreadArbitrationPolicyWhe
|
||||
EXPECT_EQ(getNewKernelArbitrationPolicy(newThreadArbitrationPolicy), pMockKernel->getThreadArbitrationPolicy());
|
||||
}
|
||||
|
||||
HWTEST_F(clSetKernelExecInfoTests, givenKernelExecInfoThreadArbitrationPolicyWhenNotSupportedAndSettingAdditionalKernelInfoThenClInvalidDeviceIsReturned) {
|
||||
auto &hwHelper = NEO::ClHwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily);
|
||||
if (hwHelper.isSupportedKernelThreadArbitrationPolicy()) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
uint32_t newThreadArbitrationPolicy = CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_ROUND_ROBIN_INTEL;
|
||||
size_t ptrSizeInBytes = sizeof(uint32_t *);
|
||||
|
||||
retVal = clSetKernelExecInfo(
|
||||
pMockMultiDeviceKernel, // cl_kernel kernel
|
||||
CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_INTEL, // cl_kernel_exec_info param_name
|
||||
ptrSizeInBytes, // size_t param_value_size
|
||||
&newThreadArbitrationPolicy // const void *param_value
|
||||
);
|
||||
EXPECT_EQ(CL_INVALID_DEVICE, retVal);
|
||||
}
|
||||
|
||||
HWTEST_F(clSetKernelExecInfoTests, givenInvalidThreadArbitrationPolicyWhenSettingAdditionalKernelInfoThenClInvalidValueIsReturned) {
|
||||
auto &hwHelper = NEO::ClHwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily);
|
||||
if (!hwHelper.isSupportedKernelThreadArbitrationPolicy()) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
uint32_t invalidThreadArbitrationPolicy = 0;
|
||||
size_t ptrSizeInBytes = 1 * sizeof(uint32_t *);
|
||||
|
||||
|
Reference in New Issue
Block a user