mirror of
				https://github.com/stevenrobertson/cuburn.git
				synced 2025-11-03 18:00:55 -05:00 
			
		
		
		
	Fix MWC unit test (prior to porting it)
This commit is contained in:
		@ -102,14 +102,14 @@ def test_mwc(rounds=5000, nblocks=64, blockwidth=512):
 | 
				
			|||||||
        print "Trial %d, on CPU: " % trial,
 | 
					        print "Trial %d, on CPU: " % trial,
 | 
				
			||||||
        sums = np.zeros(nthreads, dtype=np.uint64)
 | 
					        sums = np.zeros(nthreads, dtype=np.uint64)
 | 
				
			||||||
        ctime = time.time()
 | 
					        ctime = time.time()
 | 
				
			||||||
        mults = seeds[0].astype(np.uint64)
 | 
					        mults = seeds[:,0].astype(np.uint64)
 | 
				
			||||||
        states = seeds[1]
 | 
					        states = seeds[:,1]
 | 
				
			||||||
        carries = seeds[2]
 | 
					        carries = seeds[:,2]
 | 
				
			||||||
        for i in range(rounds):
 | 
					        for i in range(rounds):
 | 
				
			||||||
            step = np.frombuffer((mults * states + carries).data,
 | 
					            step = np.frombuffer((mults * states + carries).data,
 | 
				
			||||||
                       dtype=np.uint32).reshape((2, nthreads), order='F')
 | 
					                       dtype=np.uint32).reshape((nthreads, 2))
 | 
				
			||||||
            states[:] = step[0]
 | 
					            states[:] = step[:,0]
 | 
				
			||||||
            carries[:] = step[1]
 | 
					            carries[:] = step[:,1]
 | 
				
			||||||
            sums += states
 | 
					            sums += states
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        ctime = time.time() - ctime
 | 
					        ctime = time.time() - ctime
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user