(self, state=None)
return
Set on device RNG states to values given by "state" input.

        Arguments:
            state (np.array or None): an array of uint32 values used to
                                      set the state of the on device LFSRs.
                                      if set to None, the state will be created
                                      randomly
Set on device RNG states to values given by "state" input.
Set on device RNG states to values given by state input .
def _set_rand_state_dev(self, state=None):
        """
        Set on device RNG states to values given by "state" input.

        Arguments:
            state (np.array or None): an array of uint32 values used to
                                      set the state of the on device LFSRs.
                                      if set to None, the state will be created
                                      randomly
        """
        ctx = drv.Context.get_current()
        if state is None:
            state = self._gen_dev_randstate()
        if ctx in self.context_rand_state_map:
            rand_state = self.context_rand_state_map[ctx]
        else:
            rand_state = drv.mem_alloc(state.nbytes)
            self.context_rand_state_map[ctx] = rand_state
        drv.memcpy_htod(rand_state, state)
        self.context_rand_state_alive[ctx] = True
        return
def _set_rand_state_dev ( self , state = None ) : ctx = drv . Context . get_current ( ) if state is None : state = self . _gen_dev_randstate ( ) if ctx in self . context_rand_state_map : rand_state = self . context_rand_state_map [ ctx ] else : rand_state = drv . mem_alloc ( state . nbytes ) self . context_rand_state_map [ ctx ] = rand_state drv . memcpy_htod ( rand_state , state ) self . context_rand_state_alive [ ctx ] = True return