Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Journeyman III

Ternary operator reduce funtion error in float4

After reading that float4 cloud increase performance I tried to change my finding min max funtion to float4 types.

At first:

reduce void(float4 a<>, reduce float4 b<>)


if(a.x > b.x)

b.x = a.x;

if(a.y > b.y)

b.y = a.y;

if(a.z > b.z)

b.z = a.z;

if(a.w > b.w)

b.w = a.w;


works fine. After reading User Guide, I saw A.2 Relational Operators on Short Vectors, the ternary operator ?: could do the same thing. So I change it to:

reduce void(float4 a<>, reduce float4 b<>)


b = a > b ? a : b;


But I get error message containing must use any() or all() for logical operation like that.

Anyone has a clue? Thank you.

1 Reply
Adept I

Comparison operators >, < , ==, != are not supported for vector datatypes