Testing Existing SVM APIs remaining APIs tests (#2441)

Tests for the following APIs:
* clEnqueueSVMMemcpy
* clEnqueueSVMMemFill
* clEnqueueSVMMap/clEnqueueSVMUnMap
* clEnqueueSVMMigrateMem
* clEnqueueSVMMemFree
* clSetKernelArgSVMPointer
* clSetKernelExecInfo

---------

Signed-off-by: John Kesapides <john.kesapides@arm.com>
This commit is contained in:
John Kesapides
2025-07-22 18:19:20 +01:00
committed by GitHub
parent 69dc9d4d8f
commit b646ba5cae
10 changed files with 1657 additions and 1 deletions

View File

@@ -23,6 +23,7 @@
#include "harness/typeWrappers.h"
#include <vector>
#include <string>
#include <algorithm>
#if (defined(_WIN32) || defined(_WIN64)) && defined(_MSC_VER)
#include <windows.h>
@@ -85,5 +86,25 @@ extern cl_int create_cl_objects(cl_device_id device_from_harness, const char** p
extern const char *linked_list_create_and_verify_kernels[];
static inline cl_int check_event_type(cl_event event,
cl_command_type expectedCommandType)
{
cl_command_type commandType;
cl_int error = clGetEventInfo(event, CL_EVENT_COMMAND_TYPE,
sizeof(cl_command_type), &commandType, NULL);
test_error(error, "clGetEventInfo failed");
return commandType == expectedCommandType ? CL_SUCCESS : CL_INVALID_VALUE;
}
static inline void generate_random_inputs(std::vector<cl_uchar> &v, MTdata d)
{
auto random_generator = [&d]() {
return static_cast<cl_uchar>(genrand_int32(d));
};
std::generate(v.begin(), v.end(), random_generator);
}
#endif // #ifndef __COMMON_H__