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

SCM Repository

[diderot] View of /branches/pure-cfg/src/compiler/codegen/target-util.sml
ViewVC logotype

View of /branches/pure-cfg/src/compiler/codegen/target-util.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1173 - (download) (annotate)
Tue May 10 16:03:47 2011 UTC (8 years, 5 months ago) by jhr
File size: 1087 byte(s)
  Minor fixes
(* target-util.sml
 *
 * COPYRIGHT (c) 2011 The Diderot Project (http://diderot-language.cs.uchicago.edu)
 * All rights reserved.
 *
 * Utility support for target selection, etc.
 *)

structure TargetUtil =
  struct

    datatype target
      = TARGET_C		(* C code *)
      | TARGET_CL		(* C + OpenCL *)
      | TARGET_CUDA		(* C + CUDA *)

    type target_desc = {
	target : target,	(* target platform *)
	parallel : bool,	(* parallel components *)
	double : bool,		(* true for double-precision candidates *)
	debug : bool		(* true if debugging of the target is enabled *)
      }

  (* convert a target specification to the name of the runtime library *)
    fun runtimeName {target, parallel, double, debug} = let
	  val l = if debug then ["-debug.o"] else [".o"]
	  val l = if parallel then "-par"::l else l
	  val p = if double then "-d" else "-f"
	  val t = (case target
		 of TARGET_C => "c"
		  | TARGET_CL => "cl"
		  | TARGET_CUDA => "cuda"
		(* end case *))
	  in
	    OS.Path.concat(
	      Paths.diderotLib,
	      String.concat("diderot-rt-" :: t :: p :: l))
	  end

  end

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