Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /trunk/src/compiler/driver/backend.sml
ViewVC logotype

View of /trunk/src/compiler/driver/backend.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3349 - (download) (annotate)
Tue Oct 27 15:16:36 2015 UTC (4 years, 2 months ago) by jhr
File size: 864 byte(s)
making copyrights consistent for all code in the repository
(* backend.sml
 *
 * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
 *
 * COPYRIGHT (c) 2015 The University of Chicago
 * All rights reserved.
 *)

structure BackEnd : sig

  (* generic interface to backend codegenerators.  The first argument specifies the
   * target
   *)
    val generate : TargetUtil.target_desc -> string * LowIL.program -> unit

  end = struct

    fun pickBackend target = (case target
	   of TargetUtil.TARGET_C => CBackEnd.generate
	    | TargetUtil.TARGET_CL => CLBackEnd.generate 
	    | TargetUtil.TARGET_CUDA => raise Fail "CUDA not supported yet"
	  (* end case *))

    fun generate {target, parallel, double, debug} = let
	  val gen = pickBackend target
	  in
	    fn (basename, prog) => gen {
		basename=basename, double=double, parallel=parallel, debug=debug, prog=prog
	      }
	  end

  end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0