Beispiel #1
0
 def testMessageCuPy(self):
     sbuf = cupy.array([1,2,3], 'i')
     rbuf = cupy.array([0,0,0], 'i')
     smsg = [sbuf, [3], [0], [MPI.INT]]
     rmsg = [rbuf, ([3], [0]), [MPI.INT]]
     Alltoallw(smsg, rmsg)
     self.assertTrue((sbuf == rbuf).all())
Beispiel #2
0
 def __init__(self, typecode, initializer):
     self._buf = cupy.array(initializer, dtype=typecode)
     self.has_dlpack = hasattr(self._buf, '__dlpack_device__')
     # TODO(leofang): test CUDA managed memory?
     if cupy.cuda.runtime.is_hip:
         self.dev_type = dlpack.DLDeviceType.kDLROCM
     else:
         self.dev_type = dlpack.DLDeviceType.kDLCUDA
Beispiel #3
0
 def array(self, typecode, initializer):
     return cupy.array(initializer, dtype=typecode)
Beispiel #4
0
 def testMessageCuPy(self):
     sbuf = cupy.array([1,2,3], 'i')
     rbuf = cupy.array([0,0,0], 'i')
     PutGet(sbuf, rbuf)
     self.assertTrue((sbuf == rbuf).all())