aboutsummaryrefslogtreecommitdiff
path: root/src/type.zig
diff options
context:
space:
mode:
authorCody Tapscott <topolarity@tapscott.me>2022-10-21 20:16:00 -0700
committerCody Tapscott <topolarity@tapscott.me>2022-10-21 20:16:00 -0700
commit94945864b9d8ffa7b707432fb877ae42e383db68 (patch)
tree3bafa236b08b990e5911953e5ad7f023820dfea5 /src/type.zig
parentf0e66ac4d0e6347bf1b5a00b309fafb5da84191b (diff)
downloadzig-94945864b9d8ffa7b707432fb877ae42e383db68.tar.gz
zig-94945864b9d8ffa7b707432fb877ae42e383db68.zip
Type.zig: Add `nvcl`/`cuda` CType definitions
Diffstat (limited to 'src/type.zig')
-rw-r--r--src/type.zig14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/type.zig b/src/type.zig
index bcb8969484..51b326e18e 100644
--- a/src/type.zig
+++ b/src/type.zig
@@ -6862,6 +6862,18 @@ pub const CType = enum {
},
},
+ .nvcl, .cuda => switch (self) {
+ .short, .ushort => return 16,
+ .int, .uint, .float => return 32,
+ .long, .ulong => switch (target.cpu.arch) {
+ .nvptx => return 32,
+ .nvptx64 => return 64,
+ else => return 64,
+ },
+ .longlong, .ulonglong, .double => return 64,
+ .longdouble => return 64,
+ },
+
.amdhsa, .amdpal => switch (self) {
.short, .ushort => return 16,
.int, .uint, .float => return 32,
@@ -6876,8 +6888,6 @@ pub const CType = enum {
.rtems,
.nacl,
.aix,
- .cuda,
- .nvcl,
.ps4,
.ps5,
.elfiamcu,