Ejemplo n.º 1
0
        public Context(SoftwareIsa version, HardwareIsa target)
        {
            Version = version;
            Target = target;

            _current.Push(this);
        }
Ejemplo n.º 2
0
        public Module(SoftwareIsa softwareIsa, HardwareIsa hardwareIsa)
        {
            Version = softwareIsa;
            Target = hardwareIsa;

            UnifiedTexturing = true;
            DowngradeDoubles = false;
        }
Ejemplo n.º 3
0
        public static JittedKernel JitKernel(this String ptx, dim3 reqntid, HardwareIsa target)
        {
            ptx.AssertNotNull();
            CudaDriver.Ensure();

            var tuning = new JitTuning { Reqntid = reqntid };
            return ptx.JitKernel(tuning, target);
        }
Ejemplo n.º 4
0
        public static JittedKernel JitKernel(this String ptx, dim3 reqntid, HardwareIsa target)
        {
            ptx.AssertNotNull();
            CudaDriver.Ensure();

            var tuning = new JitTuning {
                Reqntid = reqntid
            };

            return(ptx.JitKernel(tuning, target));
        }
Ejemplo n.º 5
0
        public static JittedKernel JitKernel(this String ptx, JitTuning tuning, HardwareIsa target)
        {
            ptx.AssertNotNull();
            CudaDriver.Ensure();

            var compiler = new JitCompiler();
            compiler.Target = target;
            compiler.Tuning = tuning;

            var result = compiler.Compile(ptx);
            return new JittedKernel(result);
        }
Ejemplo n.º 6
0
        public JittedFunction(CUfunction handle, String name)
        {
            CudaDriver.Ensure();
            Handle = handle.AssertThat(h => h.IsNotNull);
            Name = name ?? "N/A";

            MaxThreadsPerBlock = nvcuda.cuFuncGetAttribute(CUfunction_attribute.MaxThreadsPerBlock, this);
            SharedSizeBytes = nvcuda.cuFuncGetAttribute(CUfunction_attribute.SharedSizeBytes, this);
            ConstSizeBytes = nvcuda.cuFuncGetAttribute(CUfunction_attribute.ConstSizeBytes, this);
            LocalSizeBytes = nvcuda.cuFuncGetAttribute(CUfunction_attribute.LocalSizeBytes, this);
            NumRegs = nvcuda.cuFuncGetAttribute(CUfunction_attribute.NumRegs, this);
            PtxVersion = (HardwareIsa)nvcuda.cuFuncGetAttribute(CUfunction_attribute.PtxVersion, this);
            BinaryVersion = (HardwareIsa)nvcuda.cuFuncGetAttribute(CUfunction_attribute.BinaryVersion, this);
        }
Ejemplo n.º 7
0
        public static JittedKernel JitKernel(this String ptx, JitTuning tuning, HardwareIsa target)
        {
            ptx.AssertNotNull();
            CudaDriver.Ensure();

            var compiler = new JitCompiler();

            compiler.Target = target;
            compiler.Tuning = tuning;

            var result = compiler.Compile(ptx);

            return(new JittedKernel(result));
        }
Ejemplo n.º 8
0
        public JittedFunction(CUfunction handle, String name)
        {
            CudaDriver.Ensure();
            Handle = handle.AssertThat(h => h.IsNotNull);
            Name   = name ?? "N/A";

            MaxThreadsPerBlock = nvcuda.cuFuncGetAttribute(CUfunction_attribute.MaxThreadsPerBlock, this);
            SharedSizeBytes    = nvcuda.cuFuncGetAttribute(CUfunction_attribute.SharedSizeBytes, this);
            ConstSizeBytes     = nvcuda.cuFuncGetAttribute(CUfunction_attribute.ConstSizeBytes, this);
            LocalSizeBytes     = nvcuda.cuFuncGetAttribute(CUfunction_attribute.LocalSizeBytes, this);
            NumRegs            = nvcuda.cuFuncGetAttribute(CUfunction_attribute.NumRegs, this);
            PtxVersion         = (HardwareIsa)nvcuda.cuFuncGetAttribute(CUfunction_attribute.PtxVersion, this);
            BinaryVersion      = (HardwareIsa)nvcuda.cuFuncGetAttribute(CUfunction_attribute.BinaryVersion, this);
        }
Ejemplo n.º 9
0
 public static CUjit_target ToCUjit_target(this HardwareIsa hardwareIsa)
 {
     switch (hardwareIsa)
     {
         case HardwareIsa.SM_10:
             return CUjit_target.Compute10;
         case HardwareIsa.SM_11:
             return CUjit_target.Compute11;
         case HardwareIsa.SM_12:
             return CUjit_target.Compute12;
         case HardwareIsa.SM_13:
             return CUjit_target.Compute13;
         case HardwareIsa.SM_20:
             return CUjit_target.Compute20;
         case 0:
             return 0;
         default:
             throw AssertionHelper.Fail();
     }
 }
Ejemplo n.º 10
0
 protected Quantum15Attribute(HardwareIsa hardwareIsa)
     : this(null, SoftwareIsa.PTX_15, hardwareIsa.AssertThat(isa => isa < HardwareIsa.SM_20))
 {
 }
Ejemplo n.º 11
0
 public Atom15Attribute(String signature, HardwareIsa hardwareIsa)
     : this(signature, SoftwareIsa.PTX_15, hardwareIsa.AssertThat(isa => isa < HardwareIsa.SM_20))
 {
 }
Ejemplo n.º 12
0
 public Atom15Attribute(SoftwareIsa softwareIsa, HardwareIsa hardwareIsa)
     : this(null, softwareIsa, hardwareIsa)
 {
 }
