aboutsummaryrefslogtreecommitdiffhomepage
path: root/ptx/src/ast.rs
diff options
context:
space:
mode:
authorAndrzej Janik <[email protected]>2021-01-16 22:28:48 +0100
committerGitHub <[email protected]>2021-01-16 22:28:48 +0100
commitff8135e8a308e8e3e155e6873989423ccad7a27a (patch)
tree7b34d0d7b8944c28fd1c3ecbff1af7ca5ef6767b /ptx/src/ast.rs
parent09f679693bec135776380c92409f4693587ff482 (diff)
downloadZLUDA-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.rs11
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 {