What is the difference between SVM and CL::buffer

hi,

I am not sure if the topic tittle is the ritgh one. I used to do the following procces with openCL on Android.

  1. i create the platform,queu,devive. Create all my cl::buffer and compile all the kernel at the start of my application.

  2. i get picture from my camera and send the byte data using JNI jbyteArray =>((uint8_t*)inPtr) to my c++ function.

  3. i get the (uint8_t*)inPtr pointer than i use cl::buffer to feed the buffer with the camera picture data, using :
    bufferNV21 = cl::Buffer(gContext, CL_MEM_READ_ONLY|CL_MEM_USE_HOST_PTR , isize*sizeof(cl_uchar), inPtr , NULL); this take less than 1ms.

  4. i process my kernel NV21toRGB than i do some staff with my output buffer.

  5. i use enqueueMapBuffer to point the Buffer,buf, to my local program memory and that wil be used by pthread CPU processing. take less than 2ms

  6. than i copy back the CPU result to the GPU buffer doing:
    bufferligne = cl::Buffer(gContext, CL_MEM_USE_HOST_PTR, (1024*1024)*sizeof(cl_uchar4), buf, NULL); // remplace enqueueWriteBuffer.
    this take less than 3ms

  7. do some kernel on bufferligne cl::buffer

  8. then send back the GPU buffer(bufferMMM) to Java out bitmap using
    gQueue.enqueueReadBuffer(bufferMMM, CL_TRUE, 0, osize*sizeof(cl_uchar4), out, 0, &arraySecondEvent); // pour openCL
    this last part take between 3 and 5ms, depends. Sometime less.

So what should i change if i want to use SVM. Change at step 3,5,7 or 8.

And what does SVM that cl::buffer does not. I would like to anderstand Why to use SVM. Where are the improvement. Because that i am sure is that i lost a lot of time not really in the kernel speed, i improved the speed by using on the kernel .cl file

#pragma OPENCL EXTENSION cl_khr_priority_hints : enable // accelere openCL queue driver
#pragma OPENCL EXTENSION CL_QUEUE_PRIORITY_HIGH_KHR : enable

and on the .cpp

// Optional extension support
#define CL_HPP_USE_IL_KHR
#define CL_HPP_USE_CL_SUB_GROUPS_KHR
#define CL_HPP_OPENCL_API_WRAPPER

But i lost a lot of time using CPU pthread on the xiaomi. So it is may be why SVM could improve. I am not sure if it is an OpenCL problem or Pthread problem on the médiatek processor.

regards and thanks for help.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.