Add AIR compatibility#2934
Conversation
|
@wsmoses Looks like most tests passed. The ones that failed seem to have failed due to air.atan2.f32. Is that a function that is supported normally anyways? |
| // module. Rather than depend on that, these get dedicated blocks so the | ||
| // AIR-named companion (e.g. air.cosh.f32) is created directly on demand, | ||
| // regardless of what else is present in the module. | ||
| def : CallPattern<(Op $x), |
There was a problem hiding this comment.
You are missing air.atan2.f32. here?
|
clang format fails. also @pw0908 for correctness you'll also likely need to add metal to the list of uses like Enzyme/enzyme/Enzyme/Enzyme.cpp Line 1462 in 7be5247 |
|
|
||
| bool AtomicAdd = Arch == Triple::nvptx || Arch == Triple::nvptx64 || | ||
| Arch == Triple::amdgcn; | ||
| Arch == Triple::amdgcn || TT.getArchName() == "air64"; |
There was a problem hiding this comment.
Look for all uses of amd_target / amdgcn in the codebase, I think this needs to be applied more broadly. Perhaps a helper function in utils.h for all gpu arch's would be useful?
|
ci shows this fails to build |
| // thread-id/barrier codegen below only knows how to handle | ||
| // NVPTX and AMDGPU (it is unreachable for any other arch, e.g. | ||
| // Metal air64). | ||
| if ((Arch == Triple::nvptx || Arch == Triple::nvptx64 || |
There was a problem hiding this comment.
this shouldn't be intentional, it should actually do isGPUArch && g.getType()->getAddressSpace() == getGPUSharedAddrSpace(TT)
Addresses EnzymeAD/Enzyme.jl#3289