Пример #1
0
        public CUDAArrayDescriptor GetArrayDescriptor(CUarray devArr)
        {
            CUDAArrayDescriptor pArrayDescriptor = new CUDAArrayDescriptor();

            this.LastError = CUDADriver.cuArrayGetDescriptor(ref pArrayDescriptor, devArr);
            return(pArrayDescriptor);
        }
Пример #2
0
        public CUarray CreateArray(CUDAArrayDescriptor desc)
        {
            CUarray pHandle = new CUarray();

            this.LastError = CUDADriver.cuArrayCreate(ref pHandle, ref desc);
            return(pHandle);
        }
Пример #3
0
        public CUarray CreateArray(CUArrayFormat format, uint channels, uint width, uint height)
        {
            CUDAArrayDescriptor desc = new CUDAArrayDescriptor {
                Format      = format,
                Width       = width,
                Height      = height,
                NumChannels = channels
            };

            return(this.CreateArray(desc));
        }
Пример #4
0
 public void SetTextureAddress(CUtexref tex, CUDAArrayDescriptor desc, CUdeviceptr dptr, uint pitch)
 {
     if (_version >= 4010)
     {
         this.LastError = CUDADriver.cuTexRefSetAddress2D_v3(tex, desc, dptr, pitch);
     }
     else
     {
         this.LastError = CUDADriver.cuTexRefSetAddress2D(tex, desc, dptr, pitch);
     }
 }
Пример #5
0
        public CUarray CreateArray(Array arr)
        {
            CUDAArrayDescriptor desc = new CUDAArrayDescriptor {
                Width  = (uint)arr.GetLongLength(0),
                Height = 0
            };

            if (arr.Rank > 1)
            {
                desc.Height = (uint)arr.GetLongLength(1);
            }
            Type type = arr.GetValue(0).GetType();

            desc.Format      = this.GetTypeFormat(type);
            desc.NumChannels = (uint)this.GetTypeComponents(type);
            return(this.CreateArray(desc));
        }
Пример #6
0
 public static extern CUResult cuTexRefSetAddress2D_v3(CUtexref hTexRef, CUDAArrayDescriptor desc, CUdeviceptr dptr, SizeT Pitch);
Пример #7
0
 public static extern CUResult cuArrayGetDescriptor(ref CUDAArrayDescriptor pArrayDescriptor, CUarray hArray);
Пример #8
0
 public static extern CUResult cuArrayCreate(ref CUarray pHandle, ref CUDAArrayDescriptor pAllocateArray);