This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

66AK2H12 - Not able to allocate memory in MSMC

Hi,

I'm developing gaussian blur implementation using TI OpenCL in Keystone 2. I'm trying to offload the computation to DSPs for this I require to efficiently access the data from the DSP hence I'm trying to use the MSMC for allocating the memory, but I'm facing an issue. I'm trying to allocate 32x32 array in MSMC which can be accessed by DSP, by using the below code

d_A = clCreateBuffer(context, CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR | CL_MEM_USE_MSMC_TI, mem_size_A, h_A, &err);

when I print the address returned by clCreateBuffer it prints address of DDR (0xbea1214c). The CL_MEM_USE_MSMC_TI has no effect in memory allocation as described in the TI OpenCL documentation. Is there something missing?


Regards

Faizan

  • Hi Faizan,

    The address you saw is probably the virtual address of the buffer data structure in linux address space. It is not the real physical address of the buffer memory. OpenCL runtime does not provide an API to print physical address of a buffer's memory.

    What you can do instead is to print out the physical address from within the kernel on the DSP side. For example you can write a simple kernel and pass your buffer to it, for debugging purpose.

    - Yuan

    Sample kernel:
    __kernel __attribute__((reqd_work_group_size(1,1,1))) void printBufAddr(__global char *a) { printf("bufAddr = %p\n", a); }

    Then in your OpenCL app, simple pass your buffer as the argument and enqueue the kernel:
    Kernel k(program, "printBufAddr");
    k.setArg(0, d_A);
    q.enqueueTask(k);