@0xec0f2b767d8556c1; # unique file ID, generated by `capnp id`

using Cxx = import "/capnp/c++.capnp";
$Cxx.namespace("popart::popx::cap");

using Ir = import "Ir.capnp";
using IrLowering = import "IrLowering.capnp";
using Tensor = Ir.Tensor;

using TensorId = Text;

struct Interval{
  begin @0: UInt64;
  end @1: UInt64;
}


struct CollectiveBalancedHostRearrangement{
  replicationFactor @0 :UInt32;
  totalElementsPerReplica @1 :UInt64;
  gatheredToRefSlices @2 :List(Interval);
}


struct CollectiveBalancedHostRearrangements{
  rearrangements @0 :List(Rearrangements);
  struct Rearrangements{
    id @0 :TensorId;
    rearrangement @1 :CollectiveBalancedHostRearrangement;
  }
}

struct Header{
  hash @0 :UInt64;
  popartExeOffset @1 :Int64;
  poplarExeOffset @2 :Int64;
  totalSize @3 :Int64;
}

struct Executablex{
  irLowering @0: IrLowering.IrLowering;
  tensors @1: List(Tensor);
  collectiveBalancedHostRearrangements @2: CollectiveBalancedHostRearrangements;
}
