add NVPTX for LLVM 3.2;

auto-gen _intrinsic_ids.py  in setup.py;
This commit is contained in:
Siu Kwan Lam 2012-08-18 15:29:26 -07:00
commit d1bcdd05d1
9 changed files with 99 additions and 1961 deletions

View file

@ -19,17 +19,22 @@ class TestTargetMachines(unittest.TestCase):
self.assertIn('foo', tm.emit_assembly(m).decode('utf-8'))
def test_ptx(self):
if HAS_PTX:
arch = 'ptx64'
elif HAS_NVPTX:
arch = 'nvptx64'
else:
return # skip this test
m, func = self._build_module()
func.calling_convention = CC_PTX_KERNEL # set calling conv
ptxtm = TargetMachine.lookup(arch='ptx64', cpu='compute_20',
features='-double')
ptxtm = TargetMachine.lookup(arch=arch, cpu='compute_20')
self.assertTrue(ptxtm.triple)
self.assertTrue(ptxtm.cpu)
self.assertTrue(ptxtm.feature_string)
ptxasm = ptxtm.emit_assembly(m).decode('utf-8')
self.assertIn('foo', ptxasm)
self.assertIn('map_f64_to_f32', ptxasm)
self.assertIn('compute_10', ptxasm)
if HAS_NVPTX:
self.assertIn('.address_size 64', ptxasm)
self.assertIn('compute_20', ptxasm)
def _build_module(self):
m = Module.new('TestTargetMachines')