def test_Macro(useGlobalParameters): """ Test a multi-line kernel that defines a macro. """ with useGlobalParameters(): thekernel = r""" .text .macro _v_add_co_u32 dst:req, cc:req, src0:req, src1:req, dpp= v_add_co_u32 \dst, \cc, \src0, \src1 \dpp .endm .set vgprLocalReadAddrB, 93 _v_add_co_u32 v[vgprLocalReadAddrB+0], vcc, 0x400, v[vgprLocalReadAddrB+0] a_label: v_add_co_u32 v[vgprLocalReadAddrB+0], vcc, 0x400, v[vgprLocalReadAddrB+0] _v_add_co_u32 v[vgprLocalReadAddrB+0], vcc, 0x400, v[vgprLocalReadAddrB+0] """ assert tryAssembler((10, 1, 0), thekernel.format(arch="gfx1010"), True, '-mcode-object-v3') assert tryAssembler((10, 1, 1), thekernel.format(arch="gfx1011")) assert not tryAssembler((8, 0, 3), thekernel.format(arch="gfx803"))
def test_Options(useGlobalParameters): with useGlobalParameters(): assert tryAssembler((9, 0, 6), "", False, "-mno-code-object-v3")
def test_Simple(useGlobalParameters): with useGlobalParameters(): assert tryAssembler((9, 0, 0), "") assert not tryAssembler((20, 0, 0), "")