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

Improved errors when calling device functions on CPU #90

Closed
dmillard opened this issue Feb 10, 2023 · 1 comment · Fixed by #144
Closed

Improved errors when calling device functions on CPU #90

dmillard opened this issue Feb 10, 2023 · 1 comment · Fixed by #144
Labels
good first issue Good for newcomers

Comments

@dmillard
Copy link

Currently, calling a device function in CPU code causes an ambiguous error and then an infinite hang:

julia> thread_position_in_grid_1d()
JIT session error: Symbols not found: [ _julia.air.thread_position_in_grid.i32 ]
JIT session error: Symbols not found: [ _julia.air.thread_position_in_grid.i32 ]

I realized this when trying to call thread_execution_width(), not realizing it was device-only, but it wasn't clear to me if it wasn't properly wrapped or if something else was going on.

Maybe a clearer error could be raised?

@maleadt
Copy link
Member

maleadt commented Feb 13, 2023

We could take the @device_functions mechanism from CUDA.jl to make a couple of these common functions error: https://github.com/JuliaGPU/CUDA.jl/blob/868d33ea3067d6bb2403a9cf29d0f1214548314b/src/device/intrinsics/indexing.jl#L64

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

Successfully merging a pull request may close this issue.

2 participants