-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make traccc::alpaka executables work in pure C++ (#832)
* Make traccc::alpaka executables work in pure C++: move device code to utils. Built on work by Ryan Cross * Fix formatting * Fix choice of CPU backend, move to alpaka device_copy in track_params_estimation * Fix formatting * Remove variable only used for one file * Move to CDNA warp size for AMD * Fix ifdef logic for SYCL * Formatting * Move back to vecmem::copy * Move back to vecmem::copy * Move tag logic to device_tag.hpp, make get_device_info return a string * Remove position-independent executable logic: not needed now that this is pure C++ * Fix copy-paste error in alpaka cuda device_memory_resource --------- Co-authored-by: Stewart Martin-Haugh stewart.martin-haugh@stfc.ac.uk <smh@cern.ch>
- Loading branch information
Showing
15 changed files
with
152 additions
and
116 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** TRACCC library, part of the ACTS project (R&D line) | ||
* | ||
* (c) 2024 CERN for the benefit of the ACTS project | ||
* | ||
* Mozilla Public License Version 2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <alpaka/acc/Tag.hpp> | ||
|
||
namespace traccc::alpaka { | ||
|
||
// Get alpaka tag for current device | ||
#if defined(ALPAKA_ACC_GPU_CUDA_ENABLED) | ||
using AccTag = ::alpaka::TagGpuCudaRt; | ||
#elif defined(ALPAKA_ACC_GPU_HIP_ENABLED) | ||
using AccTag = ::alpaka::TagGpuHipRt; | ||
#elif defined(ALPAKA_ACC_SYCL_ENABLED) | ||
#if defined(ALPAKA_SYCL_ONEAPI_CPU) | ||
using AccTag = ::alpaka::TagCpuSycl; | ||
#elif defined(ALPAKA_SYCL_ONEAPI_FPGA) | ||
using AccTag = ::alpaka::TagFpgaSyclIntel; | ||
#elif defined(ALPAKA_SYCL_ONEAPI_GPU) | ||
using AccTag = ::alpaka::TagGpuSyclIntel; | ||
#endif | ||
#elif defined(ALPAKA_ACC_CPU_B_SEQ_T_THREADS_ENABLED) | ||
using AccTag = ::alpaka::TagCpuThreads; | ||
#endif | ||
|
||
} // namespace traccc::alpaka |
19 changes: 19 additions & 0 deletions
19
device/alpaka/include/traccc/alpaka/utils/get_device_info.hpp
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,19 @@ | ||
/** TRACCC library, part of the ACTS project (R&D line) | ||
* | ||
* (c) 2024 CERN for the benefit of the ACTS project | ||
* | ||
* Mozilla Public License Version 2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <string> | ||
|
||
namespace traccc::alpaka { | ||
|
||
/// Function that prints the current device information to the console. | ||
/// Included as part of the traccc::alpaka namespace, to avoid having to include | ||
/// alpaka headers in any users of the library. | ||
std::string get_device_info(); | ||
|
||
} // namespace traccc::alpaka |
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,23 @@ | ||
/** TRACCC library, part of the ACTS project (R&D line) | ||
* | ||
* (c) 2025 CERN for the benefit of the ACTS project | ||
* | ||
* Mozilla Public License Version 2.0 | ||
*/ | ||
|
||
// Local include(s). | ||
#include "utils.hpp" | ||
|
||
// Project include(s). | ||
#include "traccc/alpaka/utils/get_device_info.hpp" | ||
|
||
namespace traccc::alpaka { | ||
|
||
std::string get_device_info() { | ||
int device = 0; | ||
auto devAcc = ::alpaka::getDevByIdx(::alpaka::Platform<Acc>{}, 0u); | ||
return std::string("Using Alpaka device: " + ::alpaka::getName(devAcc) + | ||
" [id: " + std::to_string(device) + "] "); | ||
} | ||
|
||
} // namespace traccc::alpaka |
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
Oops, something went wrong.