2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2020-02-22 16:28:27 +08:00
|
|
|
* Copyright (C) 2017-2020 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2020-02-23 05:50:57 +08:00
|
|
|
#include "opencl/source/command_queue/command_queue.h"
|
|
|
|
|
2019-02-27 18:39:32 +08:00
|
|
|
#include "cl_api_tests.h"
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
using namespace NEO;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
typedef api_tests clEnqueueBarrierTests;
|
|
|
|
|
2018-12-18 04:22:01 +08:00
|
|
|
TEST_F(clEnqueueBarrierTests, GivenNullCommandQueueWhenEnqueuingThenInvalidCommandQueueErrorIsReturned) {
|
2017-12-21 07:45:38 +08:00
|
|
|
auto retVal = clEnqueueBarrier(
|
|
|
|
nullptr);
|
|
|
|
EXPECT_EQ(CL_INVALID_COMMAND_QUEUE, retVal);
|
|
|
|
}
|
|
|
|
|
2020-11-26 01:36:10 +08:00
|
|
|
TEST_F(clEnqueueBarrierTests, GivenValidCommandQueueWhenEnqueuingBarrierThenSuccessIsReturned) {
|
2017-12-21 07:45:38 +08:00
|
|
|
auto retVal = clEnqueueBarrier(
|
|
|
|
pCommandQueue);
|
|
|
|
EXPECT_EQ(CL_SUCCESS, retVal);
|
|
|
|
}
|
2020-11-26 01:36:10 +08:00
|
|
|
|
|
|
|
TEST_F(clEnqueueBarrierTests, GivenQueueIncapableWhenEnqueuingBarrierThenInvalidOperationIsReturned) {
|
|
|
|
this->disableQueueCapabilities(CL_QUEUE_CAPABILITY_BARRIER_INTEL);
|
|
|
|
auto retVal = clEnqueueBarrier(
|
|
|
|
pCommandQueue);
|
|
|
|
EXPECT_EQ(CL_INVALID_OPERATION, retVal);
|
|
|
|
}
|