aboutsummaryrefslogtreecommitdiffhomepage
path: root/ptx_parser/src/ast.rs
diff options
context:
space:
mode:
authorAndrzej Janik <[email protected]>2024-09-13 01:07:31 +0200
committerGitHub <[email protected]>2024-09-13 01:07:31 +0200
commit46def3e7e09dbf4d3e7287a72bfecb73e6e429c5 (patch)
tree6eebad3f9722ee9127c2640300ae20047d4acd9d /ptx_parser/src/ast.rs
parent193eb29be825370449afb1fe2358f6a654aa0986 (diff)
downloadZLUDA-46def3e7e09dbf4d3e7287a72bfecb73e6e429c5.tar.gz
ZLUDA-46def3e7e09dbf4d3e7287a72bfecb73e6e429c5.zip
Connect new parser to LLVM bitcode backend (#269)
This is very incomplete. Just enough code to emit LLVM bitcode and continue further development
Diffstat (limited to 'ptx_parser/src/ast.rs')
-rw-r--r--ptx_parser/src/ast.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/ptx_parser/src/ast.rs b/ptx_parser/src/ast.rs
index d0dc303..a90b21e 100644
--- a/ptx_parser/src/ast.rs
+++ b/ptx_parser/src/ast.rs
@@ -1040,6 +1040,15 @@ pub enum MethodName<'input, ID> {
Func(ID),
}
+impl<'input, ID> MethodName<'input, ID> {
+ pub fn is_kernel(&self) -> bool {
+ match self {
+ MethodName::Kernel(_) => true,
+ MethodName::Func(_) => false,
+ }
+ }
+}
+
bitflags! {
pub struct LinkingDirective: u8 {
const NONE = 0b000;
@@ -1128,7 +1137,7 @@ impl SetpData {
state.errors.push(PtxError::NonF32Ftz);
None
}
- _ => None
+ _ => None,
};
let type_kind = type_.kind();
let cmp_op = if type_kind == ScalarKind::Float {