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

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

            UnifiedTexturing = true;
            DowngradeDoubles = false;
        }
Esempio 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);
        }
Esempio 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));
        }
Esempio 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);
        }
Esempio 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);
        }
Esempio 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));
        }
Esempio 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);
        }
Esempio 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();
     }
 }
Esempio n. 10
0
 protected Quantum15Attribute(HardwareIsa hardwareIsa)
     : this(null, SoftwareIsa.PTX_15, hardwareIsa.AssertThat(isa => isa < HardwareIsa.SM_20))
 {
 }
Esempio n. 11
0
 public Atom15Attribute(String signature, HardwareIsa hardwareIsa)
     : this(signature, SoftwareIsa.PTX_15, hardwareIsa.AssertThat(isa => isa < HardwareIsa.SM_20))
 {
 }
Esempio n. 12
0
 public Atom15Attribute(SoftwareIsa softwareIsa, HardwareIsa hardwareIsa)
     : this(null, softwareIsa, hardwareIsa)
 {
 }
Esempio n. 13
0
 public Atom15Attribute(HardwareIsa hardwareIsa)
     : this(null, SoftwareIsa.PTX_15, hardwareIsa.AssertThat(isa => isa < HardwareIsa.SM_20))
 {
 }
Esempio n. 14
0
 public Atom20Attribute(HardwareIsa hardwareIsa)
     : this(null, SoftwareIsa.PTX_20, hardwareIsa)
 {
 }
Esempio n. 15
0
 public PtxAttribute(String code, HardwareIsa hardwareIsa, SoftwareIsa softwareIsa)
 {
     Code = code;
     Target = hardwareIsa;
     Version = softwareIsa;
 }
Esempio n. 16
0
 public PtxopAttribute(SoftwareIsa softwareIsa, HardwareIsa hardwareIsa)
     : this(null, softwareIsa, hardwareIsa)
 {
 }
Esempio 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))
 {
 }
Esempio n. 18
0
 protected Quantum15Attribute(HardwareIsa hardwareIsa, SoftwareIsa softwareIsa)
     : this(null, softwareIsa, hardwareIsa)
 {
 }
Esempio n. 19
0
 protected Quantum15Attribute(String signature, HardwareIsa hardwareIsa, SoftwareIsa softwareIsa)
     : base(signature, softwareIsa, hardwareIsa)
 {
 }
Esempio n. 20
0
 public PragmaAttribute(HardwareIsa hardwareIsa, SoftwareIsa softwareIsa)
     : this(null, softwareIsa, hardwareIsa)
 {
 }
Esempio 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))
 {
 }
Esempio 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))
 {
 }
Esempio n. 23
0
 protected Quantum20Attribute(HardwareIsa hardwareIsa)
     : this(null, SoftwareIsa.PTX_20, hardwareIsa)
 {
 }
Esempio n. 24
0
 public Ptxop15Attribute(HardwareIsa hardwareIsa, SoftwareIsa softwareIsa)
     : this(null, softwareIsa, hardwareIsa)
 {
 }
Esempio n. 25
0
 protected Quantum15Attribute(String signature, HardwareIsa hardwareIsa)
     : this(signature, SoftwareIsa.PTX_15, hardwareIsa.AssertThat(isa => isa < HardwareIsa.SM_20))
 {
 }
Esempio n. 26
0
 public Module(HardwareIsa hardwareIsa)
     : this(hardwareIsa < HardwareIsa.SM_20 ? SoftwareIsa.PTX_10 : SoftwareIsa.PTX_20, hardwareIsa)
 {
 }
Esempio n. 27
0
 public AtomAttribute(HardwareIsa hardwareIsa)
     : this(null, hardwareIsa < HardwareIsa.SM_20 ? SoftwareIsa.PTX_10 : SoftwareIsa.PTX_20, hardwareIsa)
 {
 }
Esempio n. 28
0
 public AtomAttribute(String signature, HardwareIsa hardwareIsa)
     : this(signature, hardwareIsa < HardwareIsa.SM_20 ? SoftwareIsa.PTX_10 : SoftwareIsa.PTX_20, hardwareIsa)
 {
 }
Esempio n. 29
0
 public PtxopAttribute(String signature, SoftwareIsa softwareIsa, HardwareIsa hardwareIsa)
     : base(signature, softwareIsa, hardwareIsa)
 {
 }
Esempio 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))
 {
 }
Esempio n. 31
0
 public AtomAttribute(HardwareIsa hardwareIsa, SoftwareIsa softwareIsa)
     : this(null, softwareIsa, hardwareIsa)
 {
 }
Esempio n. 32
0
 public Module(HardwareIsa hardwareIsa, SoftwareIsa softwareIsa)
     : this(softwareIsa, hardwareIsa)
 {
 }
Esempio n. 33
0
 public AtomAttribute(String signature, HardwareIsa hardwareIsa, SoftwareIsa softwareIsa)
     : base(signature, softwareIsa, hardwareIsa)
 {
 }
Esempio n. 34
0
 public PtxAttribute(String code, HardwareIsa hardwareIsa)
     : this(code, hardwareIsa, SoftwareIsa.PTX_10)
 {
 }