def testCompileMultipleBackends(self): binary = compiler.compile_str( SIMPLE_MUL_ASM, target_backends=["dylib-llvm-aot", "vulkan-spirv"]) logging.info("Flatbuffer size = %d", len(binary)) self.assertTrue(binary)
def testCompileStrLLVMAOT(self): binary = compiler.compile_str(SIMPLE_MUL_ASM, target_backends=["dylib-llvm-aot"]) logging.info("Flatbuffer size = %d", len(binary)) self.assertTrue(binary)
def testNoTargetBackends(self): with self.assertRaisesRegex( ValueError, "Expected a non-empty list for 'target_backends'"): binary = compiler.compile_str(SIMPLE_MUL_ASM)
def testCompileStr(self): binary = compiler.compile_str( SIMPLE_MUL_ASM, target_backends=compiler.DEFAULT_TESTING_BACKENDS) logging.info("Flatbuffer size = %d", len(binary)) self.assertTrue(binary)
def testException(self): with self.assertRaisesRegex(compiler.CompilerToolError, "Invoked with"): _ = compiler.compile_str( "I'm a little teapot but not a valid program", target_backends=compiler.DEFAULT_TESTING_BACKENDS)