aboutsummaryrefslogtreecommitdiff
path: root/src/Module.zig
diff options
context:
space:
mode:
authorgwenzek <gwenzek@users.noreply.github.com>2022-02-05 15:33:00 +0100
committerGitHub <noreply@github.com>2022-02-05 16:33:00 +0200
commit0e1afb4d986c3316c6f024be50612b0a6c66777b (patch)
tree7b2bc69ae80604165ce4d11bf72ef104d4b51f86 /src/Module.zig
parentfbc06f9c9151205896fb167b087506d6580946c4 (diff)
downloadzig-0e1afb4d986c3316c6f024be50612b0a6c66777b.tar.gz
zig-0e1afb4d986c3316c6f024be50612b0a6c66777b.zip
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)`
Diffstat (limited to 'src/Module.zig')
-rw-r--r--src/Module.zig6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Module.zig b/src/Module.zig
index e2e2505927..eeed6b2dc9 100644
--- a/src/Module.zig
+++ b/src/Module.zig
@@ -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,