Skip to content

Conversation

@Critsium-xy
Copy link
Collaborator

Using memory_op to set diag_const_nums allows diag consts being directly allocated to some hardwares like dsp. Most hardwares don't need this because they will automatically copy the consts to their device, but some will need you to do this manually. This is a way to solve this issue. It is a foundation for transplanting abacus to dsp hardware( or some similar hardwares later ). This has not influence on devices like gpu and dcu.

@mohanchen mohanchen added the GPU & DCU & HPC GPU and DCU and HPC related any issues label Oct 17, 2024
Copy link

@haozhihan haozhihan left a comment

Choose a reason for hiding this comment

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

LGTM

@mohanchen mohanchen merged commit 545d2ec into deepmodeling:develop Oct 18, 2024
14 checks passed
@Critsium-xy Critsium-xy deleted the consts_refactor branch October 18, 2024 05:13
Fisherd99 pushed a commit to Fisherd99/abacus-BSE that referenced this pull request Mar 31, 2025
* Use memory_op to set consts

* Fix segfault

* Pyabacus test

* Revert changes

* Modify pointer usage

* I will win

* Malloc test

* Initialize with nullptr

* Remove useless code

---------

Co-authored-by: Haozhi Han <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GPU & DCU & HPC GPU and DCU and HPC related any issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants