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.

Compiler/TMS320C6678: can I link .obj files compiled using different platforms into a single application (-p ti.runtime.openmp.platforms.evm6678 and -p ti.platforms.evm6678)?

Part Number: TMS320C6678
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI C/C++ Compiler

can I link .obj files compiled using different platforms into a single .out executable (-p ti.runtime.openmp.platforms.evm6678 and -p ti.platforms.evm6678)?

  • Hi,

    It depends your application. The ti.runtime.openmp.platforms.evm6678 has different memory layout, mainly for the MSMC, part of them are mapped to high address memory so you can set it as non-cached if needed. The rest MSMC is always cached. 

    You can look at the platform definitions for details:

    The ti.platforms.evm6678

    Regards, Eric

  • Thanks for the response ... 

    Please let me know how I can get to the above pages ? And if make those consistent would that allow me to link the before-mentioned platforms into a single .out file?

    Regards

  • Hi,

    In CCS, Project----->RTSC Tools---->Platform----->Edit/View----->Select your packages (this can be openMP or Sysbios or your own created platform, etc).

    Regards, Eric

  • Thanks a gain Eric, 

    I just need to give you a little bit of background on what I am trying to do. 

    Setting: We are compiling c files with --openmp  flags and also some c++ without --openmp. We use -p ti.runtime.openmp.platforms.evm6678 for both c and c++ and then we link everything together.

    The code runs just FINE WITHOUT any numerical and/or concurrency issue. 

    Problem: the problem is that it runs slower than when we use openmp with 8 threads.

    I have two questions given your valuable input.

    1) given the fact that openmp is not supported for C++ code do I need to compile the C++ code using the default platform -p ti.platforms.evm6678 or I better stick to -p ti.runtime.openmp.platforms.evm6678 as I do right now??

    2) Since we are using cfg file to define different sections for code, do I need to worry about platform configurations and other types of configuration ....

    If I can get the answer for the above question that would be great ...  I personally believe C OpenMP and C++ can be linked together as I did and it is perfectly working I just need to figure out little tips here and there to get good performance out of it.

    I really appreciate your comments.

    Regards

  • Hi,

    I saw there are other openMP issues in discussion and you are able to move forward. Please let me know if this thread is still needed?

    Regards, Eric

  • Hi,

    Sure sounds good. ...

    I just ran a simple comparison between the platforms (ti.runtime.openmp.platforms.evm6678 (no omp tag used) vs ti.platforms.evm6678) and it seems it runs ti.runtime.openmp.platforms.evm6678 runs slower ... Below is code.

    I hope it helps someone ... 

    Thanks for your comments

    
    
    #include <stdio.h>
    #include <c6x.h>
    #include <math.h>
    #if defined(USE_OPENMP11)
    #include <omp.h>
    #endif
    
    #include <xdc/std.h>
    #include <xdc/runtime/IHeap.h>
    #include <xdc/runtime/System.h>
    #include <xdc/runtime/Memory.h>
    #include <xdc/runtime/Error.h>
    #include <xdc/cfg/global.h>
    
    typedef unsigned long long dt_uint64;
    typedef char buff_datatype;
    //typedef short buff_datatype;
    //typedef int buff_datatype;
    //typedef float buff_datatype;
    //typedef double buff_datatype;
    //typedef long double buff_datatype;
    
    
    // buffer on MSMC
    #pragma DATA_SECTION( msmc_buff, ".msmc_bufSec" )
    #pragma DATA_ALIGN( msmc_buff, 128 )
    #define BUFLEN  (40*1024)
    buff_datatype msmc_buff[BUFLEN];
    
    // buffer on DDR3 allcoated from heap
    buff_datatype *ddr_buff;
    
    // external msmc heap
    extern const HeapBuf_Handle msmcHeap;
    buff_datatype *msmc_heap;
    
    int main(int argc, char* argv[]){
        printf("-= Program Started=- \n");
    
        TSCH = 0; TSCL = 0;
        dt_uint64 t_start, t_end;
    
        Error_Block eb;
        Error_init(&eb);
        int blockSize = 256;
    
        // NOOMP, Buffer on MSMC
        t_start = _itoll(TSCH, TSCL);
        for(int j = 0; j < BUFLEN; j++){
            msmc_buff[j] = 1+(msmc_buff[j]/2*3-50)/2*3-50;
        }
        t_end = _itoll(TSCH, TSCL);
        printf("NOOMP MSMC BUFF PROCESS TIME: %llu \n", t_end - t_start);
    
        ddr_buff = Memory_alloc(NULL, BUFLEN*sizeof(buff_datatype), 128, &eb);
    
        if (!ddr_buff){
            printf("Cannot allocate ddr_buff from heap \n");
            exit(1);
        }
    
        // NO-OMP, Buffer on DDR
        t_start = _itoll(TSCH, TSCL);
            for(int j = 0; j < BUFLEN; j++){
                ddr_buff[j] = 1+(ddr_buff[j]/2*3-50)/2*3-50;
            }
        t_end = _itoll(TSCH, TSCL);
        printf("NOOMP DDR BUFF PROCESS TIME: %llu \n", t_end - t_start);
    
    
        Memory_free(NULL, ddr_buff, BUFLEN*sizeof(buff_datatype));
    
        printf("-= Program Ended=- \n");
    }
    

  • Hi,

    I tried to compile your code by creating a SYSBIOS project with ti.platforms.evm6678. I had error: "../hello.c", line 46: error #20: identifier "HeapBuf_Handle" is undefined. Also I think you must have a .cfg file for this project. And the location for this ti.runtime.openmp.platforms.evm6678 is unclear for me.

    Let wait the OpenMP expert coming back for the performance issue.

    Regards, Eric