Skip to content

Conversation

@CascadingRadium
Copy link
Member

  • Adds the faiss_get_free_memory API that returns the amount of memory available in a GPU in bytes.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new C API function to retrieve the amount of free GPU memory in bytes. The implementation wraps the existing C++ faiss::gpu::getFreeMemory function to expose it to C callers.

  • Adds faiss_get_free_memory function that takes a device ID and returns the free memory via an output parameter
  • Follows the established pattern for C API wrappers in the codebase
  • Uses the CATCH_AND_HANDLE macro for consistent error handling

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
c_api/gpu/DeviceUtils_c.h Declares the new faiss_get_free_memory function with proper documentation
c_api/gpu/DeviceUtils_c.cpp Implements the function by wrapping faiss::gpu::getFreeMemory with appropriate error handling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Successfully merging this pull request may close these issues.

2 participants