SWDEV-354868 - skip subtest when number of RT CUs is less than granularity

Change-Id: Ibe0b8a2d462e9a0178a12c224b0192454618cb7c


[ROCm/clr commit: a284f9328f]
This commit is contained in:
Todd tiantuo Li
2022-12-06 05:31:52 -08:00
parent 1983391a45
commit aece761fa8
2 changed files with 13 additions and 0 deletions
@@ -80,6 +80,7 @@ void OCLRTQueue::open(unsigned int test, char* units, double& conversion,
cl_uint rtQueues;
#define CL_DEVICE_MAX_REAL_TIME_COMPUTE_QUEUES_AMD 0x404D
#define CL_DEVICE_MAX_REAL_TIME_COMPUTE_UNITS_AMD 0x404E
#define CL_DEVICE_MAX_REAL_TIME_COMPUTE_UNITS_GRANULARITY_AMD 0x403A
error_ = _wrapper->clGetDeviceInfo(devices_[_deviceId],
CL_DEVICE_MAX_REAL_TIME_COMPUTE_QUEUES_AMD,
sizeof(rtQueues), &rtQueues, 0);
@@ -99,6 +100,11 @@ void OCLRTQueue::open(unsigned int test, char* units, double& conversion,
sizeof(maxCUs_), &maxCUs_, 0);
CHECK_RESULT(error_ != CL_SUCCESS, "clGetDeviceInfo failed");
error_ = _wrapper->clGetDeviceInfo(devices_[_deviceId],
CL_DEVICE_MAX_REAL_TIME_COMPUTE_UNITS_GRANULARITY_AMD,
sizeof(rtCUsGranularity_), &rtCUsGranularity_, 0);
CHECK_RESULT(error_ != CL_SUCCESS, "clGetDeviceInfo failed");
program_ = _wrapper->clCreateProgramWithSource(context_, 1, &strKernel, NULL,
&error_);
CHECK_RESULT((error_ != CL_SUCCESS), "clCreateProgramWithSource() failed");
@@ -147,6 +153,12 @@ void OCLRTQueue::run(void) {
} else {
cu_ = rtCUs_;
}
if (cu_ < rtCUsGranularity_) {
printf("The num of CUs is less than granularity, skipping...\n");
return;
}
// Create a real time queue
#define CL_QUEUE_REAL_TIME_COMPUTE_UNITS_AMD 0x404f
const cl_queue_properties cprops[] = {
@@ -43,6 +43,7 @@ class OCLRTQueue : public OCLTestImp {
cl_uint cu_;
cl_uint maxCUs_;
cl_uint rtCUs_;
cl_uint rtCUsGranularity_;
};
#endif // _OCL_RT_QUEUE_H_