Migrate basic suite to the new test registration framework (#2316)

Contributes to #2181.

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
This commit is contained in:
Ahmed Hesham
2025-03-18 17:32:58 +00:00
committed by GitHub
parent b39eff86c5
commit e88e5be93e
64 changed files with 443 additions and 929 deletions

View File

@@ -13,8 +13,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
#include "../../test_common/harness/compat.h"
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
@@ -22,8 +20,7 @@
#include <sys/stat.h>
#include <sys/types.h>
#include "../../test_common/harness/conversions.h"
#include "procs.h"
#include "testBase.h"
static const char *async_global_to_local_kernel2D = R"OpenCLC(
#pragma OPENCL EXTENSION cl_khr_extended_async_copies : enable
@@ -113,10 +110,11 @@ __kernel void test_fn(const __global VarSizeStruct *src, __global VarSizeStruct
};
)OpenCLC";
int test_copy2D(const cl_device_id deviceID, const cl_context context,
const cl_command_queue queue, const char *const kernelCode,
const size_t elementSize, const int srcMargin,
const int dstMargin, const bool localIsDst)
static int test_copy2D(const cl_device_id deviceID, const cl_context context,
const cl_command_queue queue,
const char *const kernelCode, const size_t elementSize,
const int srcMargin, const int dstMargin,
const bool localIsDst)
{
int error;
@@ -388,9 +386,9 @@ int test_copy2D(const cl_device_id deviceID, const cl_context context,
return failuresPrinted ? -1 : 0;
}
int test_copy2D_all_types(cl_device_id deviceID, cl_context context,
cl_command_queue queue, const char *kernelCode,
bool localIsDst)
static int test_copy2D_all_types(cl_device_id deviceID, cl_context context,
cl_command_queue queue, const char *kernelCode,
bool localIsDst)
{
const unsigned int elemSizes[] = { 1, 2, 3, 4, 5, 6, 7,
8, 13, 16, 32, 47, 64 };
@@ -430,16 +428,14 @@ int test_copy2D_all_types(cl_device_id deviceID, cl_context context,
return errors ? -1 : 0;
}
int test_async_copy_global_to_local2D(cl_device_id deviceID, cl_context context,
cl_command_queue queue, int num_elements)
REGISTER_TEST(async_copy_global_to_local2D)
{
return test_copy2D_all_types(deviceID, context, queue,
return test_copy2D_all_types(device, context, queue,
async_global_to_local_kernel2D, true);
}
int test_async_copy_local_to_global2D(cl_device_id deviceID, cl_context context,
cl_command_queue queue, int num_elements)
REGISTER_TEST(async_copy_local_to_global2D)
{
return test_copy2D_all_types(deviceID, context, queue,
return test_copy2D_all_types(device, context, queue,
async_local_to_global_kernel2D, false);
}