Namespace Acts::Sycl

namespace Sycl

Functions

cl::sycl::nd_range<1> calculate1DimNDRange(const uint32_t numThreads, const uint32_t workGroupSize)

Calculate global range of 1 dimensional nd_range for kernel execution.

Calculates the global dimension of the nd_range, which is the smallest multiple of workGroupSize that is not smaller than numThreads.

Parameters
  • numThreads[in] is the number of threads globally

  • workGroupSize[in] is the number of threads in one work group

Returns

a one dimensional nd_range of threads

cl::sycl::nd_range<2> calculate2DimNDRange(const uint32_t numThreadsDim0, const uint32_t numThreadsDim1, const uint32_t workGroupSize)

Calculate global and local range of 2 dimensional nd_range for kernel execution.

Local range is calculated the following way:

  • local range dimensions multiplied together should be equal to workGroupSize

  • if workGroupSize > numThreadsDim1: set local range in the second dimension to be equal to the smallest factor of 2, that is not smaller that the number of threads globally in the second dimension

  • else: local range is {1, workGroupSize}

Global range is calculated the following way:

  • set the number of threads in both dimensions to the smallest multiple of the work group size in that dimension

Parameters
  • numThreadsDim0[in] is the number of threads globally in the first dimension

  • numThreadsDim1[in] is the number of threads globally in the second dimension

  • workGroupSize[in] is the number of threads in one work group

Returns

a two dimensional nd_range of threads

void createSeedsForGroupSycl(QueueWrapper wrappedQueue, vecmem::memory_resource &resource, vecmem::memory_resource *device_resource, const detail::DeviceSeedfinderConfig &seedfinderConfig, const DeviceExperimentCuts &deviceCuts, vecmem::vector<detail::DeviceSpacePoint> &bottomSPs, vecmem::vector<detail::DeviceSpacePoint> &middleSPs, vecmem::vector<detail::DeviceSpacePoint> &topSPs, std::vector<std::vector<detail::SeedData>> &seeds)

Seedfinding algorithm implemented in SYCL.

Parameters
  • wrappedQueue[in] is a wrapper object of the SYCL queue

  • resource[in] is the host-accessible memory resource to use

  • device_resource[in] is the optional device-accessible memory resource, necessary if resource is not device-accessible

  • seedfinderConfig[in] includes the required configuration parameters for the algorithm

  • deviceCuts[in] is an experiment specific object with customizable seed weight altering and seed cutting member functions

  • bottomSPs[in] an array of simplified internal space point structures of bottom space points

  • middleSPs[in] an array of simplified internal space point structures of middle space points

  • topSPs[in] an array of simplified internal space point structures of top space points

  • seeds[out] holds of the generated seed indices and weight

void listPlatforms()

This function allows us to list availabe SYCL platforms and devices.

Available platforms and devices only include previously linked targets by CMake, which can optionally be altered by environment variable SYCL_BE.

class DeviceExperimentCuts
#include </home/docs/checkouts/readthedocs.org/user_builds/acts/checkouts/v19.7.0/Plugins/Sycl/include/Acts/Plugins/Sycl/Seeding/DeviceExperimentCuts.hpp>

DeviceExperimentCuts can be used to increase or decrease seed weights based on the space points used in a seed.

Seed weights are also influenced by the SeedFilter default implementation. This tool is also used to decide if a seed passes a seed weight cut. As the weight is stored in seeds, there are two distinct methods.

Public Functions

inline float seedWeight(const detail::DeviceSpacePoint &bottom, const detail::DeviceSpacePoint &middle, const detail::DeviceSpacePoint &top) const

Returns seed weight bonus/malus depending on detector considerations.

Parameters
  • bottom – bottom space point of the current seed

  • middle – middle space point of the current seed

  • top – top space point of the current seed

Returns

seed weight to be added to the seed’s weight

inline bool singleSeedCut(float weight, const detail::DeviceSpacePoint &bottom, const detail::DeviceSpacePoint &middle, const detail::DeviceSpacePoint &top) const
Parameters
  • weight – the current seed weight

  • bottom – bottom space point of the current seed

  • middle – middle space point of the current seed

  • top – top space point of the current seed

Returns

true if the seed should be kept, false if the seed should be discarded

struct DeviceSelector : public device_selector
#include </home/docs/checkouts/readthedocs.org/user_builds/acts/checkouts/v19.7.0/Plugins/Sycl/include/Acts/Plugins/Sycl/Utilities/DeviceSelector.hpp>

Custom device selector that refuses to select NVIDIA OpenCL backends.

It is also possible to the tell the selector explicitly which device we want to use by providing a substring of the preferred device’s name.

Public Functions

DeviceSelector(const std::string &deviceName = "")
int operator()(const cl::sycl::device &d) const
class QueueWrapper
#include </home/docs/checkouts/readthedocs.org/user_builds/acts/checkouts/v19.7.0/Plugins/Sycl/include/Acts/Plugins/Sycl/Utilities/QueueWrapper.hpp>

Accessor functions/operators

const cl::sycl::queue *getQueue() const

Get stored pointer (const)

cl::sycl::queue *getQueue()

Get stored pointer (non-const)

const cl::sycl::queue *operator->() const

Operator implementing smart pointer behaviour (const)

cl::sycl::queue *operator->()

Operator implementing smart pointer behaviour (non-const)

const cl::sycl::queue &operator*() const

De-referencing operator (const)

cl::sycl::queue &operator*()

De-referencing operator (non-const)

Public Functions

QueueWrapper(const std::string& = "", std::unique_ptr<const Logger> logger = getDefaultLogger("Sycl::QueueWrapper", Logging::INFO))

Create queue with default selector or given name Default constructed queue wrappers are owners.

QueueWrapper(cl::sycl::queue &queue, std::unique_ptr<const Logger> logger = getDefaultLogger("Sycl::QueueWrapper", Logging::INFO))

Constructor around an existing queue object.

QueueWrapper(QueueWrapper &&parent) noexcept

Move constructor It takes ownership (if it is given).

QueueWrapper(const QueueWrapper &other)

Copy constructor Does not give ownership to the underlying pointer.

~QueueWrapper()

Destructor Destroy the underlying pointer, but only if it is owned.

QueueWrapper &operator=(QueueWrapper &&rhs) noexcept

Move assignment operator.

QueueWrapper &operator=(const QueueWrapper &other)

Copy assignment operator.

template<typename external_spacepoint_t>
class Seedfinder
#include </home/docs/checkouts/readthedocs.org/user_builds/acts/checkouts/v19.7.0/Plugins/Sycl/include/Acts/Plugins/Sycl/Seeding/Seedfinder.hpp>

Public Functions

Seedfinder(Acts::SeedfinderConfig<external_spacepoint_t> config, const Acts::Sycl::DeviceExperimentCuts &cuts, Acts::Sycl::QueueWrapper wrappedQueue, vecmem::memory_resource &resource, vecmem::memory_resource *device_resource = nullptr)
Seedfinder() = delete
Seedfinder(const Seedfinder<external_spacepoint_t>&) = delete
~Seedfinder() = default
template<typename sp_range_t>
std::vector<Seed<external_spacepoint_t>> createSeedsForGroup(sp_range_t bottomSPs, sp_range_t middleSPs, sp_range_t topSPs) const

Create all seeds from the space points in the three iterators.

Can be used to parallelize the seed creation

Parameters
  • bottomSPs – group of space points to be used as innermost SP in a seed.

  • middleSPs – group of space points to be used as middle SP in a seed.

  • topSPs – group of space points to be used as outermost SP in a seed. Ranges must return pointers. Ranges must be separate objects for each parallel call.

Returns

vector in which all found seeds for this group are stored.

Seedfinder<external_spacepoint_t> &operator=(const Seedfinder<external_spacepoint_t>&) = delete