Enable Mid-Thread preemption for Gen9

Change-Id: Iacec1c8fa899d4fbf0cbb9cc292990546871ca6a
This commit is contained in:
Zdanowicz, Zbigniew
2018-01-12 14:18:53 +01:00
committed by sys_ocldev
parent 8ee2c54a50
commit 474b6a2a23
29 changed files with 243 additions and 61 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Intel Corporation
* Copyright (c) 2017 - 2018, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -325,4 +325,28 @@ TEST_F(clCreateCommandQueueWithPropertiesApi, returnErrorOnDeviceWithMedPriority
EXPECT_EQ(nullptr, cmdqd);
EXPECT_EQ(retVal, CL_INVALID_QUEUE_PROPERTIES);
}
TEST_F(clCreateCommandQueueWithPropertiesApi, returnErrorOnQueueWithPriority) {
auto pDevice = pPlatform->getDevice(0);
DeviceInfo &devInfo = const_cast<DeviceInfo &>(pDevice->getDeviceInfo());
devInfo.priorityHintsSupported = false;
cl_int retVal = CL_SUCCESS;
cl_queue_properties ondevice[] = {CL_QUEUE_PRIORITY_KHR, CL_QUEUE_PRIORITY_LOW_KHR, 0};
auto cmdqd = clCreateCommandQueueWithProperties(pContext, devices[0], ondevice, &retVal);
EXPECT_EQ(nullptr, cmdqd);
EXPECT_EQ(retVal, CL_INVALID_QUEUE_PROPERTIES);
}
TEST_F(clCreateCommandQueueWithPropertiesApi, returnSuccessOnQueueWithPriority) {
auto pDevice = pPlatform->getDevice(0);
DeviceInfo &devInfo = const_cast<DeviceInfo &>(pDevice->getDeviceInfo());
devInfo.priorityHintsSupported = true;
cl_int retVal = CL_SUCCESS;
cl_queue_properties ondevice[] = {CL_QUEUE_PRIORITY_KHR, CL_QUEUE_PRIORITY_LOW_KHR, 0};
auto cmdqd = clCreateCommandQueueWithProperties(pContext, devices[0], ondevice, &retVal);
EXPECT_NE(nullptr, cmdqd);
EXPECT_EQ(retVal, CL_SUCCESS);
retVal = clReleaseCommandQueue(cmdqd);
EXPECT_EQ(retVal, CL_SUCCESS);
}
} // namespace ULT