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

Custom PhysicalDevice Selection Logic #61

Open
jedjoud10 opened this issue Jul 11, 2023 · 2 comments
Open

Custom PhysicalDevice Selection Logic #61

jedjoud10 opened this issue Jul 11, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@jedjoud10
Copy link
Contributor

'Tis my first feature request. Tell me if this is good or if I should add more detail.

Implement a proper interface to allow users to select their PhysicalDevice (with potential fallback if none are selected?).

Two ways this could be done:
Allow users to fetch an iterator of PhysicalDevices somehow, and then force the user to pass a reference of one of those PhysicalDevice to AppSettings``. This forces the user to have a fallback ready when their own GPU selection impl fails.

Have a callback fn (F: Fn(&PhysicalDevice) -> bool) that will loop over all PhysicalDevices internally, and let user select their preferred physical device. This could be further extended by using a scoring system but I'd feel like that's a higher-level thing than what this lib wants to achieve, but I'm not sure. One problem with this method though is that we need to somehow select a fallback PhysicalDevice if the function returns false for all previous iterations.

@jedjoud10 jedjoud10 added the enhancement New feature or request label Jul 11, 2023
@jedjoud10
Copy link
Contributor Author

Oh actually we could fix the latter by forcing the user to select a PhysicalDevice by using a F: Fn(&[&PhysicalDevice]) -> usize, which would force the user to pick a physical device (or could return 0 for a default physical device if needed)

@NotAPenguin0
Copy link
Owner

I like the scoring approach yeah

jedjoud10 added a commit to jedjoud10/phobos-rs that referenced this issue Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants