mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Semaphore spec has been updated to reflect the fact that semaphores will be in the appropriate - pending signal or pending wait - state when returning from clEnqueueSignalSemaphore or clEnqueueWaitSemaphore commands: KhronosGroup/OpenCL-Docs#882 Deleted the following tests to match the updated spec: semaphores_order_1 - Test calls EnqueueWaitSemaphore before calling EnqueueSignalSemaphore and expects this wait to succeed. This behavior is not compatible with the recent spec updates to semaphores. semaphores_order_2 & semaphores_order_3 - Calling clEnqueueSignalSemaphoresKHR with a dependency on a user event may cause the implementation to block until the user event is complete. This is unsafe usage of clEnqueueSignalSemaphoresKHR and may lead to deadlock. semaphores_invalid_command - This test checks for specific behavior when waiting on a semaphore in an invalid state. According to the spec, this is undefined behavior, and therefore cannot be tested directly. Co-authored-by: Joshua Kelly <joshkell@qti.qualcomm.com>
46 lines
1.5 KiB
C++
46 lines
1.5 KiB
C++
//
|
|
// Copyright (c) 2023 The Khronos Group Inc.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
//
|
|
#include "harness/compat.h"
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
#include "procs.h"
|
|
#include "harness/testHarness.h"
|
|
|
|
#if !defined(_WIN32)
|
|
#include <unistd.h>
|
|
#endif
|
|
|
|
test_definition test_list[] = {
|
|
ADD_TEST_VERSION(semaphores_simple_1, Version(1, 2)),
|
|
ADD_TEST_VERSION(semaphores_simple_2, Version(1, 2)),
|
|
ADD_TEST_VERSION(semaphores_reuse, Version(1, 2)),
|
|
ADD_TEST_VERSION(semaphores_cross_queues_ooo, Version(1, 2)),
|
|
ADD_TEST_VERSION(semaphores_cross_queues_io, Version(1, 2)),
|
|
ADD_TEST_VERSION(semaphores_multi_signal, Version(1, 2)),
|
|
ADD_TEST_VERSION(semaphores_multi_wait, Version(1, 2)),
|
|
ADD_TEST_VERSION(semaphores_queries, Version(1, 2)),
|
|
ADD_TEST_VERSION(semaphores_import_export_fd, Version(1, 2)),
|
|
};
|
|
|
|
const int test_num = ARRAY_SIZE(test_list);
|
|
|
|
int main(int argc, const char *argv[])
|
|
{
|
|
return runTestHarness(argc, argv, test_num, test_list, false, 0);
|
|
}
|