mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-20 06:29:02 +00:00
* Improve Functionality of Harness In the harness we previously were able to determine whether or not a device supports the half or double data types, but doing so required unintuitive function calls and would need to be repeated per test. A new pair of functions have been added which clearly state what they do, and makes it easier to determine whether or not a device supports the types. Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com> * Remove Old GetKernelArgInfo Tests (#522) In the API test suite we have 2 versions which test the clGetKernelArgInfo API. As part of this ticket we are redesigning the implementation of this test. This change removes all of the old code and makes it so that the tests simply pass. A later commit will add the redesigned test Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com> * Redesign GetKernelArgInfo (#522) The previous test for this API consisted of 5K+ lines of code which would define the test kernels and the expected outputs from this API. This redesign instead generates the kernels and expected outputs leading to incresased maintanability and a significantly reduce line-of-code count. Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com> * [SQUASH] Address Review Comments This commit does the following: 1) Update the Copyright to 2021 2) Fixes a typo in a comment 3) Explicitly declares a vector variable (previously auto) 4) Output subtest result after completion rather than all of them at the end Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com> * [SQUASH] Ensure Kernel Arguments do not exceed CL_DEVICE_MAX_PARAMETER_SIZE As per upstream comments, this change ensures that the total size of parameters passed into a kernel does not exceed the limit specified by CL_DEVICE_MAX_PARAMETER_SIZE for the device used. Additionally this change replaces ASSERT_SUCCESS() with test_error() as per upstream requests. Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com> * [SQUASH] Address Image and Vector Failures This change aligns vector 3 types to be sized 4. Additionally it ensures that image arguments do not have the address space qualifier specified because they are by default in the __global space. Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com> * [SQUASH] Ensure that the size of pipe arguments are correct As mentioned in PR comments, the test previously assumed that sizeof(char) == sizeof(pipe char). The Clang implementation treats a pipe to take the same size as a pointer, which is now reflected in the code. Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com> * [SQUASH] Ensure that CL_DEVICE_MAX_PIPE_ARGS is not Exceeded This commit refactors the code so that Pipes are handled separately. Additionally, it removes signed char and char signed as scalar types to test and removes some redundent code for modifiying the expected type when processing unsigned scalar types. Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com> * [SQUASH] Remove compatibility test from skip-list There is a list of tests which should be skipped when using an offline compiler. As get_kernel_arg_compatibility has been removed, it should also be removed here. Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com> * [SQUASH] Disable Pipe Tests This change disables the Pipe tests for clGetKernelArgInfo as pipe metadata is not accurately reported on clang which leads to the pipe tests failing. Signed-off-by: Chetankumar Mistry <chetan.mistry@arm.com>
158 lines
5.6 KiB
C++
158 lines
5.6 KiB
C++
//
|
|
// Copyright (c) 2017 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
|
|
|
|
// FIXME: To use certain functions in harness/imageHelpers.h
|
|
// (for example, generate_random_image_data()), the tests are required to
|
|
// declare the following variables (<rdar://problem/11111245>):
|
|
|
|
test_definition test_list[] = {
|
|
ADD_TEST(get_platform_info),
|
|
ADD_TEST_VERSION(get_sampler_info, Version(2, 0)),
|
|
ADD_TEST(get_sampler_info_compatibility),
|
|
ADD_TEST_VERSION(get_command_queue_info, Version(2, 0)),
|
|
ADD_TEST(get_command_queue_info_compatibility),
|
|
ADD_TEST(get_context_info),
|
|
ADD_TEST(get_device_info),
|
|
ADD_TEST(enqueue_task),
|
|
ADD_TEST(binary_get),
|
|
ADD_TEST(binary_create),
|
|
ADD_TEST(kernel_required_group_size),
|
|
|
|
ADD_TEST(release_kernel_order),
|
|
ADD_TEST(release_during_execute),
|
|
|
|
ADD_TEST(load_single_kernel),
|
|
ADD_TEST(load_two_kernels),
|
|
ADD_TEST(load_two_kernels_in_one),
|
|
ADD_TEST(load_two_kernels_manually),
|
|
ADD_TEST(get_program_info_kernel_names),
|
|
ADD_TEST(get_kernel_arg_info),
|
|
ADD_TEST(create_kernels_in_program),
|
|
ADD_TEST(get_kernel_info),
|
|
ADD_TEST(kernel_private_memory_size),
|
|
ADD_TEST(execute_kernel_local_sizes),
|
|
ADD_TEST(set_kernel_arg_by_index),
|
|
ADD_TEST(set_kernel_arg_constant),
|
|
ADD_TEST(set_kernel_arg_struct_array),
|
|
ADD_TEST(kernel_global_constant),
|
|
|
|
ADD_TEST(min_max_thread_dimensions),
|
|
ADD_TEST(min_max_work_items_sizes),
|
|
ADD_TEST(min_max_work_group_size),
|
|
ADD_TEST(min_max_read_image_args),
|
|
ADD_TEST(min_max_write_image_args),
|
|
ADD_TEST(min_max_mem_alloc_size),
|
|
ADD_TEST(min_max_image_2d_width),
|
|
ADD_TEST(min_max_image_2d_height),
|
|
ADD_TEST(min_max_image_3d_width),
|
|
ADD_TEST(min_max_image_3d_height),
|
|
ADD_TEST(min_max_image_3d_depth),
|
|
ADD_TEST(min_max_image_array_size),
|
|
ADD_TEST(min_max_image_buffer_size),
|
|
ADD_TEST(min_max_parameter_size),
|
|
ADD_TEST(min_max_samplers),
|
|
ADD_TEST(min_max_constant_buffer_size),
|
|
ADD_TEST(min_max_constant_args),
|
|
ADD_TEST(min_max_compute_units),
|
|
ADD_TEST(min_max_address_bits),
|
|
ADD_TEST(min_max_single_fp_config),
|
|
ADD_TEST(min_max_double_fp_config),
|
|
ADD_TEST(min_max_local_mem_size),
|
|
ADD_TEST(min_max_kernel_preferred_work_group_size_multiple),
|
|
ADD_TEST(min_max_execution_capabilities),
|
|
ADD_TEST(min_max_queue_properties),
|
|
ADD_TEST(min_max_device_version),
|
|
ADD_TEST(min_max_language_version),
|
|
|
|
ADD_TEST(kernel_arg_changes),
|
|
ADD_TEST(kernel_arg_multi_setup_random),
|
|
|
|
ADD_TEST(native_kernel),
|
|
|
|
ADD_TEST(create_context_from_type),
|
|
|
|
ADD_TEST(platform_extensions),
|
|
ADD_TEST(get_platform_ids),
|
|
ADD_TEST(bool_type),
|
|
|
|
ADD_TEST(repeated_setup_cleanup),
|
|
|
|
ADD_TEST(retain_queue_single),
|
|
ADD_TEST(retain_queue_multiple),
|
|
ADD_TEST(retain_mem_object_single),
|
|
ADD_TEST(retain_mem_object_multiple),
|
|
ADD_TEST(retain_mem_object_set_kernel_arg),
|
|
ADD_TEST(min_data_type_align_size_alignment),
|
|
|
|
ADD_TEST_VERSION(context_destructor_callback, Version(3, 0)),
|
|
ADD_TEST(mem_object_destructor_callback),
|
|
ADD_TEST(null_buffer_arg),
|
|
ADD_TEST(get_buffer_info),
|
|
ADD_TEST(get_image2d_info),
|
|
ADD_TEST(get_image3d_info),
|
|
ADD_TEST(get_image1d_info),
|
|
ADD_TEST(get_image1d_array_info),
|
|
ADD_TEST(get_image2d_array_info),
|
|
ADD_TEST(queue_flush_on_release),
|
|
ADD_TEST(queue_hint),
|
|
ADD_TEST(queue_properties),
|
|
ADD_TEST_VERSION(sub_group_dispatch, Version(2, 1)),
|
|
ADD_TEST_VERSION(clone_kernel, Version(2, 1)),
|
|
ADD_TEST_VERSION(zero_sized_enqueue, Version(2, 1)),
|
|
|
|
ADD_TEST_VERSION(buffer_properties_queries, Version(3, 0)),
|
|
ADD_TEST_VERSION(image_properties_queries, Version(3, 0)),
|
|
ADD_TEST_VERSION(queue_properties_queries, Version(3, 0)),
|
|
ADD_TEST_VERSION(pipe_properties_queries, Version(3, 0)),
|
|
|
|
ADD_TEST_VERSION(consistency_svm, Version(3, 0)),
|
|
ADD_TEST_VERSION(consistency_memory_model, Version(3, 0)),
|
|
ADD_TEST_VERSION(consistency_device_enqueue, Version(3, 0)),
|
|
ADD_TEST_VERSION(consistency_pipes, Version(3, 0)),
|
|
ADD_TEST_VERSION(consistency_progvar, Version(3, 0)),
|
|
ADD_TEST_VERSION(consistency_non_uniform_work_group, Version(3, 0)),
|
|
ADD_TEST_VERSION(consistency_read_write_images, Version(3, 0)),
|
|
ADD_TEST_VERSION(consistency_2d_image_from_buffer, Version(3, 0)),
|
|
ADD_TEST_VERSION(consistency_depth_images, Version(3, 0)),
|
|
ADD_TEST_VERSION(consistency_device_and_host_timer, Version(3, 0)),
|
|
ADD_TEST_VERSION(consistency_il_programs, Version(3, 0)),
|
|
ADD_TEST_VERSION(consistency_subgroups, Version(3, 0)),
|
|
ADD_TEST_VERSION(consistency_prog_ctor_dtor, Version(3, 0)),
|
|
ADD_TEST_VERSION(consistency_3d_image_writes, Version(3, 0)),
|
|
|
|
ADD_TEST(min_image_formats),
|
|
ADD_TEST(negative_get_platform_info),
|
|
ADD_TEST(negative_get_platform_ids),
|
|
};
|
|
|
|
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);
|
|
}
|