mirror of
				https://github.com/stevenrobertson/cuburn.git
				synced 2025-11-03 18:00:55 -05:00 
			
		
		
		
	Add support for writing float literals in store_per_thread
This commit is contained in:
		@ -673,6 +673,10 @@ class _PTXStdLib(PTXFragment):
 | 
				
			|||||||
            op.mov.u32(spt_base, base)
 | 
					            op.mov.u32(spt_base, base)
 | 
				
			||||||
            self.get_gtid(spt_offset)
 | 
					            self.get_gtid(spt_offset)
 | 
				
			||||||
            op.mad.lo.u32(spt_base, spt_offset, 4, spt_base)
 | 
					            op.mad.lo.u32(spt_base, spt_offset, 4, spt_base)
 | 
				
			||||||
 | 
					            if isinstance(val, float):
 | 
				
			||||||
 | 
					                # Turn a constant float into the big-endian PTX binary float
 | 
				
			||||||
 | 
					                # representation, 0fXXXXXXXX (where XX is hex byte)
 | 
				
			||||||
 | 
					                val = '0f%x%x%x%x' % reversed(map(ord, struct.pack('f', val)))
 | 
				
			||||||
            op.st.b32(addr(spt_base), val)
 | 
					            op.st.b32(addr(spt_base), val)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @ptx_func
 | 
					    @ptx_func
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user