mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-23 15:39:03 +00:00
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:
@@ -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__
|
||||
|
||||
|
||||
Reference in New Issue
Block a user