- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I see in the release notes for v15 update 2, that "Adds OpenCL Shared Virtual Memory (SVM) application programming interface (API) support to emulation" - so apparently it is supported in general. I cannot seem to be able to find in any documentation anything about SVM, how to use the SVM functions etc. (it appears that in CL/cl_ext.h there are functions like clSetKernelArgSVMPointerAltera()). I cannot get them to work - i.e., successfully compile. Can someone shed some light or provide any documentation with more details on SVM and how to get it work? Thanks! ~~~ EDIT: Partially answering my question. So, it seems that the following SMV-related functions are available (it is pretty much what OpenCL 2.0 supports, BUT you need to add the "Altera" suffix, so their arguments list, return types, errors, etc. should be what you can see for the corresponding OpenCL 2.0 functions): clEnqueueSVMFreeAltera clEnqueueSVMMapAltera clEnqueueSVMMemFillAltera clEnqueueSVMMemcpyAltera clEnqueueSVMUnmapAltera clSVMAllocAltera clSVMFreeAltera clSetKernelArgSVMPointerAltera In order to use SVM your allocations have to be aligned, in my case at least 1024 - CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE shows 1024. Then use the clSetKernelArgSVMPointerAltera() to set the SVM pointer argument.int *test_arr=(int *)memalign(1024, sizeof(cl_int)*32);
...
clSetKernelArgSVMPointerAltera(kernel, 1, test_arr);
The kernel argument and use within the kernel is as with any global memory pointer. Since, fine-grained system SVM is supported there is no need for map/unmaps, nor for explicit clSVMAllocPointerAltera() - at least to my understanding :)
Link Copied
0 Replies

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page