Skip to content

Fix Compilation Issue: Define Correct Integer Type for Linux and Windows in droid_kernels.cu File #148

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

olayasturias
Copy link

Summary

This PR fixes a compilation issue in the CUDA droid_kernels.cu file that occurs when running setup.py on different operating systems. Previously, the build failed because long is 64-bit on Linux but not necessarily on Windows. This change ensures compatibility by defining LongType as:

  • int64_t on Windows
  • long on Linux

Changes

  • Added preprocessor directives to differentiate between Windows (_WIN32) and other platforms.
  • Used int64_t for Windows and long for Linux to ensure LongType remains 64-bit.
  • Updated the kernel function to use LongType.

Why This Fix?

The previous implementation led to setup.py compilation failures on Windows due to type mismatches, as seen in #39 . Using #ifdef ensures consistency across platforms.

Testing

  • Compiled and tested on Linux (Ubuntu 22.04)
  • Compiled and tested on Windows 10 with MSVC
  • Verified the generated binary runs without issues on both platforms

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