From 85c6b0f0bcda2e3bb2dc5f3347e5c6712d268a39 Mon Sep 17 00:00:00 2001 From: Guillaume Wenzek Date: Tue, 9 Aug 2022 15:37:08 +0200 Subject: [PATCH] allow ptx kernel export --- src/Sema.zig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Sema.zig b/src/Sema.zig index 1b2bf84885..da3dea6125 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -21397,7 +21397,12 @@ fn validateExternType( }, .Fn => { if (position != .other) return false; - return !Type.fnCallingConventionAllowsZigTypes(ty.fnCallingConvention()); + return switch (ty.fnCallingConvention()) { + // For now we want to authorize PTX kernel to use zig objects, even if we end up exposing the ABI. + // The goal is to experiment with more integrated CPU/GPU code. + .PtxKernel => true, + else => !Type.fnCallingConventionAllowsZigTypes(ty.fnCallingConvention()), + }; }, .Enum => { var buf: Type.Payload.Bits = undefined;