Skip to content

Commit

Permalink
Removed commented out code in ring.py
Browse files Browse the repository at this point in the history
Cherry-picked from c2778a1
on branch apr2022-prune, PR #178
  • Loading branch information
jaycedowell authored and league committed Jul 20, 2023
1 parent 0d1f8d2 commit ef644d3
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions python/bifrost/ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,35 +114,6 @@ def read(self, whence: str='earliest', guarantee: bool=True) -> "ReadSequence":
cur_seq.increment()
except EndOfDataStop:
return
#def _data(self):
# data_ptr = _get(self.lib.bfRingLockedGetData, self.obj)
# #data_ptr = c_void_p()
# #self._check( self.lib.bfRingLockedGetData(self.obj, pointer(data_ptr)) )
# #data_ptr = data_ptr.value
# #data_ptr = self.lib.bfRingLockedGetData(self.obj)
# if self.space == 'cuda':
# # TODO: See if can wrap this in something like PyCUDA's GPUArray
# # Ideally actual GPUArray, but it doesn't appear to support wrapping pointers
# return data_ptr
# span = self._total_span()
# stride = self._stride()
# nringlet = self._nringlet()
# #print("******", span, stride, nringlet)
# BufferType = c_byte*(nringlet*stride)
# data_buffer_ptr = cast(data_ptr, POINTER(BufferType))
# data_buffer = data_buffer_ptr.contents
# data_array = np.ndarray(shape=(nringlet, span),
# strides=(stride, 1) if nringlet > 1 else None,
# buffer=data_buffer, dtype=np.uint8)
# return data_array
#def _contiguous_span(self):
# return self._get(BFsize, self.lib.bfRingLockedGetContiguousSpan, self.obj)
#def _total_span(self):
# return self._get(BFsize, self.lib.bfRingLockedGetTotalSpan, self.obj)
#def _nringlet(self):
# return self._get(BFsize, self.lib.bfRingLockedGetNRinglet, self.obj)
#def _stride(self):
# return self._get(BFsize, self.lib.bfRingLockedGetStride, self.obj)

class RingWriter(object):
def __init__(self, ring: Ring):
Expand Down Expand Up @@ -308,15 +279,8 @@ def data_view(self, dtype: Union[str,np.dtype]=np.uint8,
assert( self.size % itemsize == 0 )
assert( self.stride % itemsize == 0 )
data_ptr = self._data_ptr
#if self.sequence.ring.space == 'cuda':
# # TODO: See if can wrap this in something like PyCUDA's GPUArray
# # Ideally actual GPUArray, but it doesn't appear to support wrapping pointers
# # Could also try writing a custom GPUArray implem for this purpose
# return data_ptr
span_size = self.size
nringlet = self.nringlet
#print("******", span_size, stride, nringlet)
#BufferType = c_byte*(span_size*self.stride)
# TODO: We should really map the actual ring memory space and index
# it with offset rather than mapping from the current pointer.
_shape = (nringlet, span_size // itemsize)
Expand Down

0 comments on commit ef644d3

Please sign in to comment.