ashwinktpu / StarPlat

17 stars 19 forks source link

One executable for all Generation #13

Open mrprajesh opened 1 year ago

mrprajesh commented 1 year ago

Typically, our make should result in one executable (say StarPlat compiler) which can generate files for all the architectures. i.e., should output cuda, omp, or mpi files based on the cmd line args. Currently, it is

We may have to use namespace and modify our makefile to achieve it. A small prototype here

image

mrprajesh commented 1 year ago

Let's follow these as our namespace conventions. Prefix sp meaning StarPlat.

// header
namespace X
{
  class Foo
  {
  public:
    void TheFunc();
  };
}

// cpp
namespace X
{
  void Foo::TheFunc()
  {
    return;
  }
}

We follow option 1 in Source

More notes

rupesh0508 commented 1 year ago

we should never miss out #ifndef macros in headers.

Or use #pragma once

mrprajesh commented 1 year ago

Thanks, Rupesh. #pragma one has one tiny drawback. This feature is completed in working branch as of https://github.com/nibeditabh/GraphDSL/commit/eb3482341b23c21ce2d10988b113c22738d6aaf0 except for MPI.

rupesh0508 commented 1 year ago

With the heterogeneous backend Nibedita is working on, we will need all the three backends under the same binary.