diff options
author | Andrzej Janik <[email protected]> | 2021-01-16 22:28:48 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-16 22:28:48 +0100 |
commit | ff8135e8a308e8e3e155e6873989423ccad7a27a (patch) | |
tree | 7b34d0d7b8944c28fd1c3ecbff1af7ca5ef6767b /ptx/src/ast.rs | |
parent | 09f679693bec135776380c92409f4693587ff482 (diff) | |
download | ZLUDA-ff8135e8a308e8e3e155e6873989423ccad7a27a.tar.gz ZLUDA-ff8135e8a308e8e3e155e6873989423ccad7a27a.zip |
Add a library for dumping kernels arguments before and after launch (#18)
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 { |