diff --git a/test_conformance/api/test_clone_kernel.cpp b/test_conformance/api/test_clone_kernel.cpp index e3a57d0adb..540979c7df 100644 --- a/test_conformance/api/test_clone_kernel.cpp +++ b/test_conformance/api/test_clone_kernel.cpp @@ -831,7 +831,6 @@ int test_cloned_kernel_svm_ptr(cl_device_id deviceID, cl_context context, { test_fail("test_svm_ptr_helper failed for srcKernel.\n"); } - clSVMFree(context, svmPtr_srcKernel); // clone the srcKernel and set args clKernelWrapper cloneKernel_1 = clCloneKernel(srcKernel, &error); @@ -861,7 +860,6 @@ int test_cloned_kernel_svm_ptr(cl_device_id deviceID, cl_context context, test_fail("test_svm_ptr_helper failed for srcKernel with " "different values.\n"); } - clSVMFree(context, svmPtr_srcKernel_1); // enqueue - cloneKernel_1 again, to check if the args were not modified if (test_svm_enqueue_helper(context, queue, svmPtr_cloneKernel_1, @@ -871,7 +869,6 @@ int test_cloned_kernel_svm_ptr(cl_device_id deviceID, cl_context context, test_fail( "test_svm_enqueue_helper failed for cloneKernel_1 on retry.\n"); } - clSVMFree(context, svmPtr_cloneKernel_1); // enqueue - cloneKernel_2 again, to check if the args were not modified if (test_svm_enqueue_helper(context, queue, svmPtr_cloneKernel_2, @@ -881,10 +878,18 @@ int test_cloned_kernel_svm_ptr(cl_device_id deviceID, cl_context context, test_fail("test_svm_enqueue_helper failed for cloneKernel_2 on " "retry.\n"); } + + clSVMFree(context, svmPtr_srcKernel); + clSVMFree(context, svmPtr_srcKernel_1); + clSVMFree(context, svmPtr_cloneKernel_1); clSVMFree(context, svmPtr_cloneKernel_2); - } - return TEST_PASS; + return TEST_PASS; + } + else + { + return TEST_SKIPPED_ITSELF; + } } int test_clone_kernel(cl_device_id deviceID, cl_context context, @@ -913,7 +918,8 @@ int test_clone_kernel(cl_device_id deviceID, cl_context context, test_fail("clCloneKernel test_cloned_kernel_empty_args failed.\n"); } - if (test_cloned_kernel_svm_ptr(deviceID, context, queue, num_elements) != 0) + if (test_cloned_kernel_svm_ptr(deviceID, context, queue, num_elements) + == TEST_FAIL) { test_fail("clCloneKernel test_cloned_kernel_svm_ptr failed.\n"); }