Refactor OCL api tests

use testedClDevice instead of devices[testedRootDeviceIndex]
pass only tested device to build program
add member ApiFixture::pDevice

Related-To: NEO-4632
Change-Id: I7d8d1bd6c3336970a1ad0f0e48c254eb6f419200
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2020-04-24 12:58:39 +02:00
committed by sys_ocldev
parent 7ed45adb27
commit fe3d0a567f
38 changed files with 216 additions and 217 deletions

View File

@ -42,11 +42,11 @@ struct IntelTracingMtTest : public api_tests {
for (int i = 0; i < iterationCount; ++i) {
HostSideTracing::AtomicBackoff backoff;
status = clGetDeviceInfo(devices[testedRootDeviceIndex], CL_DEVICE_NAME, maxStrSize, buffer, nullptr);
status = clGetDeviceInfo(testedClDevice, CL_DEVICE_NAME, maxStrSize, buffer, nullptr);
EXPECT_EQ(CL_SUCCESS, status);
backoff.pause();
status = clGetDeviceInfo(devices[testedRootDeviceIndex], CL_DEVICE_PLATFORM, sizeof(cl_platform_id), &platform, nullptr);
status = clGetDeviceInfo(testedClDevice, CL_DEVICE_PLATFORM, sizeof(cl_platform_id), &platform, nullptr);
EXPECT_EQ(CL_SUCCESS, status);
backoff.pause();
@ -82,7 +82,7 @@ struct IntelTracingMtTest : public api_tests {
};
TEST_F(IntelTracingMtTest, SafeTracingFromMultipleThreads) {
status = clCreateTracingHandleINTEL(devices[testedRootDeviceIndex], callback, this, &handle);
status = clCreateTracingHandleINTEL(testedClDevice, callback, this, &handle);
EXPECT_EQ(CL_SUCCESS, status);
status = clSetTracingPointINTEL(handle, CL_FUNCTION_clGetDeviceInfo, CL_TRUE);