(self, array, struct_arr_ptr)
numpy.getbuffer() needed due to lack of new-style buffer interface for
        scalar numpy arrays as of numpy version 1.9.1

        see: https://github.com/inducer/pycuda/pull/60
numpy.getbuffer() needed due to lack of new-style buffer interface for
        scalar numpy arrays as of numpy version 1.9.1
numpy . getbuffer () needed due to lack of new - style buffer interface for scalar numpy arrays as of numpy version 1 . 9 . 1
def __init__(self, array, struct_arr_ptr):
        self.data = cuda.to_device(array)
        self.shape, self.dtype = array.shape, array.dtype
        """
        numpy.getbuffer() needed due to lack of new-style buffer interface for
        scalar numpy arrays as of numpy version 1.9.1

        see: https://github.com/inducer/pycuda/pull/60
        """
        cuda.memcpy_htod(int(struct_arr_ptr),
                         numpy.getbuffer(numpy.int32(array.size)))
        cuda.memcpy_htod(int(struct_arr_ptr) + 8,
                         numpy.getbuffer(numpy.uintp(int(self.data))))
def __init__ ( self , array , struct_arr_ptr ) : self . data = cuda . to_device ( array ) self . shape , self . dtype = array . shape , array . dtype cuda . memcpy_htod ( int ( struct_arr_ptr ) , numpy . getbuffer ( numpy . int32 ( array . size ) ) ) cuda . memcpy_htod ( int ( struct_arr_ptr ) + 8 , numpy . getbuffer ( numpy . uintp ( int ( self . data ) ) ) )