This repository has been archived by the owner on Dec 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Remove device initialization from library #385
Merged
Merged
Changes from 2 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
0ca32be
Removed device initialization from library
ariostas fb69c00
Standalone now constructs device and queue outside library
ariostas 87664ad
A bit of cleanup
ariostas 0cac5cd
Merge branch 'master' into move_device_initialization
ariostas a7aabe1
Removed global host device
ariostas 74fbc80
Switched to using types defined in cmssw
ariostas c5d4d8c
Format code
ariostas fe64b69
Get device from queue
ariostas 4a229a0
Minor makefile fix
ariostas e059a86
Merge branch 'master' into move_device_initialization
ariostas 41d85f6
Fix loadAndFillES inputs
ariostas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "LST.h" | ||
#include "Event.h" | ||
#include "Globals.h" | ||
|
||
|
@@ -17,13 +17,15 @@ | |
return fullpath.string(); | ||
} | ||
|
||
void loadMaps(SDL::MapPLStoLayer& pLStoLayer) { | ||
void loadMaps(SDL::Dev const& devAccIn, SDL::QueueAcc& queue, SDL::MapPLStoLayer& pLStoLayer) { | ||
// Module orientation information (DrDz or phi angles) | ||
auto endcap_geom = | ||
get_absolute_path_after_check_file_exists(trackLooperDir() + "/data/OT800_IT615_pt0.8/endcap_orientation.txt"); | ||
auto tilted_geom = get_absolute_path_after_check_file_exists( | ||
trackLooperDir() + "/data/OT800_IT615_pt0.8/tilted_barrel_orientation.txt"); | ||
SDL::Globals<SDL::Dev>::endcapGeometry->load(endcap_geom); // centroid values added to the map | ||
if (SDL::Globals<SDL::Dev>::endcapGeometry == nullptr) { | ||
SDL::Globals<SDL::Dev>::endcapGeometry = new SDL::EndcapGeometry<SDL::Dev>(devAccIn, queue, endcap_geom); // centroid values added to the map | ||
} | ||
SDL::Globals<SDL::Dev>::tiltedGeometry.load(tilted_geom); | ||
|
||
// Module connection map (for line segment building) | ||
|
@@ -53,14 +55,14 @@ | |
|
||
} // namespace | ||
|
||
void SDL::LST<SDL::Acc>::loadAndFillES(alpaka::QueueCpuBlocking& queue, struct modulesBuffer<alpaka::DevCpu>* modules) { | ||
void SDL::LST<SDL::Acc>::loadAndFillES(SDL::Dev const& devAccIn, SDL::QueueAcc& queue, struct modulesBuffer<alpaka::DevCpu>* modules) { | ||
SDL::MapPLStoLayer pLStoLayer; | ||
::loadMaps(pLStoLayer); | ||
::loadMaps(devAccIn, queue, pLStoLayer); | ||
|
||
auto path = | ||
get_absolute_path_after_check_file_exists(trackLooperDir() + "/data/OT800_IT615_pt0.8/sensor_centroids.txt"); | ||
if (SDL::Globals<SDL::Dev>::modulesBuffers == nullptr) { | ||
SDL::Globals<SDL::Dev>::modulesBuffers = new SDL::modulesBuffer<SDL::Dev>(SDL::devAcc); | ||
SDL::Globals<SDL::Dev>::modulesBuffers = new SDL::modulesBuffer<SDL::Dev>(devAccIn); | ||
} | ||
if (SDL::Globals<SDL::Dev>::pixelMapping == nullptr) { | ||
SDL::Globals<SDL::Dev>::pixelMapping = std::make_shared<SDL::pixelMap>(); | ||
|
@@ -74,7 +76,8 @@ | |
pLStoLayer); | ||
} | ||
|
||
void SDL::LST<SDL::Acc>::run(SDL::QueueAcc& queue, | ||
void SDL::LST<SDL::Acc>::run(SDL::Dev& devAccIn, | ||
SDL::QueueAcc& queue, | ||
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. does it make sense to have a queue and a device separately? Isn't a queue uniquely attached to a device? 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. That's a good point. I'll tidy things up. |
||
const SDL::modulesBuffer<SDL::Dev>* modules, | ||
bool verbose, | ||
const std::vector<float> see_px, | ||
|
@@ -97,7 +100,7 @@ | |
const std::vector<float> ph2_y, | ||
const std::vector<float> ph2_z) { | ||
SDL::Globals<SDL::Dev>::modulesBuffersES = modules; | ||
auto event = SDL::Event<Acc>(verbose, queue); | ||
auto event = SDL::Event<Acc>(verbose, devAccIn, queue); | ||
prepareInput(see_px, | ||
see_py, | ||
see_pz, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
does this need to be a template? can
SDL::QueueAcc
be used instead?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.
Yeah, I was also thinking about this. I think now we don't really need any templates since we could just use
SDL::Dev
,SDL::DevAcc
andSDL::QueueAcc
. So I was deciding whether to sticking with templated functions like in most of the code.