[FRONTEND] Added volatile flag for load (#407)

This commit is contained in:
Philippe Tillet
2021-12-30 22:33:24 -08:00
committed by GitHub
parent 985798f101
commit 03f1256f60
11 changed files with 51 additions and 37 deletions

View File

@@ -600,7 +600,8 @@ void init_triton_ir(py::module &&m) {
py::class_<ir::constant_int, ir::constant>(m, "constant_int")
.def_property_readonly("value", &ir::constant_int::get_value)
.def("__int__", [](ir::constant_int *self) { return self->get_value(); });
.def("__int__", [](ir::constant_int *self) { return self->get_value(); })
.def("__bool__", [](ir::constant_int *self) { return self->get_value(); });
py::class_<ir::constant_fp, ir::constant>(m, "constant_float")
.def_property_readonly("value", &ir::constant_fp::get_value);

View File

@@ -519,7 +519,7 @@ def dot(input, other, _builder=None):
@builtin
def load(pointer, mask=None, other=None, cache_modifier="", _builder=None):
def load(pointer, mask=None, other=None, cache_modifier="", volatile=False, _builder=None):
"""
Return a block of data whose values are, elementwise, loaded from memory at location defined by :code:`pointer`.
@@ -536,7 +536,7 @@ def load(pointer, mask=None, other=None, cache_modifier="", _builder=None):
:param cache_modifier: changes cache option in nvidia ptx
'type cache_modifier: str, optional
"""
return frontend.load(pointer, mask, other, cache_modifier, _builder)
return frontend.load(pointer, mask, other, cache_modifier, volatile, _builder)
@builtin