| ... | @@ -89,7 +89,14 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 { | ... | @@ -89,7 +89,14 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 { |
| 89 | .spu_2 => return error.@"LLVM backend does not support SPU Mark II", | 89 | .spu_2 => return error.@"LLVM backend does not support SPU Mark II", |
| 90 | }; | 90 | }; |
| 91 | try llvm_triple.appendSlice(llvm_arch); | 91 | try llvm_triple.appendSlice(llvm_arch); |
| 92 | try llvm_triple.appendSlice("-unknown-"); | 92 | |
| | 93 | // Unlike CPU backends, GPU backends actually care about the vendor tag. |
| | 94 | try llvm_triple.appendSlice(switch (target.cpu.arch) { |
| | 95 | .amdgcn => if (target.os.tag == .mesa3d) "-mesa-" else "-amd-", |
| | 96 | .nvptx, .nvptx64 => "-nvidia-", |
| | 97 | .spirv64 => if (target.os.tag == .amdhsa) "-amd-" else "-unknown-", |
| | 98 | else => "-unknown-", |
| | 99 | }); |
| 93 | | 100 | |
| 94 | const llvm_os = switch (target.os.tag) { | 101 | const llvm_os = switch (target.os.tag) { |
| 95 | .freestanding => "unknown", | 102 | .freestanding => "unknown", |