public CUP2PTokens GetP2PTokens(CUdeviceptr ptr) { CUP2PTokens tokens = new CUP2PTokens(); this.LastError = CUDADriver.cuPointerGetAttribute(ref tokens, CUPointerAttribute.P2PTokens, ptr); return(tokens); }
public uint GetTextureFlags(CUtexref tex) { uint pFlags = 0; this.LastError = CUDADriver.cuTexRefGetFlags(ref pFlags, tex); return(pFlags); }
public CUcontext GetCurrentContextV1() { CUcontext ctx = new CUcontext(); this.LastError = CUDADriver.cuCtxGetCurrent(ref ctx); return(ctx); }
public CUAddressMode GetTextureAddressMode(CUtexref tex, int dimension) { CUAddressMode wrap = CUAddressMode.Wrap; this.LastError = CUDADriver.cuTexRefGetAddressMode(ref wrap, tex, dimension); return(wrap); }
public IntPtr AllocateHost(uint bytes) { IntPtr pp = new IntPtr(); this.LastError = CUDADriver.cuMemAllocHost(ref pp, bytes); return(pp); }
public CUdeviceptr Allocate(uint bytes) { CUdeviceptr dptr = new CUdeviceptr(); this.LastError = CUDADriver.cuMemAlloc(ref dptr, bytes); return(dptr); }
public CUtexref GetModuleTexture(CUmodule mod, string textureName) { CUtexref pTexRef = new CUtexref(); this.LastError = CUDADriver.cuModuleGetTexRef(ref pTexRef, mod, textureName); return(pTexRef); }
public CUstream CreateStream(StreamFlags flags) { CUstream phStream = new CUstream(); this.LastError = CUDADriver.cuStreamCreate(ref phStream, (uint)flags); return(phStream); }
public CUtexref CreateTexture() { CUtexref pTexRef = new CUtexref(); this.LastError = CUDADriver.cuTexRefCreate(ref pTexRef); return(pTexRef); }
public CUcontext CreateContext(int ordinal, CUCtxFlags flags) { this.curCtx = new CUcontext(); this.LastError = CUDADriver.cuCtxCreate(ref this.curCtx, (uint)flags, this.Devices[ordinal].Handle); this.CurrentDevice = this.Devices[ordinal]; return(this.curCtx); }
public CUevent CreateEvent(CUEventFlags flags) { CUevent phEvent = new CUevent(); this.LastError = CUDADriver.cuEventCreate(ref phEvent, (uint)flags); return(phEvent); }
public CUarray CreateArray(CUDAArrayDescriptor desc) { CUarray pHandle = new CUarray(); this.LastError = CUDADriver.cuArrayCreate(ref pHandle, ref desc); return(pHandle); }
public void CopyHostToDevice <T>(CUdeviceptr devPtr, T[] data) { GCHandle handle = GCHandle.Alloc(data, GCHandleType.Pinned); this.LastError = CUDADriver.cuMemcpyHtoD(devPtr, handle.AddrOfPinnedObject(), this.GetSize <T>(data)); handle.Free(); }
public void CopyHostToArray <T>(CUarray devArray, T[] data, uint index) { GCHandle handle = GCHandle.Alloc(data, GCHandleType.Pinned); this.LastError = CUDADriver.cuMemcpyHtoA(devArray, index, handle.AddrOfPinnedObject(), this.GetSize <T>(data)); handle.Free(); }
public CUarray GetGraphicsSubResourceMappedArray(CUgraphicsResource resource, uint arrIndex, uint mipLevel) { CUarray pArray = new CUarray(); this.LastError = CUDADriver.cuGraphicsSubResourceGetMappedArray(ref pArray, resource, arrIndex, mipLevel); return(pArray); }
public float ElapsedTime(CUevent start, CUevent end) { float pMilliseconds = 0f; this.LastError = CUDADriver.cuEventElapsedTime(ref pMilliseconds, start, end); return(pMilliseconds); }
public CUdeviceptr GetHostDevicePointer(IntPtr hostPtr, uint flags) { CUdeviceptr pdptr = new CUdeviceptr(); this.LastError = CUDADriver.cuMemHostGetDevicePointer(ref pdptr, hostPtr, flags); return(pdptr); }
public CUDAArrayDescriptor GetArrayDescriptor(CUarray devArr) { CUDAArrayDescriptor pArrayDescriptor = new CUDAArrayDescriptor(); this.LastError = CUDADriver.cuArrayGetDescriptor(ref pArrayDescriptor, devArr); return(pArrayDescriptor); }
public CUfunction GetModuleFunction(CUmodule mod, string funcName) { CUfunction hfunc = new CUfunction(); this.LastError = CUDADriver.cuModuleGetFunction(ref hfunc, mod, funcName); return(hfunc); }
public CUdevice GetContextDevice() { CUdevice device = new CUdevice(); this.LastError = CUDADriver.cuCtxGetDevice(ref device); return(device); }
public CUdeviceptr GetTextureAddress(CUtexref tex) { CUdeviceptr pdptr = new CUdeviceptr(); this.LastError = CUDADriver.cuTexRefGetAddress(ref pdptr, tex); return(pdptr); }
public CUdevice GetDevice(int ordinal) { CUdevice device = new CUdevice(); this.LastError = CUDADriver.cuDeviceGet(ref device, ordinal); return(device); }
public CUarray GetTextureArray(CUtexref tex) { CUarray phArray = new CUarray(); this.LastError = CUDADriver.cuTexRefGetArray(ref phArray, tex); return(phArray); }
public int GetDeviceAttribute(CUDeviceAttribute attrib, CUdevice dev) { int pi = 0; this.LastError = CUDADriver.cuDeviceGetAttribute(ref pi, attrib, dev); return(pi); }
public CUFilterMode GetTextureFilterMode(CUtexref tex) { CUFilterMode point = CUFilterMode.Point; this.LastError = CUDADriver.cuTexRefGetFilterMode(ref point, tex); return(point); }
public int GetDeviceCount() { int count = 0; this.LastError = CUDADriver.cuDeviceGetCount(ref count); return(count); }
public IntPtr HostAllocate(uint size, uint flags) { IntPtr pp = new IntPtr(); this.LastError = CUDADriver.cuMemHostAlloc(ref pp, size, flags); return(pp); }
public int GetFunctionAttribute(CUfunction func, CUFunctionAttribute attrib) { int pi = 0; this.LastError = CUDADriver.cuFuncGetAttribute(ref pi, attrib, func); return(pi); }
//private CUcontext _pctx; public CUcontext MakeFloating() { CUcontext pctx = new CUcontext(); this.LastError = CUDADriver.cuCtxPopCurrent(ref pctx); return(pctx); }
public CUcontext GetPointerContext(CUdeviceptr ptr) { CUcontext ctx = new CUcontext(); this.LastError = CUDADriver.cuPointerGetAttribute(ref ctx, CUPointerAttribute.Context, ptr); return(ctx); }