Results 1 to 2 of 2

Thread: Does the OpenCL2.0 SVM support allocate memory for images?

  1. #1
    Newbie
    Join Date
    May 2014
    Posts
    2

    Does the OpenCL2.0 SVM support allocate memory for images?

    Does the OpenCL2.0 SVM support allocate memory for images?
    We can test the SVM performance like:

    d_a=(float*)clSVMAlloc(context,(CL_MEM_READ_WRITE| CL_MEM_SVM_FINE_GRAIN_BUFFER|CL_MEM_SVM_ATOMICS),s ize,0);
    d_b=(float*)clSVMAlloc(context,(CL_MEM_READ_WRITE| CL_MEM_SVM_FINE_GRAIN_BUFFER|CL_MEM_SVM_ATOMICS),s ize,0);
    d_c=(float*)clSVMAlloc(context,(CL_MEM_READ_WRITE| CL_MEM_SVM_FINE_GRAIN_BUFFER|CL_MEM_SVM_ATOMICS),s ize,0);
    for(int i=0;i<size;i++)
    {
    d_a[i]=Initial_value;
    d_b[i]=Initial_value;
    }
    clSetKernelArgSVMPointer(kernel, 0, d_a);
    clSetKernelArgSVMPointer(kernel, 0, d_b);
    clSetKernelArgSVMPointer(kernel, 0, d_c);


    The SVM performance has been verified good in the example of calculation of a vector,but the clSVMAlloc() cannot allocate memory for images,
    how should we do to utilize the SVM for image processing?
    Thank you!

  2. #2
    Senior Member
    Join Date
    Dec 2011
    Posts
    194
    There is an OpenCL 1.2 extension to create images from buffers (cl_khr_image2d_from_buffer). However, images created this way perform slightly differently compared to regular images due to the linear memory layout (instead of tiles).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •