Toggle navigation
Home
org.nd4j.jita.allocator.impl.BasicAllocator to org.nd4j.jita.allocator.impl.AllocatorPrototype
No. of Instances - 32
No. of Commits - 1
No. of Projects - {'nd4j'}
Hierarchy/Composition: SIBLING
Primitive Info: -
NameSpace: Internal -> Internal
Mapping:
Add or Remove Method invocation
assertNotEquals(0,allocator.getHostAllocatedMemory())
to
allocator.debug_remove_reference(coldObject)
allocator.getHostAllocatedMemory()
to
rnd.nextInt(10)
rnd.nextLong()
to
coldCounter
point.getShape()
to
shape
point.getShape()
to
shape
allocator.getAllocationPoint(cObject)
to
allocator.getDevicePointer(cObject,shape)
allocator.getDevicePointer(cObject)
to
allocator.getDevicePointer(cObject,shape)
Update Anonymous class
{ Random rnd=new Random(); @Override public void run(){ Long hotObject=hotObjects.get(rnd.nextInt(hotObjects.size())); for (int y=0; y < 50; y++) { Long coldObject=new Long(rnd.nextLong() + 200); AllocationShape shape=new AllocationShape(); shape.setDataType(DataBuffer.Type.FLOAT); shape.setLength(2 * 1024 * 1024L); shape.setOffset(0); shape.setStride(1); allocator.registerSpan(coldObject,shape); allocator.getDevicePointer(hotObject); allocator.tackDevice(coldObject,shape); allocator.getDevicePointer(coldObject); allocator.tackDevice(coldObject,shape); coldObjects.add(coldObject); assertNotEquals(0,allocator.getHostAllocatedMemory()); assertTrue(allocator.getHostAllocatedMemory() < configuration.getMaximumZeroAllocation()); } } }
to
{ Random rnd=new Random(); @Override public void run(){ Long hotObject=hotObjects.get(rnd.nextInt(hotObjects.size())); for (int y=0; y < 50; y++) { Long coldObject=new Long(coldCounter.incrementAndGet()); AllocationShape shape=new AllocationShape(); shape.setDataType(DataBuffer.Type.FLOAT); shape.setLength(2 * 1024 * 1024L); shape.setOffset(0); shape.setStride(1); allocator.registerSpan(coldObject,shape); allocator.getDevicePointer(hotObject); allocator.tackDevice(coldObject,shape); allocator.getDevicePointer(coldObject); allocator.tackDevice(coldObject,shape); coldObjects.add(coldObject); if (rnd.nextInt(10) < 2) { allocator.debug_remove_reference(coldObject); } } } }
{ @Override public void run(){ Random rand=new Random(); for (int x=0; x < 1000; x++) { int rnd=rand.nextInt(objects.size()); Long cObject=objects.get(rnd); AllocationPoint point=allocator.getAllocationPoint(cObject); Object pointer=allocator.getDevicePointer(cObject); allocator.tackDevice(cObject,point.getShape()); } } }
to
{ @Override public void run(){ Random rand=new Random(); for (int x=0; x < 1000; x++) { int rnd=rand.nextInt(objects.size()); Long cObject=objects.get(rnd); AllocationShape shape=new AllocationShape(); shape.setDataType(DataBuffer.Type.FLOAT); shape.setLength(1 * 1024 * 1024L); shape.setOffset(0); shape.setStride(1); Object pointer=allocator.getDevicePointer(cObject,shape); allocator.tackDevice(cObject,shape); } } }
Rename Variable
basicAllocator
to
allocatorPrototype
Update argument list (Method invocation)
getDevicePointer
to
getDevicePointer
Cascading Type Change (Different)
AllocationPoint
to
AllocationShape