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

SCM Repository

[diderot] Diff of /branches/lamont/src/compiler/codegen/target-util.sml
ViewVC logotype

Diff of /branches/lamont/src/compiler/codegen/target-util.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2297, Fri Mar 15 22:05:31 2013 UTC revision 2298, Fri Mar 15 22:18:22 2013 UTC
# Line 32  Line 32 
32          bsp : bool                      (* true if BSP style execution should always be used *)          bsp : bool                      (* true if BSP style execution should always be used *)
33        }        }
34    
   (* convert a target specification to the name of the runtime library *)  
     fun runtimeName (tgt : target_desc) = let  
           val l = if #debug tgt then ["-debug.o"] else [".o"]  
           val l = if #parallel tgt then "-par"::l else l  
           val p = if #double tgt then "-d" else "-f"  
           val t = (case #target tgt  
                  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  
   
   (* return the CPP floating-point precision definition for the target *)  
     fun floatPrecisionDef (tgt : target_desc) = if #double tgt  
           then "DIDEROT_DOUBLE_PRECISION"  
           else "DIDEROT_SINGLE_PRECISION"  
   
   (* return the CPP integer precision definition for the target *)  
     fun intPrecisionDef (tgt : target_desc) = if #longint tgt  
           then "DIDEROT_LONGINT"  
           else "DIDEROT_INT"  
   
   (* return the CPP target definition for the target *)  
     fun targetDef (tgt : target_desc) = (case #target tgt  
            of TARGET_C => if #parallel tgt  
                 then "DIDEROT_TARGET_PARALLEL"  
                 else "DIDEROT_TARGET_C"  
             | TARGET_CL => "DIDEROT_TARGET_CL"  
             | TARGET_CUDA => "DIDEROT_TARGET_CUDA"  
           (* end case *))  
   
35    end    end

Legend:
Removed from v.2297  
changed lines
  Added in v.2298

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