summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrzej Janik <[email protected]>2020-11-18 23:41:41 +0100
committerAndrzej Janik <[email protected]>2020-11-18 23:41:41 +0100
commitc4437762915fc99754f778be0f65289249917a06 (patch)
tree5e3518c6458a60adc10e464b1694ca2467c1d937
parentc8078071fd1eedebd94c9fd0ad81d65607bb8da1 (diff)
downloadZLUDA-c4437762915fc99754f778be0f65289249917a06.tar.gz
ZLUDA-c4437762915fc99754f778be0f65289249917a06.zip
Fix test
-rw-r--r--ptx/src/test/spirv_run/stateful_ld_st_simple.spvtxt12
-rw-r--r--ptx/src/translate.rs6
2 files changed, 10 insertions, 8 deletions
diff --git a/ptx/src/test/spirv_run/stateful_ld_st_simple.spvtxt b/ptx/src/test/spirv_run/stateful_ld_st_simple.spvtxt
index 1d28996..32b122b 100644
--- a/ptx/src/test/spirv_run/stateful_ld_st_simple.spvtxt
+++ b/ptx/src/test/spirv_run/stateful_ld_st_simple.spvtxt
@@ -38,27 +38,27 @@
%16 = OpBitcast %_ptr_Function_ulong %3
%15 = OpLoad %ulong %16
%26 = OpConvertUToPtr %_ptr_CrossWorkgroup_uchar %15
- OpStore %11 %26
+ OpStore %10 %26
%27 = OpLoad %_ptr_CrossWorkgroup_uchar %9
%18 = OpConvertPtrToU %ulong %27
%36 = OpCopyObject %ulong %18
%35 = OpCopyObject %ulong %36
%17 = OpCopyObject %ulong %35
%28 = OpConvertUToPtr %_ptr_CrossWorkgroup_uchar %17
- OpStore %12 %28
- %29 = OpLoad %_ptr_CrossWorkgroup_uchar %11
+ OpStore %11 %28
+ %29 = OpLoad %_ptr_CrossWorkgroup_uchar %10
%20 = OpConvertPtrToU %ulong %29
%38 = OpCopyObject %ulong %20
%37 = OpCopyObject %ulong %38
%19 = OpCopyObject %ulong %37
%30 = OpConvertUToPtr %_ptr_CrossWorkgroup_uchar %19
- OpStore %10 %30
- %31 = OpLoad %_ptr_CrossWorkgroup_uchar %12
+ OpStore %12 %30
+ %31 = OpLoad %_ptr_CrossWorkgroup_uchar %11
%21 = OpConvertPtrToU %ulong %31
%39 = OpConvertUToPtr %_ptr_CrossWorkgroup_ulong %21
%32 = OpLoad %ulong %39
OpStore %8 %32
- %33 = OpLoad %_ptr_CrossWorkgroup_uchar %10
+ %33 = OpLoad %_ptr_CrossWorkgroup_uchar %12
%22 = OpConvertPtrToU %ulong %33
%34 = OpLoad %ulong %8
%40 = OpConvertUToPtr %_ptr_CrossWorkgroup_ulong %22
diff --git a/ptx/src/translate.rs b/ptx/src/translate.rs
index ef2c1c5..fa84043 100644
--- a/ptx/src/translate.rs
+++ b/ptx/src/translate.rs
@@ -1,7 +1,7 @@
use crate::ast;
use half::f16;
use rspirv::dr;
-use std::{borrow::Cow, ffi::CString, hash::Hash, iter, mem};
+use std::{collections::BTreeSet, borrow::Cow, ffi::CString, hash::Hash, iter, mem};
use std::{
collections::{hash_map, HashMap, HashSet},
convert::TryInto,
@@ -4273,7 +4273,9 @@ fn convert_to_stateful_memory_access<'a>(
}
}
let mut func_args_ptr = HashSet::new();
- let mut regs_ptr_current = HashSet::new();
+ // BTreeSet here to have a stable order of iteration,
+ // unfortunately our tests rely on it
+ let mut regs_ptr_current = BTreeSet::new();
for (dst, src) in stateful_markers {
if let Some(func_args) = stateful_init_reg.get(&src) {
for a in func_args {