public CUDAArrayDescriptor GetArrayDescriptor(CUarray devArr) { CUDAArrayDescriptor pArrayDescriptor = new CUDAArrayDescriptor(); this.LastError = CUDADriver.cuArrayGetDescriptor(ref pArrayDescriptor, devArr); return(pArrayDescriptor); }
public CUarray CreateArray(CUDAArrayDescriptor desc) { CUarray pHandle = new CUarray(); this.LastError = CUDADriver.cuArrayCreate(ref pHandle, ref desc); return(pHandle); }
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)); }
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); } }
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)); }
public static extern CUResult cuTexRefSetAddress2D_v3(CUtexref hTexRef, CUDAArrayDescriptor desc, CUdeviceptr dptr, SizeT Pitch);
public static extern CUResult cuArrayGetDescriptor(ref CUDAArrayDescriptor pArrayDescriptor, CUarray hArray);
public static extern CUResult cuArrayCreate(ref CUarray pHandle, ref CUDAArrayDescriptor pAllocateArray);