Generic Address Space: Skip tests utlilising SVM on devices that do n… (#712)

* Harness: Added an option for a test to skip itself.

New condtion in callSingleTestFunction. This allows a test to return TEST_SKIP if the device does not support the requested test.

* Split generic_ptr_to_host_mem into two tests.

The old generic_ptr_to_host_mem test tests two different device capabilities (SVM and not SVM). This is a prerequisite for the following commit.

* Generic Address Space: Skip tests utlilising SVM on devices that do not support SVM.

Where a device does not support SVM, do not run the generic address space test(s) that rely on SVM.
This commit is contained in:
Jeremy Kemp
2020-03-27 12:38:30 +00:00
committed by GitHub
parent 540d1175c7
commit 5e84ad0c19
5 changed files with 76 additions and 56 deletions

View File

@@ -36,4 +36,49 @@ namespace common {
NL " return false;"
NL "}"
NL;
static std::string GLOBAL_KERNEL_FUNCTION = CONFORMANCE_VERIFY_FENCE +
NL
NL "bool helperFunction(uint *ptr, uint tid) {"
NL " if (!isFenceValid(get_fence(ptr)))"
NL " return false;"
NL
NL " if (*ptr != tid)"
NL " return false;"
NL
NL " return true;"
NL "}"
NL
NL "__kernel void testKernel(__global uint *results, __global uint *buf) {"
NL " uint tid = get_global_id(0);"
NL
NL " results[tid] = helperFunction(&buf[tid], tid);"
NL "}"
NL;
static std::string LOCAL_KERNEL_FUNCTION = CONFORMANCE_VERIFY_FENCE +
NL
NL "bool helperFunction(uint *ptr, uint tid) {"
NL " if (!isFenceValid(get_fence(ptr)))"
NL " return false;"
NL
NL " if (*ptr != tid)"
NL " return false;"
NL
NL " return true;"
NL "}"
NL
NL "__kernel void testKernel(__global uint *results, __local uint *buf) {"
NL " uint tid = get_global_id(0);"
NL " if (get_local_id(0) == 0) {"
NL " for (uint i = 0; i < get_local_size(0); ++i) {"
NL " uint idx = get_local_size(0) * get_group_id(0) + i;"
NL " buf[idx] = idx;"
NL " }"
NL " }"
NL
NL " work_group_barrier(CLK_LOCAL_MEM_FENCE);"
NL " results[tid] = helperFunction(&buf[tid], tid);"
NL "}"
NL;
}