CUDA.jl icon indicating copy to clipboard operation
CUDA.jl copied to clipboard

CUSPARSE: Better error msg for unsupported sparse mm

Open Roger-luo opened this issue 3 years ago • 5 comments

currently when the element-type happens to be mix of Float32 and Float64 (which happens quite often for users when they use cu for the conversion) mul! will just call the generic fallback and if CUDA.allowscalar is not set, this would just throw a warning a while later.

This PR let this dispatch path just error since it's not supported for now anyways.

Roger-luo avatar Apr 07 '22 18:04 Roger-luo

it seems CI failure unrelated to this PR

Roger-luo avatar Apr 08 '22 00:04 Roger-luo

Although I like better error messages, which is why I filed https://github.com/JuliaGPU/CUDA.jl/issues/1271, I don't think that adding a lengthy implementation like this for every operation scales well. We need a simpler way to add such implementations (metaprogramming) or another way to detect the use of fallbacks. Isn't the scalar indexing error message clear enough?

maleadt avatar Apr 11 '22 06:04 maleadt

Isn't the scalar indexing error message clear enough?

I think scalar indexing is just a general error for CUDA since it doesn't say anything about why it is scalar indexing, e.g most of cases I'd like to know whether it's because something is not implemented.

Yeah, I'm not sure what would be the best way to detect this type of interface overloading automatically, so I just did it manually since I hit this one quite often...

Roger-luo avatar Apr 11 '22 06:04 Roger-luo

OK just had another idea, what if we make a macro @not_supported for this? e.g

@not_supported <method signature>

this is probably more readable?

Roger-luo avatar May 26 '22 16:05 Roger-luo

Yeah that seems like a better approach.

maleadt avatar May 27 '22 14:05 maleadt