From d3eba8571a6caeb79a6d65fad15a151374919917 Mon Sep 17 00:00:00 2001 From: Ben Ashbaugh Date: Fri, 31 Jul 2020 05:10:05 -0700 Subject: [PATCH] add OpenCL 3.0 test for CL_COMMAND_SVM_MIGRATE_MEM (#856) --- test_conformance/SVM/test_migrate.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test_conformance/SVM/test_migrate.cpp b/test_conformance/SVM/test_migrate.cpp index 3a39eaea..2a1ce051 100644 --- a/test_conformance/SVM/test_migrate.cpp +++ b/test_conformance/SVM/test_migrate.cpp @@ -199,6 +199,24 @@ int test_svm_migrate(cl_device_id deviceID, cl_context c, cl_command_queue queue error = clFlush(queues[1]); test_error(error, "clFlush failed"); + // Check the event command type for clEnqueueSVMMigrateMem (OpenCL 3.0 and + // newer) + Version version = get_device_cl_version(deviceID); + if (version >= Version(3, 0)) + { + cl_command_type commandType; + error = clGetEventInfo(evs[3], CL_EVENT_COMMAND_TYPE, + sizeof(commandType), &commandType, NULL); + test_error(error, "clGetEventInfo failed"); + if (commandType != CL_COMMAND_SVM_MIGRATE_MEM) + { + log_error("Invalid command type returned for " + "clEnqueueSVMMigrateMem: %X\n", + commandType); + return TEST_FAIL; + } + } + error = wait_and_release("first batch", evs, 8); if (error) return -1;