ATLAS Offline Software
Loading...
Searching...
No Matches
LinearTransformAsyncExampleAlg.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2//
3// Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
4//
5#ifndef ATHEXCUDA_LINEARTRANSFORMASYNCEXAMPLEALG_H
6#define ATHEXCUDA_LINEARTRANSFORMASYNCEXAMPLEALG_H
7
8// Framework include(s).
9#include "GaudiKernel/ServiceHandle.h"
11
12// CUDA include(s).
13#include <cuda_runtime_api.h>
14
15// STL
16#include <vector>
17
18namespace AthCUDAExamples {
19
27
28 public:
29 // Inherit the base class's constructor(s).
30 using AthAsynchronousAlgorithm::AthAsynchronousAlgorithm;
31
33 virtual StatusCode execute( const EventContext& ctx ) const override;
34
35 }; // class LinearTransformAsyncExampleAlg
36
38 void linearTransform(cudaStream_t stream, std::vector<float>& arr, float multiplier);
39
40} // namespace AthCUDAExamples
41
42#endif // ATHEXCUDA_LINEARTRANSFORMASYNCEXAMPLEALG_H
An algorithm that can be suspended while work is offloaded to an accelerator.
Example algorithm demonstrating the use of CUDA in an AthAsynchronousAlgorithm.
virtual StatusCode execute(const EventContext &ctx) const override
Function executing the algorithm.
void linearTransform(cudaStream_t stream, std::vector< float > &arr, float multiplier)
GPU kernel launcher.