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.

OpenMP+OpenMP memory map on KeyStone II



Hi,

I was able to compile and run all the OpenMP+OpenMP examples from MCSDK-HPC on the KeyStone II EVM. I have a few questions about the memory map of the DSP in KeyStone II OpenMP+OpenMP model:

1) For C6678, the amount of cache and L2SRAM memory can be configured using the RTSC platform file. How can this be done on KeyStone II?

2) Is there a documentation on how to use/configure L2SRAM memory of C66x CorePac in KeyStone II for DMA transfers? Currently, I am going through the below links:
http://processors.wiki.ti.com/index.php/OpenMP_OpenCL_DSP_Heap_Management
http://processors.wiki.ti.com/index.php/OpenMP_Accelerator_Model_User%27s_Guide#local_map_type

For me, things were clear in terms of memory management and OpenMP on C6678 using CFG file and RTSC platform file. But I am not sure how to manage the DSP's internal memory with  the current OpenMP+OpenMP model in the KeyStone II.

Thank you in advance.

regards,

Barath Ramesh

  • "OpenMP+OpenMP examples from MCSDK-HPC", are you referring to openmpacc mode examples under MCSDK HPC 3.1.0.2? 

    It uses __TI_omp_device_alloc(). This will also give you an ARM host pointer to a buffer in CMEM. Operate on it as you like on ARM, then pass it into a target region. 

    Regards, Eric

     

  • Thanks for the reply. Yes, I am referring to openmpacc mode examples. I have another question on the API:

    Is __TI_omp_device_alloc() same as __malloc_ddr()?

    regards,

    Barath Ramesh

  • Hi Barath,

    Starting with version 1.0.0 of TI's OpenMP accelerator model runtime implementation, __TI_omp_device_alloc() has been replaced with __malloc_ddr().


    Dunni

  • Hi,

    Thanks for the clarification Dunni.

    Do I have to include header files/library while using __malloc_ddr()? I am using mcsdk-hpc 03_00_00_19 which I believe is the latest available for download.

    Also, what are the dependency header/library files for dynamic memory management API's for DSP's L2SRAM? http://processors.wiki.ti.com/index.php/OpenMP_OpenCL_DSP_Heap_Management only has code snippets but not the complete target C file.

    For example: If I try to declare the function prototype extern void *__malloc_l2 (size_t size) inside #pragma omp declare target section, the linker cannot find __malloc_l2(). Am I doing it incorrectly?


    Thanks for all the help.

    regards,

    Barath Ramesh

  • Hi Barath,

    MCSDK-HPC  03_00_00_19 is shipped with version 0.3.3 of TI's OpenMP accelerator model runtime implementation. This version supports __TI_omp_device_alloc(), not __malloc_ddr()/__malloc_l2(). The latter API are introduced in version 1.0.

    The dotprod example shows how __TI_omp_device_alloc() is used to allocate a buffer in CMEM.

    Regards,

    Dunni

  • Hi,

    Thanks for the clarification Dunni. Also, is MCSDK-HPC_03_00_00_19 the latest version available for download?

    I was able to assign memory in the DSP's L2SRAM using local map type. But the example code snippet allocates buffer only in one core (C66x core0). How do I allocate  buffers in L2SRAM of all the 8 DSP cores using this memory map type? 

    Also, how can the same be extended to the EDMA example for openmpacc? I would like to have EDMA handles for all 8 DSP cores and initiate transfers to from DDR3 for all 8 cores.


    Thanks for all the help.

    regards,

    Barath Ramesh

  • Hi Barath,

    If you want all the cores to participate in executing the code, then you will need to create a parallel region within the target region. The local map type will map variables to level 2 SRAM for all 8 DSP cores.

    If you want initiate EDMA transfers from all 8 DSP cores, modify your code as follows:

    #pragma omp target map ...

    {

      #pragma omp parallel //Add this directive to create a parallel region

      {

          //current  target region

       }

    }

    You can look at most of the examples to see how to use other OpenMP constructs within target regions. The vecadd and printf_debug examples are good starting points.

    MCSDK-HPC 3_00_00_19 is the latest version available for download for EVM users. A new version should be available soon, but I do not have a precise release date.

    Thanks,

    Dunni