mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
Remove device enqueue part 11
- remove templates from queue functions Related-To: NEO-6559 Signed-off-by: Katarzyna Cencelewska <katarzyna.cencelewska@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
f1a8bb821a
commit
3d9e1ea3a5
@@ -577,7 +577,7 @@ cl_int CL_API_CALL clRetainCommandQueue(cl_command_queue commandQueue) {
|
|||||||
cl_int retVal = CL_INVALID_COMMAND_QUEUE;
|
cl_int retVal = CL_INVALID_COMMAND_QUEUE;
|
||||||
API_ENTER(&retVal);
|
API_ENTER(&retVal);
|
||||||
DBG_LOG_INPUTS("commandQueue", commandQueue);
|
DBG_LOG_INPUTS("commandQueue", commandQueue);
|
||||||
retainQueue<CommandQueue>(commandQueue, retVal);
|
retainQueue(commandQueue, retVal);
|
||||||
if (retVal == CL_SUCCESS) {
|
if (retVal == CL_SUCCESS) {
|
||||||
TRACING_EXIT(clRetainCommandQueue, &retVal);
|
TRACING_EXIT(clRetainCommandQueue, &retVal);
|
||||||
return retVal;
|
return retVal;
|
||||||
@@ -593,7 +593,7 @@ cl_int CL_API_CALL clReleaseCommandQueue(cl_command_queue commandQueue) {
|
|||||||
API_ENTER(&retVal);
|
API_ENTER(&retVal);
|
||||||
DBG_LOG_INPUTS("commandQueue", commandQueue);
|
DBG_LOG_INPUTS("commandQueue", commandQueue);
|
||||||
|
|
||||||
releaseQueue<CommandQueue>(commandQueue, retVal);
|
releaseQueue(commandQueue, retVal);
|
||||||
if (retVal == CL_SUCCESS) {
|
if (retVal == CL_SUCCESS) {
|
||||||
TRACING_EXIT(clReleaseCommandQueue, &retVal);
|
TRACING_EXIT(clReleaseCommandQueue, &retVal);
|
||||||
return retVal;
|
return retVal;
|
||||||
@@ -617,7 +617,7 @@ cl_int CL_API_CALL clGetCommandQueueInfo(cl_command_queue commandQueue,
|
|||||||
"paramValue", NEO::FileLoggerInstance().infoPointerToString(paramValue, paramValueSize),
|
"paramValue", NEO::FileLoggerInstance().infoPointerToString(paramValue, paramValueSize),
|
||||||
"paramValueSizeRet", paramValueSizeRet);
|
"paramValueSizeRet", paramValueSizeRet);
|
||||||
|
|
||||||
getQueueInfo<CommandQueue>(commandQueue, paramName, paramValueSize, paramValue, paramValueSizeRet, retVal);
|
getQueueInfo(commandQueue, paramName, paramValueSize, paramValue, paramValueSizeRet, retVal);
|
||||||
// if host queue not found - try to query device queue
|
// if host queue not found - try to query device queue
|
||||||
if (retVal == CL_SUCCESS) {
|
if (retVal == CL_SUCCESS) {
|
||||||
TRACING_EXIT(clGetCommandQueueInfo, &retVal);
|
TRACING_EXIT(clGetCommandQueueInfo, &retVal);
|
||||||
|
|||||||
@@ -303,7 +303,7 @@ cl_int CommandQueue::getCommandQueueInfo(cl_command_queue_info paramName,
|
|||||||
size_t paramValueSize,
|
size_t paramValueSize,
|
||||||
void *paramValue,
|
void *paramValue,
|
||||||
size_t *paramValueSizeRet) {
|
size_t *paramValueSizeRet) {
|
||||||
return getQueueInfo<CommandQueue>(this, paramName, paramValueSize, paramValue, paramValueSizeRet);
|
return getQueueInfo(this, paramName, paramValueSize, paramValue, paramValueSizeRet);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t CommandQueue::getTaskLevelFromWaitList(uint32_t taskLevel,
|
uint32_t CommandQueue::getTaskLevelFromWaitList(uint32_t taskLevel,
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
#include "opencl/source/cl_device/cl_device.h"
|
#include "opencl/source/cl_device/cl_device.h"
|
||||||
#include "opencl/source/command_queue/command_queue.h"
|
#include "opencl/source/command_queue/command_queue.h"
|
||||||
|
#include "opencl/source/context/context.h"
|
||||||
#include "opencl/source/helpers/get_info_status_mapper.h"
|
#include "opencl/source/helpers/get_info_status_mapper.h"
|
||||||
|
|
||||||
namespace NEO {
|
namespace NEO {
|
||||||
@@ -32,29 +33,16 @@ inline bool isCommandWithoutKernel(uint32_t commandType) {
|
|||||||
(commandType == CL_COMMAND_SVM_UNMAP));
|
(commandType == CL_COMMAND_SVM_UNMAP));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename QueueType>
|
inline void retainQueue(cl_command_queue commandQueue, cl_int &retVal) {
|
||||||
void retainQueue(cl_command_queue commandQueue, cl_int &retVal) {
|
using BaseType = typename CommandQueue::BaseType;
|
||||||
using BaseType = typename QueueType::BaseType;
|
auto queue = castToObject<CommandQueue>(static_cast<BaseType *>(commandQueue));
|
||||||
auto queue = castToObject<QueueType>(static_cast<BaseType *>(commandQueue));
|
|
||||||
if (queue) {
|
if (queue) {
|
||||||
queue->retain();
|
queue->retain();
|
||||||
retVal = CL_SUCCESS;
|
retVal = CL_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename QueueType>
|
inline void releaseQueue(cl_command_queue commandQueue, cl_int &retVal) {
|
||||||
void releaseQueue(cl_command_queue commandQueue, cl_int &retVal) {
|
|
||||||
using BaseType = typename QueueType::BaseType;
|
|
||||||
auto queue = castToObject<QueueType>(static_cast<BaseType *>(commandQueue));
|
|
||||||
if (queue) {
|
|
||||||
releaseVirtualEvent(*queue);
|
|
||||||
queue->release();
|
|
||||||
retVal = CL_SUCCESS;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template <>
|
|
||||||
inline void releaseQueue<CommandQueue>(cl_command_queue commandQueue, cl_int &retVal) {
|
|
||||||
using BaseType = typename CommandQueue::BaseType;
|
using BaseType = typename CommandQueue::BaseType;
|
||||||
auto queue = castToObject<CommandQueue>(static_cast<BaseType *>(commandQueue));
|
auto queue = castToObject<CommandQueue>(static_cast<BaseType *>(commandQueue));
|
||||||
if (queue) {
|
if (queue) {
|
||||||
@@ -79,19 +67,18 @@ inline void getHostQueueInfo(CommandQueue *queue, cl_command_queue_info paramNam
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename QueueType>
|
inline cl_int getQueueInfo(CommandQueue *queue,
|
||||||
cl_int getQueueInfo(QueueType *queue,
|
cl_command_queue_info paramName,
|
||||||
cl_command_queue_info paramName,
|
size_t paramValueSize,
|
||||||
size_t paramValueSize,
|
void *paramValue,
|
||||||
void *paramValue,
|
size_t *paramValueSizeRet) {
|
||||||
size_t *paramValueSizeRet) {
|
|
||||||
|
|
||||||
cl_int retVal = CL_SUCCESS;
|
cl_int retVal = CL_SUCCESS;
|
||||||
GetInfoHelper getInfoHelper(paramValue, paramValueSize, paramValueSizeRet);
|
GetInfoHelper getInfoHelper(paramValue, paramValueSize, paramValueSizeRet);
|
||||||
|
|
||||||
switch (paramName) {
|
switch (paramName) {
|
||||||
case CL_QUEUE_CONTEXT:
|
case CL_QUEUE_CONTEXT:
|
||||||
retVal = changeGetInfoStatusToCLResultType(getInfoHelper.set<cl_context>(&queue->getContext()));
|
retVal = changeGetInfoStatusToCLResultType(getInfoHelper.set<cl_context>(queue->getContextPtr()));
|
||||||
break;
|
break;
|
||||||
case CL_QUEUE_DEVICE: {
|
case CL_QUEUE_DEVICE: {
|
||||||
Device &device = queue->getDevice();
|
Device &device = queue->getDevice();
|
||||||
@@ -120,29 +107,23 @@ cl_int getQueueInfo(QueueType *queue,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
if (std::is_same<QueueType, class CommandQueue>::value) {
|
getHostQueueInfo(queue, paramName, getInfoHelper, retVal);
|
||||||
auto cmdQ = reinterpret_cast<CommandQueue *>(queue);
|
|
||||||
getHostQueueInfo(cmdQ, paramName, getInfoHelper, retVal);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
retVal = CL_INVALID_VALUE;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename QueueType>
|
inline void getQueueInfo(cl_command_queue commandQueue,
|
||||||
void getQueueInfo(cl_command_queue commandQueue,
|
cl_command_queue_info paramName,
|
||||||
cl_command_queue_info paramName,
|
size_t paramValueSize,
|
||||||
size_t paramValueSize,
|
void *paramValue,
|
||||||
void *paramValue,
|
size_t *paramValueSizeRet,
|
||||||
size_t *paramValueSizeRet,
|
cl_int &retVal) {
|
||||||
cl_int &retVal) {
|
using BaseType = typename CommandQueue::BaseType;
|
||||||
using BaseType = typename QueueType::BaseType;
|
auto queue = castToObject<CommandQueue>(static_cast<BaseType *>(commandQueue));
|
||||||
auto queue = castToObject<QueueType>(static_cast<BaseType *>(commandQueue));
|
|
||||||
if (queue) {
|
if (queue) {
|
||||||
retVal = getQueueInfo<QueueType>(queue, paramName, paramValueSize, paramValue, paramValueSizeRet);
|
retVal = getQueueInfo(queue, paramName, paramValueSize, paramValue, paramValueSizeRet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
#include "shared/test/common/helpers/unit_test_helper.h"
|
#include "shared/test/common/helpers/unit_test_helper.h"
|
||||||
|
|
||||||
#include "opencl/source/context/context.h"
|
#include "opencl/source/context/context.h"
|
||||||
#include "opencl/test/unit_test/fixtures/device_host_queue_fixture.h"
|
|
||||||
#include "opencl/test/unit_test/mocks/mock_kernel.h"
|
#include "opencl/test/unit_test/mocks/mock_kernel.h"
|
||||||
|
|
||||||
#include "cl_api_tests.h"
|
#include "cl_api_tests.h"
|
||||||
|
|||||||
@@ -7,24 +7,36 @@
|
|||||||
|
|
||||||
#include "shared/test/common/helpers/unit_test_helper.h"
|
#include "shared/test/common/helpers/unit_test_helper.h"
|
||||||
|
|
||||||
|
#include "opencl/source/command_queue/command_queue.h"
|
||||||
#include "opencl/source/context/context.h"
|
#include "opencl/source/context/context.h"
|
||||||
#include "opencl/test/unit_test/fixtures/device_host_queue_fixture.h"
|
#include "opencl/test/unit_test/api/cl_api_tests.h"
|
||||||
|
|
||||||
using namespace NEO;
|
using namespace NEO;
|
||||||
namespace DeviceHostQueue {
|
namespace ULT {
|
||||||
typedef ::testing::Types<CommandQueue> QueueTypes;
|
|
||||||
|
|
||||||
template <typename T>
|
class clRetainReleaseCommandQueueTests : public ApiFixture<>,
|
||||||
class clRetainReleaseCommandQueueTests : public DeviceHostQueueFixture<T> {};
|
public ::testing::Test {
|
||||||
|
public:
|
||||||
|
void SetUp() override {
|
||||||
|
ApiFixture::SetUp();
|
||||||
|
}
|
||||||
|
void TearDown() override {
|
||||||
|
ApiFixture::TearDown();
|
||||||
|
}
|
||||||
|
|
||||||
TYPED_TEST_CASE(clRetainReleaseCommandQueueTests, QueueTypes);
|
cl_command_queue createClQueue() {
|
||||||
|
return clCreateCommandQueueWithProperties(pContext, testedClDevice, noProperties, &retVal);
|
||||||
|
}
|
||||||
|
|
||||||
TYPED_TEST(clRetainReleaseCommandQueueTests, GivenValidCommandQueueWhenRetainingAndReleasingThenReferenceCountIsUpdatedCorrectly) {
|
protected:
|
||||||
using BaseType = typename TypeParam::BaseType;
|
cl_queue_properties noProperties[5] = {0};
|
||||||
|
};
|
||||||
|
|
||||||
|
TEST_F(clRetainReleaseCommandQueueTests, GivenValidCommandQueueWhenRetainingAndReleasingThenReferenceCountIsUpdatedCorrectly) {
|
||||||
|
|
||||||
auto queue = this->createClQueue();
|
auto queue = this->createClQueue();
|
||||||
ASSERT_EQ(CL_SUCCESS, this->retVal);
|
ASSERT_EQ(CL_SUCCESS, this->retVal);
|
||||||
auto qObject = castToObject<TypeParam>(static_cast<BaseType *>(queue));
|
auto qObject = castToObject<CommandQueue>(queue);
|
||||||
ASSERT_NE(qObject, nullptr);
|
ASSERT_NE(qObject, nullptr);
|
||||||
|
|
||||||
cl_uint refCount;
|
cl_uint refCount;
|
||||||
@@ -52,4 +64,4 @@ TYPED_TEST(clRetainReleaseCommandQueueTests, GivenValidCommandQueueWhenRetaining
|
|||||||
this->retVal = clReleaseCommandQueue(queue);
|
this->retVal = clReleaseCommandQueue(queue);
|
||||||
EXPECT_EQ(CL_SUCCESS, this->retVal);
|
EXPECT_EQ(CL_SUCCESS, this->retVal);
|
||||||
}
|
}
|
||||||
} // namespace DeviceHostQueue
|
} // namespace ULT
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018-2021 Intel Corporation
|
* Copyright (C) 2018-2022 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@@ -560,7 +560,7 @@ HWTEST_F(CommandQueueHwTest, whenReleaseQueueCalledThenFlushIsCalled) {
|
|||||||
cl_int retVal = 0;
|
cl_int retVal = 0;
|
||||||
auto mockCmdQ = new MockCommandQueueHw<FamilyType>(context, pClDevice, 0);
|
auto mockCmdQ = new MockCommandQueueHw<FamilyType>(context, pClDevice, 0);
|
||||||
mockCmdQ->incRefInternal();
|
mockCmdQ->incRefInternal();
|
||||||
releaseQueue<CommandQueue>(mockCmdQ, retVal);
|
releaseQueue(mockCmdQ, retVal);
|
||||||
EXPECT_TRUE(mockCmdQ->flushCalled);
|
EXPECT_TRUE(mockCmdQ->flushCalled);
|
||||||
//this call will release the queue
|
//this call will release the queue
|
||||||
mockCmdQ->decRefInternal();
|
mockCmdQ->decRefInternal();
|
||||||
@@ -703,7 +703,7 @@ HWTEST_F(CommandQueueHwRefCountTest, givenBlockedCmdQWhenNewBlockedEnqueueReplac
|
|||||||
EXPECT_EQ(2, mockCmdQ->getRefInternalCount());
|
EXPECT_EQ(2, mockCmdQ->getRefInternalCount());
|
||||||
|
|
||||||
//this call will release the queue
|
//this call will release the queue
|
||||||
releaseQueue<CommandQueue>(mockCmdQ, retVal);
|
releaseQueue(mockCmdQ, retVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
HWTEST_F(CommandQueueHwRefCountTest, givenBlockedCmdQWithOutputEventAsVirtualEventWhenNewBlockedEnqueueReplacesVirtualEventCreatedFromOutputEventThenPreviousVirtualEventDoesntDecrementRefCount) {
|
HWTEST_F(CommandQueueHwRefCountTest, givenBlockedCmdQWithOutputEventAsVirtualEventWhenNewBlockedEnqueueReplacesVirtualEventCreatedFromOutputEventThenPreviousVirtualEventDoesntDecrementRefCount) {
|
||||||
@@ -748,7 +748,7 @@ HWTEST_F(CommandQueueHwRefCountTest, givenBlockedCmdQWithOutputEventAsVirtualEve
|
|||||||
EXPECT_EQ(2, mockCmdQ->getRefInternalCount());
|
EXPECT_EQ(2, mockCmdQ->getRefInternalCount());
|
||||||
mockCmdQ->isQueueBlocked();
|
mockCmdQ->isQueueBlocked();
|
||||||
|
|
||||||
releaseQueue<CommandQueue>(mockCmdQ, retVal);
|
releaseQueue(mockCmdQ, retVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
HWTEST_F(CommandQueueHwRefCountTest, givenSeriesOfBlockedEnqueuesWhenEveryEventIsDeletedAndCmdQIsReleasedThenCmdQIsDeleted) {
|
HWTEST_F(CommandQueueHwRefCountTest, givenSeriesOfBlockedEnqueuesWhenEveryEventIsDeletedAndCmdQIsReleasedThenCmdQIsDeleted) {
|
||||||
@@ -798,7 +798,7 @@ HWTEST_F(CommandQueueHwRefCountTest, givenSeriesOfBlockedEnqueuesWhenEveryEventI
|
|||||||
|
|
||||||
EXPECT_EQ(1, mockCmdQ->getRefInternalCount());
|
EXPECT_EQ(1, mockCmdQ->getRefInternalCount());
|
||||||
|
|
||||||
releaseQueue<CommandQueue>(mockCmdQ, retVal);
|
releaseQueue(mockCmdQ, retVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
HWTEST_F(CommandQueueHwRefCountTest, givenSeriesOfBlockedEnqueuesWhenCmdQIsReleasedBeforeOutputEventThenOutputEventDeletesCmdQ) {
|
HWTEST_F(CommandQueueHwRefCountTest, givenSeriesOfBlockedEnqueuesWhenCmdQIsReleasedBeforeOutputEventThenOutputEventDeletesCmdQ) {
|
||||||
@@ -838,7 +838,7 @@ HWTEST_F(CommandQueueHwRefCountTest, givenSeriesOfBlockedEnqueuesWhenCmdQIsRelea
|
|||||||
// releasing UserEvent doesn't change the queue refCount
|
// releasing UserEvent doesn't change the queue refCount
|
||||||
EXPECT_EQ(3, mockCmdQ->getRefInternalCount());
|
EXPECT_EQ(3, mockCmdQ->getRefInternalCount());
|
||||||
|
|
||||||
releaseQueue<CommandQueue>(mockCmdQ, retVal);
|
releaseQueue(mockCmdQ, retVal);
|
||||||
|
|
||||||
// releasing cmdQ decrements refCount
|
// releasing cmdQ decrements refCount
|
||||||
EXPECT_EQ(1, mockCmdQ->getRefInternalCount());
|
EXPECT_EQ(1, mockCmdQ->getRefInternalCount());
|
||||||
|
|||||||
@@ -13,8 +13,6 @@ set(IGDRCL_SRCS_tests_fixtures
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/context_fixture.h
|
${CMAKE_CURRENT_SOURCE_DIR}/context_fixture.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/d3d_test_fixture.h
|
${CMAKE_CURRENT_SOURCE_DIR}/d3d_test_fixture.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/dispatch_flags_fixture.h
|
${CMAKE_CURRENT_SOURCE_DIR}/dispatch_flags_fixture.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/device_host_queue_fixture.cpp
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/device_host_queue_fixture.h
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/device_info_fixture.h
|
${CMAKE_CURRENT_SOURCE_DIR}/device_info_fixture.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/device_instrumentation_fixture.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/device_instrumentation_fixture.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/device_instrumentation_fixture.h
|
${CMAKE_CURRENT_SOURCE_DIR}/device_instrumentation_fixture.h
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2018-2022 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "opencl/test/unit_test/fixtures/device_host_queue_fixture.h"
|
|
||||||
|
|
||||||
using namespace NEO;
|
|
||||||
|
|
||||||
namespace DeviceHostQueue {
|
|
||||||
cl_queue_properties deviceQueueProperties::minimumProperties[5] = {
|
|
||||||
CL_QUEUE_PROPERTIES,
|
|
||||||
CL_QUEUE_ON_DEVICE | CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE,
|
|
||||||
0, 0, 0};
|
|
||||||
|
|
||||||
cl_queue_properties deviceQueueProperties::minimumPropertiesWithProfiling[5] = {
|
|
||||||
CL_QUEUE_PROPERTIES,
|
|
||||||
CL_QUEUE_ON_DEVICE | CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_PROFILING_ENABLE,
|
|
||||||
0, 0, 0};
|
|
||||||
|
|
||||||
cl_queue_properties deviceQueueProperties::noProperties[5] = {0};
|
|
||||||
|
|
||||||
cl_queue_properties deviceQueueProperties::allProperties[5] = {
|
|
||||||
CL_QUEUE_PROPERTIES, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_PROFILING_ENABLE | CL_QUEUE_ON_DEVICE,
|
|
||||||
CL_QUEUE_SIZE, 128 * 1024,
|
|
||||||
0};
|
|
||||||
|
|
||||||
template <>
|
|
||||||
cl_command_queue DeviceHostQueueFixture<CommandQueue>::create(cl_context ctx, cl_device_id device, cl_int &retVal,
|
|
||||||
cl_queue_properties properties[5]) {
|
|
||||||
return clCreateCommandQueueWithProperties(ctx, device, properties, &retVal);
|
|
||||||
}
|
|
||||||
} // namespace DeviceHostQueue
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2018-2022 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
#include "shared/test/common/test_macros/test.h"
|
|
||||||
|
|
||||||
#include "opencl/source/cl_device/cl_device.h"
|
|
||||||
#include "opencl/source/command_queue/command_queue.h"
|
|
||||||
#include "opencl/test/unit_test/api/cl_api_tests.h"
|
|
||||||
#include "opencl/test/unit_test/test_macros/test_checks_ocl.h"
|
|
||||||
|
|
||||||
using namespace NEO;
|
|
||||||
|
|
||||||
namespace DeviceHostQueue {
|
|
||||||
struct deviceQueueProperties {
|
|
||||||
static cl_queue_properties minimumProperties[5];
|
|
||||||
static cl_queue_properties minimumPropertiesWithProfiling[5];
|
|
||||||
static cl_queue_properties noProperties[5];
|
|
||||||
static cl_queue_properties allProperties[5];
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
class DeviceHostQueueFixture : public ApiFixture<>,
|
|
||||||
public ::testing::Test {
|
|
||||||
public:
|
|
||||||
void SetUp() override {
|
|
||||||
ApiFixture::SetUp();
|
|
||||||
}
|
|
||||||
void TearDown() override {
|
|
||||||
ApiFixture::TearDown();
|
|
||||||
}
|
|
||||||
|
|
||||||
cl_command_queue createClQueue(cl_queue_properties properties[5] = deviceQueueProperties::noProperties) {
|
|
||||||
return create(pContext, testedClDevice, retVal, properties);
|
|
||||||
}
|
|
||||||
|
|
||||||
T *createQueueObject(cl_queue_properties properties[5] = deviceQueueProperties::noProperties) {
|
|
||||||
using BaseType = typename T::BaseType;
|
|
||||||
cl_context context = (cl_context)(pContext);
|
|
||||||
auto clQueue = create(context, testedClDevice, retVal, properties);
|
|
||||||
return castToObject<T>(static_cast<BaseType *>(clQueue));
|
|
||||||
}
|
|
||||||
|
|
||||||
cl_command_queue create(cl_context ctx, cl_device_id device, cl_int &retVal,
|
|
||||||
cl_queue_properties properties[5] = deviceQueueProperties::noProperties);
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace DeviceHostQueue
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2018-2021 Intel Corporation
|
* Copyright (C) 2018-2022 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@@ -24,7 +24,7 @@ TEST(QueueHelpersTest, givenCommandQueueWithoutVirtualEventWhenReleaseQueueIsCal
|
|||||||
cmdQ->incRefInternal();
|
cmdQ->incRefInternal();
|
||||||
EXPECT_EQ(2, cmdQ->getRefInternalCount());
|
EXPECT_EQ(2, cmdQ->getRefInternalCount());
|
||||||
|
|
||||||
releaseQueue<CommandQueue>(cmdQ, retVal);
|
releaseQueue(cmdQ, retVal);
|
||||||
|
|
||||||
EXPECT_EQ(1, cmdQ->getRefInternalCount());
|
EXPECT_EQ(1, cmdQ->getRefInternalCount());
|
||||||
cmdQ->decRefInternal();
|
cmdQ->decRefInternal();
|
||||||
|
|||||||
@@ -33,7 +33,6 @@
|
|||||||
#include "opencl/source/kernel/kernel.h"
|
#include "opencl/source/kernel/kernel.h"
|
||||||
#include "opencl/source/mem_obj/image.h"
|
#include "opencl/source/mem_obj/image.h"
|
||||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||||
#include "opencl/test/unit_test/fixtures/device_host_queue_fixture.h"
|
|
||||||
#include "opencl/test/unit_test/fixtures/multi_root_device_fixture.h"
|
#include "opencl/test/unit_test/fixtures/multi_root_device_fixture.h"
|
||||||
#include "opencl/test/unit_test/helpers/gtest_helpers.h"
|
#include "opencl/test/unit_test/helpers/gtest_helpers.h"
|
||||||
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
|
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
|
||||||
@@ -47,7 +46,6 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
using namespace NEO;
|
using namespace NEO;
|
||||||
using namespace DeviceHostQueue;
|
|
||||||
|
|
||||||
using KernelTest = ::testing::Test;
|
using KernelTest = ::testing::Test;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user