diff options
Diffstat (limited to 'ptx/src/ast.rs')
-rw-r--r-- | ptx/src/ast.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ptx/src/ast.rs b/ptx/src/ast.rs index aba6bda..d81cd66 100644 --- a/ptx/src/ast.rs +++ b/ptx/src/ast.rs @@ -294,6 +294,17 @@ pub enum KernelArgumentType { Shared, } +impl From<KernelArgumentType> for Type { + fn from(this: KernelArgumentType) -> Self { + match this { + KernelArgumentType::Normal(typ) => typ.into(), + KernelArgumentType::Shared => { + Type::Pointer(PointerType::Scalar(ScalarType::B8), LdStateSpace::Shared) + } + } + } +} + impl FnArgumentType { pub fn to_type(&self, is_kernel: bool) -> Type { if is_kernel { |