mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +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>
This commit is contained in:
@@ -86,3 +86,15 @@ std::string get_device_name(cl_device_id device)
|
||||
{
|
||||
return get_device_info_string(device, CL_DEVICE_NAME);
|
||||
}
|
||||
|
||||
size_t get_max_param_size(cl_device_id device)
|
||||
{
|
||||
size_t ret(0);
|
||||
if (clGetDeviceInfo(device, CL_DEVICE_MAX_PARAMETER_SIZE, sizeof(ret), &ret,
|
||||
nullptr)
|
||||
!= CL_SUCCESS)
|
||||
{
|
||||
throw std::runtime_error("clGetDeviceInfo failed\n");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -42,4 +42,8 @@ std::string get_device_version_string(cl_device_id device);
|
||||
|
||||
/* Returns a string containing the device name. */
|
||||
std::string get_device_name(cl_device_id device);
|
||||
|
||||
// Returns the maximum size in bytes for Kernel Parameters
|
||||
size_t get_max_param_size(cl_device_id device);
|
||||
|
||||
#endif // _deviceInfo_h
|
||||
|
||||
@@ -623,7 +623,6 @@ cl_int OutputBuildLogs(cl_program program, cl_uint num_devices,
|
||||
|
||||
const char *subtests_to_skip_with_offline_compiler[] = {
|
||||
"get_kernel_arg_info",
|
||||
"get_kernel_arg_info_compatibility",
|
||||
"binary_create",
|
||||
"load_program_source",
|
||||
"load_multistring_source",
|
||||
|
||||
@@ -1756,3 +1756,26 @@ bool poll_until(unsigned timeout_ms, unsigned interval_ms,
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool device_supports_double(cl_device_id device)
|
||||
{
|
||||
if (is_extension_available(device, "cl_khr_fp64"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
cl_device_fp_config double_fp_config;
|
||||
cl_int err = clGetDeviceInfo(device, CL_DEVICE_DOUBLE_FP_CONFIG,
|
||||
sizeof(double_fp_config),
|
||||
&double_fp_config, nullptr);
|
||||
test_error(err,
|
||||
"clGetDeviceInfo for CL_DEVICE_DOUBLE_FP_CONFIG failed");
|
||||
return double_fp_config != 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool device_supports_half(cl_device_id device)
|
||||
{
|
||||
return is_extension_available(device, "cl_khr_fp16");
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ cl_device_fp_config get_default_rounding_mode(cl_device_id device);
|
||||
}
|
||||
|
||||
#define PASSIVE_REQUIRE_FP16_SUPPORT(device) \
|
||||
if (!is_extension_available(device, "cl_khr_fp16")) \
|
||||
if (!device_supports_half(device)) \
|
||||
{ \
|
||||
log_info( \
|
||||
"\n\tNote: device does not support fp16. Skipping test...\n"); \
|
||||
@@ -208,4 +208,10 @@ bool device_supports_cl_c_version(cl_device_id device, Version version);
|
||||
bool poll_until(unsigned timeout_ms, unsigned interval_ms,
|
||||
std::function<bool()> fn);
|
||||
|
||||
// Checks whether the device supports double data types
|
||||
bool device_supports_double(cl_device_id device);
|
||||
|
||||
// Checks whether the device supports half data types
|
||||
bool device_supports_half(cl_device_id device);
|
||||
|
||||
#endif // _kernelHelpers_h
|
||||
|
||||
@@ -21,7 +21,6 @@ set(${MODULE_NAME}_SOURCES
|
||||
test_device_min_data_type_align_size_alignment.cpp
|
||||
test_platform.cpp
|
||||
test_kernel_arg_info.cpp
|
||||
test_kernel_arg_info_compatibility.cpp
|
||||
test_null_buffer_arg.cpp
|
||||
test_mem_object_info.cpp
|
||||
test_min_image_formats.cpp
|
||||
|
||||
@@ -51,7 +51,6 @@ test_definition test_list[] = {
|
||||
ADD_TEST(load_two_kernels_manually),
|
||||
ADD_TEST(get_program_info_kernel_names),
|
||||
ADD_TEST(get_kernel_arg_info),
|
||||
ADD_TEST(get_kernel_arg_info_compatibility),
|
||||
ADD_TEST(create_kernels_in_program),
|
||||
ADD_TEST(get_kernel_info),
|
||||
ADD_TEST(kernel_private_memory_size),
|
||||
|
||||
@@ -119,7 +119,6 @@ extern int test_get_image1d_info( cl_device_id deviceID, cl_context context
|
||||
extern int test_get_image1d_array_info( cl_device_id deviceID, cl_context context, cl_command_queue ignoreQueue, int num_elements );
|
||||
extern int test_get_image2d_array_info( cl_device_id deviceID, cl_context context, cl_command_queue ignoreQueue, int num_elements );
|
||||
extern int test_get_kernel_arg_info( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
|
||||
extern int test_get_kernel_arg_info_compatibility( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
|
||||
extern int test_queue_hint(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
|
||||
extern int test_sub_group_dispatch(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
|
||||
extern int test_clone_kernel(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user