mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-26 08:49:02 +00:00
cl20: Fix building media sharing tests (#391)
* Add media_sharing to cmakes * Adjust cases to ADD_TEST macro * Review fixes
This commit is contained in:
committed by
Kévin Petit
parent
d7ff4aa502
commit
150520c7e1
@@ -160,3 +160,4 @@ if(MSVC)
|
|||||||
endif(MSVC)
|
endif(MSVC)
|
||||||
|
|
||||||
set_property(TARGET COPY_FILES${CONFORMANCE_SUFFIX} PROPERTY FOLDER "CONFORMANCE${CONFORMANCE_SUFFIX}")
|
set_property(TARGET COPY_FILES${CONFORMANCE_SUFFIX} PROPERTY FOLDER "CONFORMANCE${CONFORMANCE_SUFFIX}")
|
||||||
|
add_subdirectory( "test_extensions" )
|
||||||
1
test_extensions/CMakeLists.txt
Normal file
1
test_extensions/CMakeLists.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
add_subdirectory( media_sharing )
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
if(WIN32)
|
if(WIN32)
|
||||||
list(APPEND CLConform_LIBRARIES d3d9.lib dxva2.lib )
|
list(APPEND CLConform_LIBRARIES d3d9.lib dxva2.lib )
|
||||||
endif(WIN32)
|
|
||||||
|
|
||||||
set (MEDIA_SOURCES
|
set (MEDIA_SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
@@ -19,6 +18,7 @@ set (MEDIA_SOURCES
|
|||||||
../../test_common/harness/rounding_mode.c
|
../../test_common/harness/rounding_mode.c
|
||||||
../../test_common/harness/typeWrappers.cpp
|
../../test_common/harness/typeWrappers.cpp
|
||||||
../../test_common/harness/mt19937.c
|
../../test_common/harness/mt19937.c
|
||||||
|
../../test_common/harness/msvc9.c
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(conformance_test_media_surface_sharing
|
add_executable(conformance_test_media_surface_sharing
|
||||||
@@ -30,3 +30,5 @@ set_source_files_properties(
|
|||||||
|
|
||||||
TARGET_LINK_LIBRARIES(conformance_test_media_surface_sharing
|
TARGET_LINK_LIBRARIES(conformance_test_media_surface_sharing
|
||||||
${CLConform_LIBRARIES})
|
${CLConform_LIBRARIES})
|
||||||
|
|
||||||
|
endif(WIN32)
|
||||||
|
|||||||
@@ -18,38 +18,20 @@
|
|||||||
|
|
||||||
#include "../../test_common/harness/testHarness.h"
|
#include "../../test_common/harness/testHarness.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
#include "procs.h"
|
||||||
|
|
||||||
extern int test_context_create(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
|
|
||||||
extern int test_get_device_ids(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
|
|
||||||
extern int test_api(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
|
|
||||||
extern int test_kernel(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
|
|
||||||
extern int test_other_data_types(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
|
|
||||||
extern int test_memory_access(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
|
|
||||||
extern int test_interop_user_sync(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
|
|
||||||
|
|
||||||
basefn basefn_list[] = {
|
test_definition test_list[] = {
|
||||||
test_context_create,
|
ADD_TEST( context_create ),
|
||||||
test_get_device_ids,
|
ADD_TEST( get_device_ids ),
|
||||||
test_api,
|
ADD_TEST( api ),
|
||||||
test_kernel,
|
ADD_TEST( kernel ),
|
||||||
test_other_data_types,
|
ADD_TEST( other_data_types ),
|
||||||
test_memory_access,
|
ADD_TEST( memory_access ),
|
||||||
test_interop_user_sync,
|
ADD_TEST( interop_user_sync )
|
||||||
};
|
};
|
||||||
|
|
||||||
const char *basefn_names[] = {
|
const int test_num = ARRAY_SIZE(test_list);
|
||||||
"test_context_create",
|
|
||||||
"test_get_device_ids",
|
|
||||||
"test_api",
|
|
||||||
"test_kernel",
|
|
||||||
"test_other_data_types",
|
|
||||||
"test_memory_access",
|
|
||||||
"test_interop_user_sync",
|
|
||||||
};
|
|
||||||
|
|
||||||
ct_assert((sizeof(basefn_names) / sizeof(basefn_names[0])) == (sizeof(basefn_list) / sizeof(basefn_list[0])));
|
|
||||||
|
|
||||||
int num_fns = sizeof(basefn_names) / sizeof(char *);
|
|
||||||
|
|
||||||
clGetDeviceIDsFromDX9MediaAdapterKHR_fn clGetDeviceIDsFromDX9MediaAdapterKHR = NULL;
|
clGetDeviceIDsFromDX9MediaAdapterKHR_fn clGetDeviceIDsFromDX9MediaAdapterKHR = NULL;
|
||||||
clCreateFromDX9MediaSurfaceKHR_fn clCreateFromDX9MediaSurfaceKHR = NULL;
|
clCreateFromDX9MediaSurfaceKHR_fn clCreateFromDX9MediaSurfaceKHR = NULL;
|
||||||
@@ -207,16 +189,16 @@ bool CmdlineParse(int argc, const char *argv[])
|
|||||||
int main(int argc, const char *argv[])
|
int main(int argc, const char *argv[])
|
||||||
{
|
{
|
||||||
if (!CmdlineParse(argc, argv))
|
if (!CmdlineParse(argc, argv))
|
||||||
return 2;
|
return TEST_FAIL;
|
||||||
|
|
||||||
if (!DetectPlatformAndDevice())
|
if (!DetectPlatformAndDevice())
|
||||||
{
|
{
|
||||||
log_info("Test was not run, because the media surface sharing extension is not supported\n");
|
log_info("Test was not run, because the media surface sharing extension is not supported\n");
|
||||||
return TEST_NOT_SUPPORTED;
|
return TEST_SKIP;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!MediaSurfaceSharingExtensionInit())
|
if (!MediaSurfaceSharingExtensionInit())
|
||||||
return 2;
|
return TEST_FAIL;
|
||||||
|
|
||||||
return runTestHarness( argc, argv, num_fns, basefn_list, basefn_names, false, true, 0 );
|
return runTestHarness(argc, argv, test_num, test_list, false, true, 0);
|
||||||
}
|
}
|
||||||
|
|||||||
31
test_extensions/media_sharing/procs.h
Normal file
31
test_extensions/media_sharing/procs.h
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
//
|
||||||
|
// Copyright (c) 2019 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 __MEDIA_SHARING_PROCS_H__
|
||||||
|
#define __MEDIA_SHARING_PROCS_H__
|
||||||
|
|
||||||
|
|
||||||
|
extern int test_context_create(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
|
||||||
|
extern int test_get_device_ids(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
|
||||||
|
extern int test_api(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
|
||||||
|
extern int test_kernel(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
|
||||||
|
extern int test_other_data_types(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
|
||||||
|
extern int test_memory_access(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
|
||||||
|
extern int test_interop_user_sync(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
|
||||||
|
|
||||||
|
|
||||||
|
#endif // #ifndef __MEDIA_SHARING_PROCS_H__
|
||||||
Reference in New Issue
Block a user