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

SCM Repository

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

Annotation of /branches/vis12-cl/src/compiler/cl-target/ocl-names.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3095 - (view) (download)

1 : jhr 3095 (* ocl-names.sml
2 : jhr 2403 *
3 : jhr 3088 * COPYRIGHT (c) 2015 The Diderot Project (http://diderot-language.cs.uchicago.edu)
4 : jhr 2403 * All rights reserved.
5 : jhr 2724 *
6 : jhr 3095 * These are names used in the generated OpenCL code. It includes names from
7 :     * RuntimeNames (c-util/runtime-names.sml), CTypeNames (c-util/c-type-names.sml),
8 :     * and MathNames, plus additional names.
9 : jhr 2403 *)
10 :    
11 : jhr 3095 structure OCLNames =
12 : jhr 2403 struct
13 :    
14 :     local
15 : jhr 2739 structure RN = RuntimeNames
16 : jhr 3095 structure CTyN = CTypeNames
17 :     structure MathN = MathNames
18 :     structure CL = CLang
19 : jhr 2403 in
20 :    
21 : jhr 3095 val globalsTyName = RN.globalsTyName
22 :     val globalsPtrTy = RN.globalsPtrTy
23 :     val inputsPtrTy = RN.inputsPtrTy
24 :     val strandTyName = RN.strandTyName
25 :     val strandPtrTy = RN.strandPtrTy
26 :     val strandInit = RN.strandInit
27 : jhr 2403
28 : jhr 3095 val sizesTyName = RN.qualifyName "Sizes_t"
29 :     fun sizesTy tgt = CL.T_Named(sizesTyName tgt)
30 : jhr 2403
31 : jhr 3095 val gIntTy = CNames.gGPUIntTy (* external API type for Diderot ints *)
32 :     val gRealTy = CNames.gGPURealTy (* external API type for Diderot reals *)
33 : jhr 2403
34 : jhr 3095 (* OpenCL vector types *)
35 :     val vecTy = CTyN.vecTy
36 :     fun ivecTy n = CL.T_Named (concat[!CNames.gIntStem, Int.toString n])
37 :    
38 :     val matTy = CTyN.matTy
39 :     val ten3Ty = CTyN.ten3Ty
40 :    
41 : jhr 2759 (* strand copy functions *)
42 :     fun copyToGlobal name = name ^ "_CopyToGlobal"
43 :     fun copyFromGlobal name = name ^ "_CopyFromGlobal"
44 :    
45 : jhr 2742 (* standard kernels *)
46 :     val getSizesKern = "GetSizesKern"
47 :     val initGlobalsKern = "InitGlobalsKern"
48 :     val initiallyKern = "InitiallyKern"
49 :     val updateKern = "UpdateKern"
50 : jhr 2758 val outputKern = "OutputKern"
51 :     val snapshotKern = "SnapshotKern"
52 : jhr 2742 val schedKern = "SchedKern"
53 :     val compactKern = "CompactKern"
54 :    
55 : jhr 3095 (* Status_t symbols *)
56 :     val kActive = RN.kActive
57 :     val kNew = RN.kNew
58 :     val kDie = RN.kDie
59 :     val kStabilize = RN.kStabilize
60 :     val kStable = RN.kStable
61 :    
62 :     (* Diderot image operations *)
63 :     val toImageSpace = RN.toImageSpace
64 :     val toWorldSpace = RN.toWorldSpace
65 :     val inside = RN.inside
66 :    
67 :     (* Math function names (some from MathNames) *)
68 : jhr 2403 val max = "max"
69 :     val min = "min"
70 :     val fabs = "fabs"
71 : jhr 3095 val ceil = MathN.ceil
72 :     val floor = MathN.floor
73 :     val round = MathN.round
74 :     val trunc = MathN.trunc
75 : jhr 2403 val clamp = "clamp"
76 : jhr 3095 val lerp = "mix" (* lerp is called mix in OpenCL *)
77 :     val loadVec = MathN.loadVec
78 :     val scale = MathN.scale
79 :     val truncToInt = MathN.truncToInt
80 : jhr 2403 val dot = "dot"
81 :     val cross = "cross"
82 :     val length = "length"
83 :     val normalize = "normalize"
84 : jhr 3095 val vecitof = MathN.vecitof
85 :     val vecftoi = MathN.vecftoi
86 :     val zeroMat = MathN.zeroMat
87 :     val identityMat = MathN.identityMat
88 :     val trace = MathN.trace
89 :     val normMat = MathN.normMat
90 :     val copyMat = MathN.copyMat
91 :     val scaleMat = MathN.scaleMat
92 :     val addMat = MathN.addMat
93 :     val subMat = MathN.subMat
94 :     val mulVecMat = MathN.mulVecMat
95 :     val mulMatVec = MathN.mulMatVec
96 :     val mulMatMat = MathN.mulMatMat
97 :     val transposeMat = MathN.transposeMat
98 :     val evecs2x2 = MathN.evecs2x2
99 :     val evecs3x3 = MathN.evecs3x3
100 :     val evals2x2 = MathN.evals2x2
101 :     val evals3x3 = MathN.evals3x3
102 :     val copyTen3 = MathN.copyTen3
103 :     val normTen3 = MathN.normTen3
104 :     val mulVecTen3 = MathN.mulVecTen3
105 :     val mulTen3Vec = MathN.mulTen3Vec
106 :     val colonMul = MathN.colonMul
107 : jhr 2403
108 :     end (* local *)
109 :     end

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