Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error for thread/group size with different integer types #424

Open
eschnett opened this issue Sep 23, 2024 · 6 comments
Open

Error for thread/group size with different integer types #424

eschnett opened this issue Sep 23, 2024 · 6 comments

Comments

@eschnett
Copy link

This fails:

julia> function f() end
julia> @metal threads=(Int64(1), Int32(1)) f()

with:

ERROR: MethodError: Cannot `convert` an object of type Tuple{Int64, Int32} to an object of type UInt64
The function `convert` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  convert(::Type{UInt64}, ::ObjectiveC.OS.OSSignpost)
   @ ObjectiveC ~/.julia/packages/ObjectiveC/C7BVt/src/os.jl:170
  convert(::Type{UInt64}, ::LLVM.OrcTargetAddress)
   @ LLVM ~/.julia/packages/LLVM/joxPv/src/orc.jl:217
  convert(::Type{T}, ::IntervalArithmetic.ExactReal) where T<:Real
   @ IntervalArithmetic ~/.julia/packages/IntervalArithmetic/hLM2A/src/intervals/exact_literals.jl:111
  ...

Stacktrace:
 [1] Metal.MTL.MTLSize(w::Tuple{Int64, Int32}, h::Int64, d::Int64)
   @ Metal.MTL ~/.julia/packages/Metal/UcSBS/lib/mtl/size.jl:10
@eschnett
Copy link
Author

I am using Metal 1.3.0.

@tgymnich
Copy link
Member

tgymnich commented Sep 23, 2024

Metal currently expects the threads tuple elements to have the same type, so

julia> function f() end
julia> @metal threads=(1,1) f()

should work.

@eschnett
Copy link
Author

Yes, this works. (My issues that it doesn't work when the tuple elements have different types.)

@tgymnich
Copy link
Member

Why is that an issue?

@eschnett
Copy link
Author

It is unexpected and inconvenient. I encountered this by accident and was then confused by the error message. I assumed that this was a case that was unintentionally not handled.

@tgymnich
Copy link
Member

I guess thats fair #425

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants