Exemple #1
0
def test_int32():
    obj = DataType(6)
    assert obj.toChar() == 'I'
    assert obj.toName() == 'int32'
    assert obj.toEnum() == 'Int32'
    assert obj.toOpenCL() == 'ERROR'
    assert obj.toHIP() == 'int32_t'
    assert obj.toDevice("OCL") == 'ERROR'
    assert obj.toDevice("") == 'int32_t'
    assert obj.toCpp() == 'TensileInt32'
    assert obj.getLibString() == 'tensileDataTypeInt32'
    assert obj.numBytes() == 4
    assert obj.isReal()
Exemple #2
0
def test_half():
    obj = DataType(4)
    assert obj.toChar() == 'H'
    assert obj.toName() == 'half'
    assert obj.toEnum() == 'Half'
    assert obj.toOpenCL() == 'ERROR'
    assert obj.toHIP() == 'tensile_half'
    assert obj.toDevice("OCL") == 'ERROR'
    assert obj.toDevice("") == 'tensile_half'
    assert obj.toCpp() == 'TensileHalf'
    assert obj.getLibString() == 'tensileDataTypeHalf'   
    assert obj.numBytes() == 2    
    assert obj.isReal()