Skip to content

Commit

Permalink
Fix compilation when ARCH_REQ_XCOMP_PERM isn't defined (triton-lang#163)
Browse files Browse the repository at this point in the history
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
  • Loading branch information
int3 authored Oct 21, 2024
1 parent ce86987 commit 0200191
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions third_party/cpu/triton_cpu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ void init_triton_cpu(py::module &&m) {
init_triton_cpu_passes_ttcpuir(passes.def_submodule("ttcpuir"));

m.def("enable_amx", []() -> bool {
#ifdef ARCH_REQ_XCOMP_PERM
// AMX usage requires extended XSTATE which is disabled by default. We
// need to request access to AMX so that XSTATE was dynamically extended
// on the first AMX usage instead of issuing SIGILL.
Expand All @@ -168,6 +169,9 @@ void init_triton_cpu(py::module &&m) {
if (syscall(SYS_arch_prctl, ARCH_REQ_XCOMP_PERM, XFEATURE_XTILEDATA))
return false;
return true;
#else
return false;
#endif
});

m.def("load_dialects", [](mlir::MLIRContext &context) {
Expand Down

0 comments on commit 0200191

Please sign in to comment.