Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-27 08:33:40

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #include <cstdint>
0010 
0011 #include "CudaUnavailable.hpp"
0012 #include "DeviceOps.hpp"
0013 
0014 namespace ActsPlugins::detail {
0015 
0016 TensorPtr cudaCreateTensorMemory(std::size_t /*nbytes*/,
0017                                  const ExecutionContext & /*ctx*/) {
0018   throwNoCudaSupport("create CUDA tensor");
0019 }
0020 
0021 void cudaCopyTensorMemory(void * /*dst*/, const void * /*src*/,
0022                           std::size_t /*nbytes*/, Device /*from*/,
0023                           const ExecutionContext & /*to*/) {
0024   throwNoCudaSupport("copy CUDA tensor memory");
0025 }
0026 
0027 void cudaSigmoid(Tensor<float> & /*tensor*/, cudaStream_t /*stream*/) {
0028   throwNoCudaSupport("apply sigmoid to CUDA tensor");
0029 }
0030 
0031 Tensor<bool> cudaScoreMask(const Tensor<float> & /*scores*/, float /*cut*/,
0032                            cudaStream_t /*stream*/) {
0033   throwNoCudaSupport("compute score mask on CUDA tensor");
0034 }
0035 
0036 template <typename T>
0037 Tensor<T> cudaSelectRows(const Tensor<T> & /*tensor*/,
0038                          const Tensor<bool> & /*mask*/,
0039                          const ExecutionContext & /*execContext*/) {
0040   throwNoCudaSupport("selectRows on CUDA tensor");
0041 }
0042 
0043 template <typename T>
0044 Tensor<T> cudaSelectCols(const Tensor<T> & /*tensor*/,
0045                          const Tensor<bool> & /*mask*/,
0046                          const ExecutionContext & /*execContext*/) {
0047   throwNoCudaSupport("selectCols on CUDA tensor");
0048 }
0049 
0050 template <typename T>
0051 Tensor<T> cudaMulPerColumn(const Tensor<T> & /*src*/,
0052                            const Tensor<T> & /*scales*/,
0053                            const ExecutionContext & /*execContext*/) {
0054   throwNoCudaSupport("apply feature scales on CUDA tensor");
0055 }
0056 
0057 PipelineTensors cudaRemoveUnusedNodes(PipelineTensors && /*tensors*/,
0058                                       std::vector<int> & /*spacePointIds*/,
0059                                       const ExecutionContext & /*execCtx*/) {
0060   throwNoCudaSupport("removeUnusedNodes on CUDA tensor");
0061 }
0062 
0063 // The same set Tensor.cu instantiates. A mismatch here is a link error in the
0064 // CUDA-off build, which is why that build is part of CI.
0065 template Tensor<float> cudaSelectRows(const Tensor<float> &,
0066                                       const Tensor<bool> &,
0067                                       const ExecutionContext &);
0068 template Tensor<std::int64_t> cudaSelectRows(const Tensor<std::int64_t> &,
0069                                              const Tensor<bool> &,
0070                                              const ExecutionContext &);
0071 template Tensor<float> cudaSelectCols(const Tensor<float> &,
0072                                       const Tensor<bool> &,
0073                                       const ExecutionContext &);
0074 template Tensor<std::int64_t> cudaSelectCols(const Tensor<std::int64_t> &,
0075                                              const Tensor<bool> &,
0076                                              const ExecutionContext &);
0077 template Tensor<float> cudaMulPerColumn(const Tensor<float> &,
0078                                         const Tensor<float> &,
0079                                         const ExecutionContext &);
0080 template Tensor<std::int64_t> cudaMulPerColumn(const Tensor<std::int64_t> &,
0081                                                const Tensor<std::int64_t> &,
0082                                                const ExecutionContext &);
0083 
0084 }  // namespace ActsPlugins::detail