-
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.
Call device functions consistently from SYCL.
- Loading branch information
Showing
6 changed files
with
67 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** 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 | ||
*/ | ||
|
||
#pragma once | ||
|
||
// Project include(s). | ||
#include "traccc/device/global_index.hpp" | ||
|
||
// SYCL include(s). | ||
#include <sycl/sycl.hpp> | ||
|
||
namespace traccc::sycl::details { | ||
|
||
/// Function creating a global index in a 1D SYCL kernel | ||
inline device::global_index_t global_index(const ::sycl::nd_item<1>& item) { | ||
|
||
return static_cast<device::global_index_t>(item.get_global_linear_id()); | ||
} | ||
|
||
/// Function creating a global index in a 2D SYCL kernel | ||
inline device::global_index_t global_index(const ::sycl::nd_item<2>& item) { | ||
|
||
return static_cast<device::global_index_t>(item.get_global_linear_id()); | ||
} | ||
|
||
/// Function creating a global index in a 3D SYCL kernel | ||
inline device::global_index_t global_index(const ::sycl::nd_item<3>& item) { | ||
|
||
return static_cast<device::global_index_t>(item.get_global_linear_id()); | ||
} | ||
|
||
} // namespace traccc::sycl::details |