Skip to content

Commit

Permalink
no threads for gpu
Browse files Browse the repository at this point in the history
  • Loading branch information
awni committed Nov 7, 2024
1 parent 6c0ad3f commit d1b2ce8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mlx/scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ Stream new_stream(Device d, int threads /* = 1 */) {
throw std::invalid_argument(
"[new_stream] Cannot make gpu stream without gpu backend.");
}
if (d == Device::gpu && threads > 1) {
throw std::invalid_argument(
"[new_stream] Cannot make multi-threaded gpu stream.");
}
return scheduler::scheduler().new_stream(d, threads);
}

Expand Down

0 comments on commit d1b2ce8

Please sign in to comment.