Migrate integer_ops suite to the new test registration framework (#2332)

Contributes to https://github.com/KhronosGroup/OpenCL-CTS/issues/2181.

Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>
This commit is contained in:
Michael Rizkalla
2025-03-23 15:12:34 +00:00
committed by GitHub
parent a9507ce33f
commit e36da9798e
19 changed files with 399 additions and 599 deletions

View File

@@ -13,7 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
#include "harness/compat.h"
#include "testBase.h"
#include <stdio.h>
#include <string.h>
@@ -23,9 +23,6 @@
#include <algorithm>
#include <cinttypes>
#include "procs.h"
static int verify_addsat_char( const cl_char *inA, const cl_char *inB, const cl_char *outptr, int n, const char *sizeName, int vecSize )
{
int i;
@@ -185,7 +182,7 @@ static const int vector_sizes[] = {1, 2, 3, 4, 8, 16};
static const char *vector_size_names[] = { "", "2", "3", "4", "8", "16" };
static const size_t kSizes[8] = { 1, 1, 2, 2, 4, 4, 8, 8 };
int test_integer_add_sat(cl_device_id device, cl_context context, cl_command_queue queue, int n_elems)
REGISTER_TEST(integer_add_sat)
{
cl_int *input_ptr[2], *output_ptr, *p;
int err;
@@ -195,7 +192,7 @@ int test_integer_add_sat(cl_device_id device, cl_context context, cl_command_que
MTdata d;
int fail_count = 0;
size_t length = sizeof(cl_int) * 4 * n_elems;
size_t length = sizeof(cl_int) * 4 * num_elements;
input_ptr[0] = (cl_int*)malloc(length);
input_ptr[1] = (cl_int*)malloc(length);
@@ -203,11 +200,9 @@ int test_integer_add_sat(cl_device_id device, cl_context context, cl_command_que
d = init_genrand( gRandomSeed );
p = input_ptr[0];
for (i=0; i<4 * n_elems; i++)
p[i] = genrand_int32(d);
for (i = 0; i < 4 * num_elements; i++) p[i] = genrand_int32(d);
p = input_ptr[1];
for (i=0; i<4 * n_elems; i++)
p[i] = genrand_int32(d);
for (i = 0; i < 4 * num_elements; i++) p[i] = genrand_int32(d);
free_mtdata(d); d = NULL;
for( type = 0; type < sizeof( test_str_names ) / sizeof( test_str_names[0] ); type++ )
@@ -376,5 +371,3 @@ int test_integer_add_sat(cl_device_id device, cl_context context, cl_command_que
return err;
}