--                               code    name    threads  shared
----------------------------------------------------------------------------     
-- generate coordination code + kernels 


run :: (GlobalArray (Exp Int) -> KC ()) -> (KernelMap,String)
run coord = (km,head ++ body ++ end )
  where 
    ((_,_,km),body) = runKCM (coord (GlobalArray undefined)) (0,0) (Map.empty)
    head = "void coord(int *input0, int input0size,int *output0, int output0size){\n"
    end  = "\n}"
run :: (GlobalArray (Exp Int) -> KC ()) -> (KernelMap,String)
run coord = (km,head ++ body ++ end )
  where 
    ((_,_,km),body) = runKCM (coord (GlobalArray undefined)) (0,0) (Map.empty)
    head = "void coord(int *input0, int input0size,int *output0, int output0size){\n"
    end  = "\n}"
run coord = (km,head ++ body ++ end )
  where 
    ((_,_,km),body) = runKCM (coord (GlobalArray undefined)) (0,0) (Map.empty)
    head = "void coord(int *input0, int input0size,int *output0, int output0size){\n"
    end  = "\n}"