2017-12-21 00:45:38 +01:00
|
|
|
/*
|
2022-01-03 17:29:57 +00:00
|
|
|
* Copyright (C) 2018-2022 Intel Corporation
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
2018-09-18 09:11:08 +02:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2021-12-14 17:40:08 +00:00
|
|
|
#include "shared/test/common/test_macros/test.h"
|
|
|
|
|
2020-03-20 11:15:25 +01:00
|
|
|
#include "opencl/source/cl_device/cl_device.h"
|
2020-02-22 22:50:57 +01:00
|
|
|
#include "opencl/source/command_queue/command_queue.h"
|
2020-02-23 15:20:22 +01:00
|
|
|
#include "opencl/test/unit_test/api/cl_api_tests.h"
|
2020-04-28 13:00:33 +02:00
|
|
|
#include "opencl/test/unit_test/test_macros/test_checks_ocl.h"
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
using namespace NEO;
|
2017-12-21 00:45:38 +01:00
|
|
|
|
|
|
|
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>
|
2020-02-12 11:27:28 +01:00
|
|
|
class DeviceHostQueueFixture : public ApiFixture<>,
|
2017-12-21 00:45:38 +01:00
|
|
|
public ::testing::Test {
|
|
|
|
public:
|
|
|
|
void SetUp() override {
|
2019-12-02 14:19:24 +01:00
|
|
|
ApiFixture::SetUp();
|
2017-12-21 00:45:38 +01:00
|
|
|
}
|
|
|
|
void TearDown() override {
|
2019-12-02 14:19:24 +01:00
|
|
|
ApiFixture::TearDown();
|
2017-12-21 00:45:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
cl_command_queue createClQueue(cl_queue_properties properties[5] = deviceQueueProperties::noProperties) {
|
2020-04-24 12:58:39 +02:00
|
|
|
return create(pContext, testedClDevice, retVal, properties);
|
2017-12-21 00:45:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
T *createQueueObject(cl_queue_properties properties[5] = deviceQueueProperties::noProperties) {
|
|
|
|
using BaseType = typename T::BaseType;
|
|
|
|
cl_context context = (cl_context)(pContext);
|
2020-04-24 12:58:39 +02:00
|
|
|
auto clQueue = create(context, testedClDevice, retVal, properties);
|
2017-12-21 00:45:38 +01:00
|
|
|
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);
|
|
|
|
};
|
|
|
|
|
2018-06-12 21:54:39 +02:00
|
|
|
} // namespace DeviceHostQueue
|