stage2: add support for Nvptx target
sample command: /home/guw/github/zig/stage2/bin/zig build-obj cuda_kernel.zig -target nvptx64-cuda -O ReleaseSafe this will create a kernel.ptx expose PtxKernel call convention from LLVM kernels are `export fn f() callconv(.PtxKernel)`
This commit is contained in:
@@ -4242,7 +4242,7 @@ fn scanDecl(iter: *ScanDeclIter, decl_sub_index: usize, flags: u4) SemaError!voi
|
||||
// in `Decl` to notice that the line number did not change.
|
||||
mod.comp.work_queue.writeItemAssumeCapacity(.{ .update_line_number = decl });
|
||||
},
|
||||
.c, .wasm, .spirv => {},
|
||||
.c, .wasm, .spirv, .nvptx => {},
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4316,6 +4316,7 @@ pub fn clearDecl(
|
||||
.c => .{ .c = {} },
|
||||
.wasm => .{ .wasm = link.File.Wasm.DeclBlock.empty },
|
||||
.spirv => .{ .spirv = {} },
|
||||
.nvptx => .{ .nvptx = {} },
|
||||
};
|
||||
decl.fn_link = switch (mod.comp.bin_file.tag) {
|
||||
.coff => .{ .coff = {} },
|
||||
@@ -4325,6 +4326,7 @@ pub fn clearDecl(
|
||||
.c => .{ .c = {} },
|
||||
.wasm => .{ .wasm = link.File.Wasm.FnData.empty },
|
||||
.spirv => .{ .spirv = .{} },
|
||||
.nvptx => .{ .nvptx = .{} },
|
||||
};
|
||||
}
|
||||
if (decl.getInnerNamespace()) |namespace| {
|
||||
@@ -4652,6 +4654,7 @@ pub fn allocateNewDecl(
|
||||
.c => .{ .c = {} },
|
||||
.wasm => .{ .wasm = link.File.Wasm.DeclBlock.empty },
|
||||
.spirv => .{ .spirv = {} },
|
||||
.nvptx => .{ .nvptx = {} },
|
||||
},
|
||||
.fn_link = switch (mod.comp.bin_file.tag) {
|
||||
.coff => .{ .coff = {} },
|
||||
@@ -4661,6 +4664,7 @@ pub fn allocateNewDecl(
|
||||
.c => .{ .c = {} },
|
||||
.wasm => .{ .wasm = link.File.Wasm.FnData.empty },
|
||||
.spirv => .{ .spirv = .{} },
|
||||
.nvptx => .{ .nvptx = .{} },
|
||||
},
|
||||
.generation = 0,
|
||||
.is_pub = false,
|
||||
|
||||
Reference in New Issue
Block a user