mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-22 15:19:02 +00:00
Synchronise with Khronos-private Gitlab branch
The maintenance of the conformance tests is moving to Github. This commit contains all the changes that have been done in Gitlab since the first public release of the conformance tests. Signed-off-by: Kevin Petit <kevin.petit@arm.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(MODULE_NAME SVM)
|
||||
|
||||
set(${MODULE_NAME}_SOURCES
|
||||
|
||||
@@ -226,7 +226,7 @@ cl_int create_cl_objects(cl_device_id device_from_harness, const char** ppCodeSt
|
||||
}
|
||||
|
||||
error = clGetDeviceInfo(devices[i], CL_DEVICE_SVM_CAPABILITIES, sizeof(cl_device_svm_capabilities), &caps, NULL);
|
||||
test_error(error,"clGetDeviceInfo failed for CL_DEVICE_MEM_SHARING");
|
||||
test_error(error,"clGetDeviceInfo failed for CL_DEVICE_SVM_CAPABILITIES");
|
||||
if(caps & (~(CL_DEVICE_SVM_COARSE_GRAIN_BUFFER | CL_DEVICE_SVM_FINE_GRAIN_BUFFER | CL_DEVICE_SVM_FINE_GRAIN_SYSTEM | CL_DEVICE_SVM_ATOMICS)))
|
||||
{
|
||||
log_error("clGetDeviceInfo returned an invalid cl_device_svm_capabilities value");
|
||||
|
||||
@@ -97,6 +97,10 @@ int test_allocate_shared_buffer(cl_device_id deviceID, cl_context context2, cl_c
|
||||
log_error("SVM pointer returned by clEnqueueMapBuffer doesn't match pointer returned by clSVMalloc");
|
||||
return -1;
|
||||
}
|
||||
err = clEnqueueUnmapMemObject(queues[0], buf, pBufData2, 0, NULL, NULL);
|
||||
test_error(err, "clEnqueueUnmapMemObject failed");
|
||||
err = clFinish(queues[0]);
|
||||
test_error(err, "clFinish failed");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,10 +17,15 @@
|
||||
#include "../../test_common/harness/mt19937.h"
|
||||
|
||||
#include <vector>
|
||||
#include <atomic>
|
||||
|
||||
#if !defined(_WIN32)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
cl_uint status;
|
||||
std::atomic<cl_uint> status;
|
||||
cl_uint num_svm_pointers;
|
||||
std::vector<void *> svm_pointers;
|
||||
} CallbackData;
|
||||
@@ -62,7 +67,7 @@ void CL_CALLBACK callback_svm_free(cl_command_queue queue, cl_uint num_svm_point
|
||||
clSVMFree(context, svm_pointers[i]);
|
||||
}
|
||||
|
||||
data->status = 1;
|
||||
data->status.store(1, std::memory_order_release);
|
||||
}
|
||||
|
||||
int test_enqueue_api(cl_device_id deviceID, cl_context c, cl_command_queue queue, int num_elements)
|
||||
@@ -231,7 +236,9 @@ int test_enqueue_api(cl_device_id deviceID, cl_context c, cl_command_queue queue
|
||||
test_error(error, "clFinish failed");
|
||||
|
||||
//wait for the callback
|
||||
while(data.status == 0) { }
|
||||
while(data.status.load(std::memory_order_acquire) == 0) {
|
||||
usleep(1);
|
||||
}
|
||||
|
||||
//check if number of SVM pointers returned in the callback matches with expected
|
||||
if (data.num_svm_pointers != buffers.size())
|
||||
|
||||
Reference in New Issue
Block a user