public Block(DeviceMemory cache, int index, int size) { _cache = cache; _index = index; _data = new CudaDeviceVariable <float>(size); #if DEBUG if (_index == _badAlloc) { Debugger.Break(); } #endif }
public Block(DeviceMemory cache, int index, int size) { _cache = cache; Index = index; var sizeInBytes = size * CudaProvider.FLOAT_SIZE; var ptr = new CUdeviceptr(); var result = DriverAPINativeMethods.MemoryManagement.cuMemAlloc_v2(ref ptr, sizeInBytes); CudaProvider.CheckForError(result); DeviceVariable = new CudaDeviceVariable <float>(ptr, true, sizeInBytes); #if DEBUG if (Index == _badAlloc) { Debugger.Break(); } #endif }