mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-21 06:49:02 +00:00
add system SVM testing via clSVMAllocWithProperties (#2516)
This PR adds system SVM testing both using driver APIs (`clSVMAllocWithPropertiesKHR`) and the system allocator directly (e.g. `malloc`). This is done by finding all of the SVM capabilities that are "system allocated" and duplicating them with a special "use system allocator" pseudo-capability. When the "use system allocator" pseudo-capability is not present, the system SVM type is treated the same as all other unified SVM types and is tested using driver APIs. When the "use system allocator" pseudo-capability is present, the system SVM type is allocated using the system allocator directly, though this also adds some limitations, for example the properties of the allocation may not be queried using `clGetSVMPointerInfoKHR`. See discussion in: https://github.com/KhronosGroup/OpenCL-Docs/issues/1446
This commit is contained in:
@@ -49,7 +49,7 @@ void CL_CALLBACK callback_svm_free(cl_command_queue queue,
|
||||
{
|
||||
data->svm_pointers[i] = svm_pointers[i];
|
||||
|
||||
if (data->svm_caps[i] & CL_SVM_CAPABILITY_SYSTEM_ALLOCATED_KHR)
|
||||
if (data->svm_caps[i] & PSEUDO_CAPABILITY_USE_SYSTEM_ALLOCATOR)
|
||||
{
|
||||
align_free(data);
|
||||
}
|
||||
@@ -169,13 +169,13 @@ struct UnifiedSVMFree : UnifiedSVMBase
|
||||
test_error(err, "test_SVMFree");
|
||||
}
|
||||
|
||||
// We need to filter out the SVM types that support system allocation
|
||||
// We need to filter out the SVM types that are system allocated
|
||||
// as we cannot test clEnqueueSVMFree without a callback for them
|
||||
std::vector<size_t> test_indexes;
|
||||
for (size_t i = 0; i < deviceUSVMCaps.size(); i++)
|
||||
{
|
||||
auto caps = deviceUSVMCaps[i];
|
||||
if (0 == (caps & CL_SVM_CAPABILITY_SYSTEM_ALLOCATED_KHR))
|
||||
if (0 == (caps & PSEUDO_CAPABILITY_USE_SYSTEM_ALLOCATOR))
|
||||
{
|
||||
test_indexes.push_back(i);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user