Ejemplo n.º 13
0
 public Atom15Attribute(HardwareIsa hardwareIsa)
     : this(null, SoftwareIsa.PTX_15, hardwareIsa.AssertThat(isa => isa < HardwareIsa.SM_20))
 {
 }
Ejemplo n.º 14
0
 public Atom20Attribute(HardwareIsa hardwareIsa)
     : this(null, SoftwareIsa.PTX_20, hardwareIsa)
 {
 }
Ejemplo n.º 15
0
 public PtxAttribute(String code, HardwareIsa hardwareIsa, SoftwareIsa softwareIsa)
 {
     Code = code;
     Target = hardwareIsa;
     Version = softwareIsa;
 }
Ejemplo n.º 16
0
 public PtxopAttribute(SoftwareIsa softwareIsa, HardwareIsa hardwareIsa)
     : this(null, softwareIsa, hardwareIsa)
 {
 }
Ejemplo n.º 17
0
 public Atom20Attribute(String signature, SoftwareIsa softwareIsa, HardwareIsa hardwareIsa)
     : base(signature, softwareIsa.AssertThat(isa => isa >= SoftwareIsa.PTX_20), hardwareIsa.AssertThat(isa => isa >= HardwareIsa.SM_20))
 {
 }
Ejemplo n.º 18
0
 protected Quantum15Attribute(HardwareIsa hardwareIsa, SoftwareIsa softwareIsa)
     : this(null, softwareIsa, hardwareIsa)
 {
 }
Ejemplo n.º 19
0
 protected Quantum15Attribute(String signature, HardwareIsa hardwareIsa, SoftwareIsa softwareIsa)
     : base(signature, softwareIsa, hardwareIsa)
 {
 }
Ejemplo n.º 20
0
 public PragmaAttribute(HardwareIsa hardwareIsa, SoftwareIsa softwareIsa)
     : this(null, softwareIsa, hardwareIsa)
 {
 }
Ejemplo n.º 21
0
 protected Quantum20Attribute(String signature, HardwareIsa hardwareIsa, SoftwareIsa softwareIsa)
     : base(signature, softwareIsa.AssertThat(isa => isa >= SoftwareIsa.PTX_20), hardwareIsa.AssertThat(isa => isa >= HardwareIsa.SM_20))
 {
 }
Ejemplo n.º 22
0
 protected Quantum20Attribute(HardwareIsa hardwareIsa, SoftwareIsa softwareIsa)
     : this(null, softwareIsa.AssertThat(isa => isa >= SoftwareIsa.PTX_20), hardwareIsa.AssertThat(isa => isa >= HardwareIsa.SM_20))
 {
 }
Ejemplo n.º 23
0
 protected Quantum20Attribute(HardwareIsa hardwareIsa)
     : this(null, SoftwareIsa.PTX_20, hardwareIsa)
 {
 }
Ejemplo n.º 24
0
 public Ptxop15Attribute(HardwareIsa hardwareIsa, SoftwareIsa softwareIsa)
     : this(null, softwareIsa, hardwareIsa)
 {
 }
Ejemplo n.º 25
0
 protected Quantum15Attribute(String signature, HardwareIsa hardwareIsa)
     : this(signature, SoftwareIsa.PTX_15, hardwareIsa.AssertThat(isa => isa < HardwareIsa.SM_20))
 {
 }
Ejemplo n.º 26
0
 public Module(HardwareIsa hardwareIsa)
     : this(hardwareIsa < HardwareIsa.SM_20 ? SoftwareIsa.PTX_10 : SoftwareIsa.PTX_20, hardwareIsa)
 {
 }
Ejemplo n.º 27
0
 public AtomAttribute(HardwareIsa hardwareIsa)
     : this(null, hardwareIsa < HardwareIsa.SM_20 ? SoftwareIsa.PTX_10 : SoftwareIsa.PTX_20, hardwareIsa)
 {
 }
Ejemplo n.º 28
0
 public AtomAttribute(String signature, HardwareIsa hardwareIsa)
     : this(signature, hardwareIsa < HardwareIsa.SM_20 ? SoftwareIsa.PTX_10 : SoftwareIsa.PTX_20, hardwareIsa)
 {
 }
Ejemplo n.º 29
0
 public PtxopAttribute(String signature, SoftwareIsa softwareIsa, HardwareIsa hardwareIsa)
     : base(signature, softwareIsa, hardwareIsa)
 {
 }
Ejemplo n.º 30
0
 public Atom20Attribute(HardwareIsa hardwareIsa, SoftwareIsa softwareIsa)
     : this(null, softwareIsa.AssertThat(isa => isa >= SoftwareIsa.PTX_20), hardwareIsa.AssertThat(isa => isa >= HardwareIsa.SM_20))
 {
 }
Ejemplo n.º 31
0
 public AtomAttribute(HardwareIsa hardwareIsa, SoftwareIsa softwareIsa)
     : this(null, softwareIsa, hardwareIsa)
 {
 }
Ejemplo n.º 32
0
 public Module(HardwareIsa hardwareIsa, SoftwareIsa softwareIsa)
     : this(softwareIsa, hardwareIsa)
 {
 }
Ejemplo n.º 33
0
 public AtomAttribute(String signature, HardwareIsa hardwareIsa, SoftwareIsa softwareIsa)
     : base(signature, softwareIsa, hardwareIsa)
 {
 }
Ejemplo n.º 34
0
 public PtxAttribute(String code, HardwareIsa hardwareIsa)
     : this(code, hardwareIsa, SoftwareIsa.PTX_10)
 {
 }