Ask Your Question

Revision history [back]

SHARED memory between GpuMat and Mat

Hi all: Nice to meet you here.

    I want to use memory between GPU and CPU like:
    GpuMat gmat;
    Mat cmat;
    HostMem hostm = HostMem(640,480,CV_8CU3,SHARED);
    gmat = hostm.createGpuMatHeader();
    cmat = hostm.createMatHeader();

    But this failed in the later process of the GpuMat.can any one  tell me the reason?

    if I use the opencv samples gpumat,it works/
    Mat cmat();
    GpuMat gmat();
    //I thinks the function copyed the data to Device.

   1,So what is difference between upload and hostmem to shared memory?
   2,Does any one know how to use shared memory between CPU and GPU?