mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-24 15:59:03 +00:00
Add external semaphore tests. (#1645)
* Add external semaphore tests. Added basic test to check the functionality of cl_ext_external_semaphore_test extension. Tests rely on Vulkan API as the producer of the external semaphore functionality. The Vulkan wrapper has been copied from the Vulkan CTS tests and minor changes have been introduced. A separate copy of the Vulkan wrapper is for breaking any dependencies between different CTS modules and thus make the build system simpler. Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com> * Fix clang-format Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com> * Move vulkan wrapper to a separate library. Vulkan wrapper is extracted as a separate module and can be used in different CTS tests as a shared library. Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com> * Add cl_ext_external_samaphore tests based on cl_khr_semaphore tests. Added cl_khr_semaphore adjusted to creating semaphores in Vulkan context and importing them through export semaphore functionality in OpenCL (cl_ext_external_samaphore). Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com> * Cleanup. Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com> * Fix build issues. * Add missing directories for build cl_ext_external_semaphore. Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com> * Set Vulkan lib directory. Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com> * Change extension directory name. Changed extensions directory name from cl_ext_external_semaphore to cl_khr_external_semaphore. Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com> * Remove unneeded compile options. Removed VK_USE_PLATFORM_WIN32_KHR option from cl_khr_external_semaphore compilation arguments. Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com> --------- Signed-off-by: Paweł Jastrzębski <p.k.jastrzebski@gmail.com>
This commit is contained in:
committed by
GitHub
parent
b7f2dd58e9
commit
63b0f441f1
@@ -2,3 +2,6 @@ add_subdirectory( cl_ext_cxx_for_opencl )
|
||||
add_subdirectory( cl_khr_command_buffer )
|
||||
add_subdirectory( cl_khr_dx9_media_sharing )
|
||||
add_subdirectory( cl_khr_semaphore )
|
||||
if(VULKAN_IS_SUPPORTED)
|
||||
add_subdirectory( cl_khr_external_semaphore )
|
||||
endif()
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
set(MODULE_NAME CL_KHR_EXTERNAL_SEMAPHORE)
|
||||
|
||||
set(${MODULE_NAME}_SOURCES
|
||||
main.cpp
|
||||
test_external_semaphore.cpp
|
||||
)
|
||||
|
||||
set (CLConform_VULKAN_LIBRARIES_DIR "${VULKAN_LIB_DIR}")
|
||||
|
||||
link_directories(${CLConform_VULKAN_LIBRARIES_DIR})
|
||||
|
||||
list(APPEND CLConform_INCLUDE_DIR ${VULKAN_INCLUDE_DIR})
|
||||
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
include_directories (${CLConform_INCLUDE_DIR})
|
||||
|
||||
# needed by Vulkan wrapper to link
|
||||
if(WIN32)
|
||||
list(APPEND CLConform_LIBRARIES vulkan-1 vulkan_wrapper)
|
||||
else(WIN32)
|
||||
list(APPEND CLConform_LIBRARIES vulkan dl vulkan_wrapper)
|
||||
endif(WIN32)
|
||||
set(CMAKE_CXX_FLAGS "-fpermissive")
|
||||
|
||||
include_directories("../../common/vulkan_wrapper")
|
||||
|
||||
include(../../CMakeCommon.txt)
|
||||
@@ -0,0 +1,46 @@
|
||||
// Copyright (c) 2022 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 "procs.h"
|
||||
#include "harness/testHarness.h"
|
||||
|
||||
test_definition test_list[] = {
|
||||
ADD_TEST(external_semaphores_queries),
|
||||
ADD_TEST(external_semaphores_multi_context),
|
||||
ADD_TEST(external_semaphores_simple_1),
|
||||
// ADD_TEST(external_semaphores_simple_2),
|
||||
ADD_TEST(external_semaphores_reuse),
|
||||
ADD_TEST(external_semaphores_cross_queues_ooo),
|
||||
ADD_TEST(external_semaphores_cross_queues_io),
|
||||
ADD_TEST(external_semaphores_cross_queues_io2),
|
||||
ADD_TEST(external_semaphores_multi_signal),
|
||||
ADD_TEST(external_semaphores_multi_wait),
|
||||
// ADD_TEST(external_semaphores_order_1),
|
||||
// ADD_TEST(external_semaphores_order_2),
|
||||
// ADD_TEST(external_semaphores_order_3),
|
||||
// ADD_TEST(external_semaphores_invalid_command)
|
||||
};
|
||||
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
// A device may report the required properties of a queue that
|
||||
// is compatible with command-buffers via the query
|
||||
// CL_DEVICE_COMMAND_BUFFER_REQUIRED_QUEUE_PROPERTIES_KHR. We account
|
||||
// for this in the tests themselves, rather than here, where we have a
|
||||
// device to query.
|
||||
const cl_command_queue_properties queue_properties = 0;
|
||||
return runTestHarnessWithCheck(argc, argv, ARRAY_SIZE(test_list), test_list,
|
||||
false, queue_properties, nullptr);
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
//
|
||||
// Copyright (c) 2022 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.
|
||||
//
|
||||
#ifndef _CL_KHR_EXTERNAL_SEMAPHORE_PROCS_H
|
||||
#define _CL_KHR_EXTERNAL_SEMAPHORE_PROCS_H
|
||||
|
||||
#include <CL/cl.h>
|
||||
|
||||
// Basic command-buffer tests
|
||||
|
||||
extern int test_external_semaphores_queries(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue defaultQueue,
|
||||
int num_elements);
|
||||
extern int test_external_semaphores_multi_context(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue defaultQueue,
|
||||
int num_elements);
|
||||
extern int test_external_semaphores_simple_1(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements);
|
||||
extern int test_external_semaphores_simple_2(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements);
|
||||
extern int test_external_semaphores_reuse(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements);
|
||||
extern int test_external_semaphores_cross_queues_ooo(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements);
|
||||
extern int test_external_semaphores_cross_queues_io(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements);
|
||||
extern int test_external_semaphores_cross_queues_io2(
|
||||
cl_device_id deviceID, cl_context context, cl_command_queue defaultQueue,
|
||||
int num_elements);
|
||||
extern int test_external_semaphores_multi_signal(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements);
|
||||
extern int test_external_semaphores_multi_wait(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements);
|
||||
extern int test_external_semaphores_order_1(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements);
|
||||
extern int test_external_semaphores_order_2(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements);
|
||||
extern int test_external_semaphores_order_3(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements);
|
||||
extern int test_external_semaphores_import_export_fd(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements);
|
||||
extern int test_external_semaphores_invalid_command(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements);
|
||||
#endif /* CL_KHR_EXTERNAL_SEMAPHORE */
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user