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:
Paweł Jastrzębski
2023-03-21 17:06:15 +01:00
committed by GitHub
parent b7f2dd58e9
commit 63b0f441f1
20 changed files with 2056 additions and 475 deletions

View File

@@ -0,0 +1,50 @@
//
// 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 _vulkan_interop_common_hpp_
#define _vulkan_interop_common_hpp_
#include "vulkan_wrapper_types.hpp"
#include "vulkan_wrapper.hpp"
#include "vulkan_list_map.hpp"
#include "vulkan_utility.hpp"
#include "opencl_vulkan_wrapper.hpp"
// Number of iterations for loops within tests (default value 5)
extern unsigned int innerIterations;
// Number of iterations for loops within perf tests (default value 100)
extern unsigned int perfIterations;
// Number of iterations for loops within stress tests (default value 1000)
extern unsigned int stressIterations;
// Number of CPU threads per GPU (default value 3)
extern size_t cpuThreadsPerGpu;
// Number of command queues (default value 1)
extern unsigned int numCQ;
// Enable Multi-import of vulkan device memory
extern bool multiImport;
// Enable Multi-import of vulkan device memory under different context
extern bool multiCtx;
// Enable additional debug info logging
extern bool debug_trace;
extern bool useSingleImageKernel;
extern bool useDeviceLocal;
extern bool disableNTHandleType;
// Enable offset for multiImport of vulkan device memory
extern bool enableOffset;
extern bool non_dedicated;
#endif // _vulkan_interop_common_hpp_