Files
compute-runtime/opencl/test/unit_test/api/cl_enqueue_barrier_tests.inl
Maciej Dziuban 41a90e67d7 OpenCL Queue Families extension 5/n
Check queue capabilities in enqueue calls for kernels, barriers and markers

Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
Related-To: NEO-5120
2020-11-30 17:35:38 +01:00

34 lines
926 B
C++

/*
* Copyright (C) 2017-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "opencl/source/command_queue/command_queue.h"
#include "cl_api_tests.h"
using namespace NEO;
typedef api_tests clEnqueueBarrierTests;
TEST_F(clEnqueueBarrierTests, GivenNullCommandQueueWhenEnqueuingThenInvalidCommandQueueErrorIsReturned) {
auto retVal = clEnqueueBarrier(
nullptr);
EXPECT_EQ(CL_INVALID_COMMAND_QUEUE, retVal);
}
TEST_F(clEnqueueBarrierTests, GivenValidCommandQueueWhenEnqueuingBarrierThenSuccessIsReturned) {
auto retVal = clEnqueueBarrier(
pCommandQueue);
EXPECT_EQ(CL_SUCCESS, retVal);
}
TEST_F(clEnqueueBarrierTests, GivenQueueIncapableWhenEnqueuingBarrierThenInvalidOperationIsReturned) {
this->disableQueueCapabilities(CL_QUEUE_CAPABILITY_BARRIER_INTEL);
auto retVal = clEnqueueBarrier(
pCommandQueue);
EXPECT_EQ(CL_INVALID_OPERATION, retVal);
}