Closed rayegun closed 7 months ago
That would be really difficult. Each UDT could have an arbitrary list of possible typecasting, each with its own function pointer. The effort to implement this would far outweigh the benefits.
Kernel fusion would eventually help with this.
Would it be possible to somehow provide 2 operators to the accum then? Even with kernel fusion a heterogeneous accum will still have to cast T into C if T[i,j] exists and C[i,j] does not (in C = accum(C, T)
)
Ah I suppose ewise_union fused with the original would be the answer.
Typecasting as it stands now, between built in types, is a real mess to implement and the source of many of my bugs in the past. It's also undefined in certain cases because the C language itself leaves some cases undefined.
Ewise add is weird. In my opinion, ewise add in the spec is odd because entries typecast and bypass the op. They don't do that in my GxB ewise union. But accum is essentially an ewise add not like my ewise union. It would be far too difficult to revise how the accum works
Using a UDT in combination with any other type is quite a fraught process. The lack of casting or promotion affects at least:
Now that we have the ability to JIT register code, it would be nice to also support (optionally) JITable cast operators. These would be standard
UnaryOps
but could be registered with a type (GrB_Type_set(MyInt128, GxB_CASTOP, myop)
perhaps).