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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3095 - (download) (annotate)
Wed Mar 18 13:12:57 2015 UTC (4 years, 3 months ago) by jhr
File size: 3271 byte(s)
  working on reorg of names
(* ocl-names.sml
 *
 * COPYRIGHT (c) 2015 The Diderot Project (http://diderot-language.cs.uchicago.edu)
 * All rights reserved.
 *
 * These are names used in the generated OpenCL code.  It includes names from
 * RuntimeNames (c-util/runtime-names.sml), CTypeNames (c-util/c-type-names.sml),
 * and MathNames, plus additional names.
 *)

structure OCLNames =
  struct

    local
      structure RN = RuntimeNames
      structure CTyN = CTypeNames
      structure MathN = MathNames
      structure CL = CLang
    in

    val globalsTyName = RN.globalsTyName
    val globalsPtrTy = RN.globalsPtrTy
    val inputsPtrTy = RN.inputsPtrTy
    val strandTyName = RN.strandTyName
    val strandPtrTy = RN.strandPtrTy
    val strandInit = RN.strandInit

    val sizesTyName = RN.qualifyName "Sizes_t"
    fun sizesTy tgt = CL.T_Named(sizesTyName tgt)

    val gIntTy = CNames.gGPUIntTy       (* external API type for Diderot ints *)
    val gRealTy = CNames.gGPURealTy     (* external API type for Diderot reals *)

  (* OpenCL vector types *)
    val vecTy = CTyN.vecTy
    fun ivecTy n = CL.T_Named (concat[!CNames.gIntStem, Int.toString n])

    val matTy = CTyN.matTy
    val ten3Ty = CTyN.ten3Ty

  (* strand copy functions *)
    fun copyToGlobal name = name ^ "_CopyToGlobal"
    fun copyFromGlobal name = name ^ "_CopyFromGlobal"

  (* standard kernels *)
    val getSizesKern = "GetSizesKern"
    val initGlobalsKern = "InitGlobalsKern"
    val initiallyKern = "InitiallyKern"
    val updateKern = "UpdateKern"
    val outputKern = "OutputKern"
    val snapshotKern = "SnapshotKern"
    val schedKern = "SchedKern"
    val compactKern = "CompactKern"

  (* Status_t symbols *)
    val kActive = RN.kActive
    val kNew = RN.kNew
    val kDie = RN.kDie
    val kStabilize = RN.kStabilize
    val kStable = RN.kStable

  (* Diderot image operations *)
    val toImageSpace = RN.toImageSpace
    val toWorldSpace = RN.toWorldSpace
    val inside = RN.inside

  (* Math function names (some from MathNames) *)
    val max = "max"
    val min = "min"
    val fabs = "fabs"
    val ceil = MathN.ceil
    val floor = MathN.floor
    val round = MathN.round
    val trunc = MathN.trunc
    val clamp = "clamp"
    val lerp = "mix"  (* lerp is called mix in OpenCL *)
    val loadVec = MathN.loadVec
    val scale = MathN.scale
    val truncToInt = MathN.truncToInt
    val dot = "dot"
    val cross = "cross"
    val length = "length"
    val normalize = "normalize"
    val vecitof = MathN.vecitof
    val vecftoi = MathN.vecftoi
    val zeroMat = MathN.zeroMat
    val identityMat = MathN.identityMat
    val trace = MathN.trace
    val normMat = MathN.normMat
    val copyMat = MathN.copyMat
    val scaleMat = MathN.scaleMat
    val addMat = MathN.addMat
    val subMat = MathN.subMat
    val mulVecMat = MathN.mulVecMat
    val mulMatVec = MathN.mulMatVec
    val mulMatMat = MathN.mulMatMat
    val transposeMat = MathN.transposeMat
    val evecs2x2 = MathN.evecs2x2
    val evecs3x3 = MathN.evecs3x3
    val evals2x2 = MathN.evals2x2
    val evals3x3 = MathN.evals3x3
    val copyTen3 = MathN.copyTen3
    val normTen3 = MathN.normTen3
    val mulVecTen3 = MathN.mulVecTen3
    val mulTen3Vec = MathN.mulTen3Vec
    val colonMul = MathN.colonMul

    end (* local *)
  end

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