Use guaranteePartial to allow more flexible GRVW/VW combos
@@ -1054,7 +1054,7 @@ class Solution:
state["VectorWidth"]))
return
- # Vector-width must be at least 2 for Half:
+ # Vector-width must be at least 2 for Half (since unroll loop uses packed operations?)
if state["KernelLanguage"] == "Assembly" \
and state["ProblemType"]["DataType"].isHalf() \
and state["VectorWidth"] < 2:
@@ -1064,11 +1064,6 @@ class Solution:
if state["GlobalReadVectorWidth"] == -1:
state["GlobalReadVectorWidth"] = state["VectorWidth"]
- if state["GlobalReadVectorWidth"] > 1 \
- and state["GlobalReadVectorWidth"] != state["VectorWidth"]:
- # TODO -this is only needed for the shift/unshift code - with some assertions
- # we can detect if that is needed or not
- reject(state, "GlobalReadVectorWidth must be <= VectorWidth")
if state["MinGlobalWriteVectorWidth"] == -1:
@@ -1499,12 +1494,25 @@ class Solution:
#--
# ShiftPtr can't use UseSgprForGRO since it needs to modify the VGPR pointers
- if state["BufferLoad"] and state["UseSgprForGRO"] \
- and state["EdgeType"]=="ShiftPtr":
+ if state["BufferLoad"] and state["UseSgprForGRO"] and state["EdgeType"]=="ShiftPtr":
if not state["GuaranteeNoPartialA"] or not state["GuaranteeNoPartialB"]:
state["UseSgprForGRO"] = False
#reject(state, "PBC with wide load has insufficient overlap guarantees- try GRVW=1 or adding appropriate Assert*ElementMultiple")
+ if not state["BufferLoad"] or not state["GuaranteeNoPartialA"]:
+ # Restrict GRVW/VW combos so shift-ptr logic will work
+ if state["GlobalLoadVectorWidthA"] > 1 \
+ and state["GlobalLoadVectorWidthA"] != state["VectorWidth"]:
+ reject(state, "GlobalLoadVectorWidthA %u must be == VectorWidth %u or == 1" % \
+ (state["GlobalLoadVectorWidthA"], state["VectorWidth"]))
+
+ if not state["BufferLoad"] or not state["GuaranteeNoPartialB"]:
+ # Restrict GRVW/VW combos so shift-ptr logic will work
+ if state["GlobalLoadVectorWidthB"] > 1 \
+ and state["GlobalLoadVectorWidthB"] != state["VectorWidth"]:
+ reject(state, "GlobalLoadVectorWidthB %u must be == VectorWidth %u or == 1" % \
+ (state["GlobalLoadVectorWidthB"], state["VectorWidth"]))
+
# Use SGPR to store an offset from GlobalReadOffsetA+0.
# (as opposed to using dedicated VGPR for each GRO
# Requires preciseBounds check since we rely on the buffer bounds check, not
