[Beignet] How to allocate SVM

Sami Pietilä sami.pietila at gmail.com
Thu Feb 22 08:47:02 UTC 2018


Hi,

I have Skylake (and Broadwell) CPU and I am running beignet 1.3 platform. I
have checked that device capabilities has CL_DEVICE_SVM_FINE_GRAIN_BUFFER
flag.

Following code gives CL_INVALID_VALUE. Even removing CL_MEM_SVM_ATOMICS
does not help. What could be wrong with the code? Additionally, how to the
same SVM reservation by OpenCL C++ bindings (cl2.hpp)?

size_t SVM_size = 42;

void* p = clSVMAlloc (
context(),
CL_MEM_READ_WRITE | CL_MEM_SVM_FINE_GRAIN_BUFFER | CL_MEM_SVM_ATOMICS,
SVM_size,
0);

cl_int err = clEnqueueSVMMap(queue(), CL_TRUE, CL_MAP_READ | CL_MAP_WRITE,
p, SVM_size, 0, NULL, NULL);

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/beignet/attachments/20180222/7d3381e3/attachment.html>


More information about the Beignet mailing list