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

SCM Repository

[diderot] Diff of /branches/vis12/src/compiler/cl-target/runtime-names.sml
ViewVC logotype

Diff of /branches/vis12/src/compiler/cl-target/runtime-names.sml

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

revision 2707, Sat Sep 20 15:11:18 2014 UTC revision 2708, Sat Sep 20 18:46:49 2014 UTC
# Line 15  Line 15 
15    (* globals that specify the target characteristics.  These should be initialized    (* globals that specify the target characteristics.  These should be initialized
16     * when the program object is created.     * when the program object is created.
17     *)     *)
18      val doublePrecision = ref false      val gIntTy = ref CLang.int32        (* external API type for Diderot ints *)
19      val gIntTy = ref CLang.int32      val gCLIntTy = ref CLang.voidTy     (* CPU-side OpenCL type for Diderot ints *)
20      val gRealTy = ref CLang.float      val gRealTy = ref CLang.float       (* external API type for Diderot reals *)
21        val gCLRealTy = ref CLang.voidTy    (* CPU-side OpenCL type for Diderot reals *)
22      val gRealStem = ref "?"      val gRealStem = ref "?"
23      val gRealSuffix = ref "?"      val gRealSuffix = ref "?"
24      val gIntSuffix = ref "?"      val gIntSuffix = ref "?"
25      val gIntFormat = ref "?"      val gIntFormat = ref "?"
26    
27   (* initialize globals based on target precision *)   (* initialize globals based on target precision *)
28      fun initTargetSpec double = (      fun initTargetSpec (tgt : TargetUtil.target_desc) = (
29            doublePrecision := double;            if #longint tgt
           if double  
30              then (              then (
31                gIntTy := CLang.int64;                gIntTy := CLang.int64;
               gRealTy := CLang.double;  
               gRealStem := "double";  
               gRealSuffix := "d";  
32                gIntSuffix := "l";                gIntSuffix := "l";
33                gIntFormat := "%ld")                gIntFormat := "%ld")
34              else (              else (
35                gIntTy := CLang.int32;                gIntTy := CLang.int32;
36                  gIntSuffix := "i";
37                  gIntFormat := "%d");
38              if #double tgt
39                then (
40                  gRealTy := CLang.double;
41                  gRealStem := "double";
42                  gRealSuffix := "d")
43                else (
44                gRealTy := CLang.float;                gRealTy := CLang.float;
45                gRealStem := "float";                gRealStem := "float";
46                gRealSuffix := "f";                gRealSuffix := "f"))
               gIntSuffix := "i";  
               gIntFormat := "%d"))  
47    
48      fun addRealSuffix stem = stem ^ !gRealSuffix      fun addRealSuffix stem = stem ^ !gRealSuffix
49      fun addVecSuffix stem n = concat[stem, Int.toString n, !gRealSuffix]      fun addVecSuffix stem n = concat[stem, Int.toString n, !gRealSuffix]

Legend:
Removed from v.2707  
changed lines
  Added in v.2708

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