-
Notifications
You must be signed in to change notification settings - Fork 249
Fix #7959 #7956, remove useless file. #7962
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,73 @@ | |||||||||||||||||
| //======================= | |||||||||||||||||
| // AUTHOR : Peize Lin | |||||||||||||||||
| // DATE : 2022-08-17 | |||||||||||||||||
| //======================= | |||||||||||||||||
|
|
|||||||||||||||||
| // Born-von Karmen supercell utilities. | |||||||||||||||||
| // This header is free of LibRI dependencies so that modules built without | |||||||||||||||||
| // LibRI (e.g. module_lr) can use it. | |||||||||||||||||
|
|
|||||||||||||||||
| #ifndef RI_UTIL_BVK_H | |||||||||||||||||
| #define RI_UTIL_BVK_H | |||||||||||||||||
|
|
|||||||||||||||||
| #include "source_cell/klist.h" | |||||||||||||||||
|
|
|||||||||||||||||
| #include <array> | |||||||||||||||||
| #include <vector> | |||||||||||||||||
|
|
|||||||||||||||||
| namespace RI_Util | |||||||||||||||||
| { | |||||||||||||||||
| inline std::array<int,3> | |||||||||||||||||
| get_Born_vonKarmen_period(const K_Vectors &kv) | |||||||||||||||||
| { | |||||||||||||||||
| return std::array<int,3>{kv.nmp[0], kv.nmp[1], kv.nmp[2]}; | |||||||||||||||||
| } | |||||||||||||||||
|
|
|||||||||||||||||
| // cell index c folded into [0, period) like (c % period + period) % period | |||||||||||||||||
| template<typename Tcell> | |||||||||||||||||
| std::vector<std::array<Tcell,1>> | |||||||||||||||||
| get_Born_von_Karmen_cells( const std::array<Tcell,1> &Born_von_Karman_period ) | |||||||||||||||||
| { | |||||||||||||||||
| std::vector<std::array<Tcell,1>> Born_von_Karman_cells; | |||||||||||||||||
| for( Tcell c=0; c<Born_von_Karman_period[0]; ++c ) | |||||||||||||||||
| Born_von_Karman_cells.emplace_back( std::array<Tcell,1>{c} ); | |||||||||||||||||
| return Born_von_Karman_cells; | |||||||||||||||||
| } | |||||||||||||||||
|
|
|||||||||||||||||
| template<typename Tcell, size_t Ndim> | |||||||||||||||||
| std::vector<std::array<Tcell,Ndim>> | |||||||||||||||||
| get_Born_von_Karmen_cells( const std::array<Tcell,Ndim> &Born_von_Karman_period ) | |||||||||||||||||
| { | |||||||||||||||||
| std::array<Tcell,Ndim-1> sub_Born_von_Karman_period; | |||||||||||||||||
| for(size_t i=0; i<Ndim-1; ++i) | |||||||||||||||||
| sub_Born_von_Karman_period[i] = Born_von_Karman_period[i]; | |||||||||||||||||
|
|
|||||||||||||||||
| std::vector<std::array<Tcell,Ndim>> Born_von_Karman_cells; | |||||||||||||||||
| for( const std::array<Tcell,Ndim-1> &sub_cell : get_Born_von_Karmen_cells(sub_Born_von_Karman_period) ) | |||||||||||||||||
| for( Tcell c=0; c<Born_von_Karman_period.back(); ++c ) | |||||||||||||||||
| { | |||||||||||||||||
| std::array<Tcell,Ndim> cell; | |||||||||||||||||
| for(size_t i=0; i<Ndim-1; ++i) | |||||||||||||||||
| cell[i] = sub_cell[i]; | |||||||||||||||||
| cell.back() = c; | |||||||||||||||||
| Born_von_Karman_cells.emplace_back(std::move(cell)); | |||||||||||||||||
| } | |||||||||||||||||
| return Born_von_Karman_cells; | |||||||||||||||||
| } | |||||||||||||||||
|
Comment on lines
+26
to
+56
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LibRI's integer
Callers rely on exact coordinate keys. For example, |
|||||||||||||||||
|
|
|||||||||||||||||
| /* example for Ndim=3: | |||||||||||||||||
| template<typename Tcell, size_t Ndim> | |||||||||||||||||
| std::vector<std::array<Tcell,Ndim>> | |||||||||||||||||
| get_Born_von_Karmen_cells( const std::array<Tcell,Ndim> &Born_von_Karman_period ) | |||||||||||||||||
| { | |||||||||||||||||
| std::vector<std::array<Tcell,Ndim>> Born_von_Karman_cells; | |||||||||||||||||
| for( int ix=0; ix<Born_von_Karman_period[0]; ++ix ) | |||||||||||||||||
| for( int iy=0; iy<Born_von_Karman_period[1]; ++iy ) | |||||||||||||||||
| for( int iz=0; iz<Born_von_Karman_period[2]; ++iz ) | |||||||||||||||||
| Born_von_Karman_cells.push_back( std::array<Tcell,Ndim>{ix,iy,iz} ); | |||||||||||||||||
| return Born_von_Karman_cells; | |||||||||||||||||
| } | |||||||||||||||||
| */ | |||||||||||||||||
| } | |||||||||||||||||
|
|
|||||||||||||||||
| #endif | |||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Defining
__USE_NVTXonbasemakestimer.cpp.orequire NVTX symbols, but linkingCUDA::nvToolsExtonly to the main executable leaves otherbaseconsumers without that dependency. CUDA 12.2 CI already fails to link tests such asMODULE_CELL_SYMMETRY_analysiswith undefined references tonvtxRangePushAandnvtxRangePop.