Skip to content

Feature Request: Conditional Inclusion of CPU and GPU Versions in Plugin #6

Description

@j05hau

Issue Description

Currently, the plugin architecture does not dynamically include the necessary files for CPU and GPU support based on the environment it's running in. The codebase has the GPU include only. This setup requires manual intervention to switch between supported CPU and GPU versions, which is not ideal for a seamless development experience.

Proposed Solution

I propose that we enhance the plugin to use conditional statements that automatically determine the environment (CPU or GPU) and include the corresponding version dynamically. This way, the plugin can automatically detect the presence of directories such as dlls or lib within the respective CPU or GPU folders and act accordingly.

The expected structure would be:

  • For CPU: ...\ThirdParty\LibTorch\Win64\CPU\include
  • For GPU: ...\ThirdParty\LibTorch\Win64\GPU\include

The plugin should check for the existence of these directories and utilize the corresponding version based on what's available or specified as the target environment.

Benefits

  • Automation: Eliminates the need for manual switching between CPU and GPU versions, enhancing developer productivity.
  • Flexibility: Supports both CPU and GPU environments out of the box without additional setup other than adding the supported lib files found in Releases.
  • Simplicity: Simplifies the project structure by having a single, unified branch that supports both environments.

Implementation Considerations

  • We need to define the logic for detecting the environment and choosing the right directory.
  • Ensure that the inclusion of these directories does not lead to conflicts or ambiguous references in the project.
  • Testing should be comprehensive to cover both CPU and GPU environments.

Request for Comments

I invite contributors to provide feedback on this proposal, especially regarding:

  • Potential challenges in implementing the proposed solution.
  • Suggestions for an effective implementation approach.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions