Skip to content

Commit

Permalink
disable debug info in PTX until LLVM 14
Browse files Browse the repository at this point in the history
  • Loading branch information
gwenzek committed Mar 18, 2022
1 parent f3f5a5d commit 9535a3c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions lib/std/target.zig
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,13 @@ pub const Target = struct {
};
}

pub fn isPtx(arch: Arch) bool {
return switch (arch) {
.nvptx, .nvptx64 => true,
else => false,
};
}

pub fn parseCpuModel(arch: Arch, cpu_name: []const u8) !*const Cpu.Model {
for (arch.allCpuModels()) |cpu| {
if (mem.eql(u8, cpu_name, cpu.name)) {
Expand Down
4 changes: 3 additions & 1 deletion src/target.zig
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,9 @@ pub fn classifyCompilerRtLibName(target: std.Target, name: []const u8) CompilerR
}

pub fn hasDebugInfo(target: std.Target) bool {
return !target.cpu.arch.isWasm();
// Debug info will be supported by PTX 7.5, which will come to Zig with LLVM 14
// TODO(gwenzek): Check the target ptx version and keep debug info if possible
return !(target.cpu.arch.isWasm() or target.cpu.arch.isPtx());
}

pub fn defaultCompilerRtOptimizeMode(target: std.Target) std.builtin.Mode {
Expand Down

0 comments on commit 9535a3c

Please sign in to comment.