-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[core,integration] Introduce an interface for using different "AdePT"s.
- Split the transport from the integration-related parts introducing a new source file. The integration-related parts can be reused in a different transport implementation. - Create a transport abstraction, so AdePTTrackingManager is independent of the transport implementation. - Add thread and event IDs to the transport interface. These are necessary for the async transport implementation. - Start to enumerate tracks in the tracking manager. This can be used to reproducibly seed the AdePT random sequences. - Add some const declarations for the default AdePT implementation. - Use a factory function to instantiate AdePT. Like this, different AdePT implementations can be used without changing code in the tracking manager or in AdePTPhysics. - Replace a few includes with forward declarations. - Fix device link errors that can show when using a symbol in multiple cuda translation units.
- Loading branch information
Showing
20 changed files
with
237 additions
and
148 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// SPDX-FileCopyrightText: 2022 CERN | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#ifndef ADEPT_TRANSPORT_INTERFACE_H | ||
#define ADEPT_TRANSPORT_INTERFACE_H | ||
|
||
#include <memory> | ||
#include <string> | ||
#include <vector> | ||
|
||
class AdePTTransportInterface { | ||
public: | ||
virtual ~AdePTTransportInterface() {} | ||
|
||
/// @brief Adds a track to the buffer | ||
virtual void AddTrack(int pdg, int id, double energy, double x, double y, double z, double dirx, double diry, | ||
double dirz, double globalTime, double localTime, double properTime, int threadId, | ||
unsigned int eventId, unsigned int trackIndex) = 0; | ||
|
||
/// @brief Set capacity of on-GPU track buffer. | ||
virtual void SetTrackCapacity(size_t capacity) = 0; | ||
/// @brief Set Hit buffer capacity on GPU and Host | ||
virtual void SetHitBufferCapacity(size_t capacity) = 0; | ||
/// @brief Set maximum batch size | ||
virtual void SetMaxBatch(int npart) = 0; | ||
/// @brief Set buffer threshold | ||
virtual void SetBufferThreshold(int limit) = 0; | ||
/// @brief Set debug level for transport | ||
virtual void SetDebugLevel(int level) = 0; | ||
/// @brief Set whether AdePT should transport particles across the whole geometry | ||
virtual void SetTrackInAllRegions(bool trackInAllRegions) = 0; | ||
/// @brief Check whether AdePT should transport particles across the whole geometry | ||
virtual bool GetTrackInAllRegions() const = 0; | ||
/// @brief Set Geant4 region to which it applies | ||
virtual void SetGPURegionNames(std::vector<std::string> const *regionNames) = 0; | ||
virtual std::vector<std::string> const *GetGPURegionNames() = 0; | ||
virtual void SetCUDAStackLimit(int limit) = 0; | ||
/// @brief Initialize service and copy geometry & physics data on device | ||
virtual void Initialize(bool common_data = false) = 0; | ||
/// @brief Interface for transporting a buffer of tracks in AdePT. | ||
virtual void Shower(int event, int threadId) = 0; | ||
virtual void Cleanup() = 0; | ||
}; | ||
|
||
#endif |
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.