aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrzej Janik <[email protected]>2020-12-12 20:37:36 +0100
committerAndrzej Janik <[email protected]>2020-12-12 20:37:36 +0100
commite7b663d55787e2b64906fe4f0d16216601826c38 (patch)
tree3c8311cb217284656e8f38e6b57fe3e427776d18
parent8b8a688cef7d6217311655d2e6fe53b57797d396 (diff)
downloadZLUDA-e7b663d55787e2b64906fe4f0d16216601826c38.tar.gz
ZLUDA-e7b663d55787e2b64906fe4f0d16216601826c38.zip
Mark loads and stores as alignedbuiltin_fixes_try2
-rw-r--r--ptx/src/translate.rs19
1 files changed, 17 insertions, 2 deletions
diff --git a/ptx/src/translate.rs b/ptx/src/translate.rs
index 2b4f593..700bdcd 100644
--- a/ptx/src/translate.rs
+++ b/ptx/src/translate.rs
@@ -2789,13 +2789,28 @@ fn emit_function_body_ops(
}
let result_type =
map.get_or_add(builder, SpirvType::from(ast::Type::from(data.typ.clone())));
- builder.load(result_type, Some(arg.dst), arg.src, None, [])?;
+ builder.load(
+ result_type,
+ Some(arg.dst),
+ arg.src,
+ Some(spirv::MemoryAccess::ALIGNED),
+ [dr::Operand::LiteralInt32(
+ ast::Type::from(data.typ.clone()).size_of() as u32,
+ )],
+ )?;
}
ast::Instruction::St(data, arg) => {
if data.qualifier != ast::LdStQualifier::Weak {
todo!()
}
- builder.store(arg.src1, arg.src2, None, &[])?;
+ builder.store(
+ arg.src1,
+ arg.src2,
+ Some(spirv::MemoryAccess::ALIGNED),
+ [dr::Operand::LiteralInt32(
+ ast::Type::from(data.typ.clone()).size_of() as u32,
+ )],
+ )?;
}
// SPIR-V does not support ret as guaranteed-converged
ast::Instruction::Ret(_) => builder.ret()?,