Skip to content

Remove thrust from dependencies of the cpu kernel. - #46

Merged
hzhangxyz merged 1 commit into
mainfrom
dev/remove-thrust-deps-for-cpu-kernels
Jun 24, 2025
Merged

Remove thrust from dependencies of the cpu kernel.#46
hzhangxyz merged 1 commit into
mainfrom
dev/remove-thrust-deps-for-cpu-kernels

Conversation

@hzhangxyz

Copy link
Copy Markdown
Member

Description

Checklist:

Copilot AI review requested due to automatic review settings June 18, 2025 04:18

Copilot AI left a comment

Copy link
Copy Markdown

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 removes dependencies on the Thrust library by replacing thrust::sort and thrust::sort_by_key with std::sort, and updates the default comparator in a heap helper from thrust::less to std::less.

  • Swapped out Thrust sorting functions for std::sort and updated related code paths
  • Removed Thrust includes and updated the heap helper template comparator
Comments suppressed due to low confidence (1)

qmb/_hamiltonian_cpu.cpp:1

  • After removing Thrust, you need to add #include <algorithm> (and #include <functional> if std::less isn't already covered) at the top to ensure std::sort and std::less are defined.
#include <torch/extension.h>

@BrevityD

Copy link
Copy Markdown

为什么要remove thrust 啊?看这个库的描述不是比标准库更适合CUDA环境吗?

@hzhangxyz

Copy link
Copy Markdown
Member Author

为什么要remove thrust 啊?看这个库的描述不是比标准库更适合CUDA环境吗?

@BrevityD 这个cpu的实现和cuda的实现,移除了cpu部分对thrust的依赖,让没有cuda没gpu的机子可以跑。

@BrevityD

Copy link
Copy Markdown

为什么要remove thrust 啊?看这个库的描述不是比标准库更适合CUDA环境吗?

@BrevityD 这个cpu的实现和cuda的实现,移除了cpu部分对thrust的依赖,让没有cuda没gpu的机子可以跑。
Got it.

@hzhangxyz
hzhangxyz merged commit 522af85 into main Jun 24, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants